Skip to content

Instantly share code, notes, and snippets.

View michaelklishin's full-sized avatar

Michael Klishin michaelklishin

View GitHub Profile
show me what you post, gist
posting from Emacs...
what if I want XML back?
Gem structure:
/merb-slices
/lib
/spec
...
/merb_generators
/components
/slice_generator
/thin_slice_generator
require File.join(File.dirname(__FILE__), "spec_helper")
describe Merb::Controller, "._session_cookie_domain" do
before(:each) do
Merb::Config[:session_cookie_domain] = "specs.merbivore.com"
end
it 'is set to Merb::Config[:session_cookie_domain] by default' do
Merb::Controller._session_cookie_domain.should == "specs.merbivore.com"
Merb::Test::Fixtures::Controllers::CookiesController._session_cookie_domain.should == "specs.merbivore.com"
class Grandparent
end
class Parent < Grandparent
end
class Child < Parent
end
class Grandparent
class Grandparent
end
class Parent < Grandparent
end
class Child < Parent
end
class Grandparent
# ==== Parameters
# name<~to_s>:: Name of the cookie.
# value<~to_s>:: Value of the cookie.
# options<Hash>:: Additional options for the cookie (see below).
#
# ==== Options (options)
# :path<String>:: The path for which this cookie applies. Defaults to "/".
# :expires<Time>:: Cookie expiry date.
def set_cookie(name, value, options)
options[:path] = '/' unless options[:path]
# Set whether the Cookie is a secure cookie or not.
#
# +val+ must be a boolean.
def secure=(val)
@secure = val if val == true or val == false
@secure
end
# ==== Returns
# String::
# The path to the log file. If this Merb instance is running as a daemon
# this will return +STDOUT+.
def log_file
if Merb::Config[:log_file]
Merb::Config[:log_file]
elsif Merb.testing?
log_path / "merb_test.log"
elsif !(Merb::Config[:daemonize] || Merb::Config[:cluster])