Skip to content

Instantly share code, notes, and snippets.

💭
We wanted flying cars, instead we got GitHub status

Michael Klishin michaelklishin

Block or report user

Report or block michaelklishin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2919
Gem structure:
/merb-slices
/lib
/spec
...
/merb_generators
/components
/slice_generator
/thin_slice_generator
View spec examples
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"
View gist:3800
class Grandparent
end
class Parent < Grandparent
end
class Child < Parent
end
class Grandparent
View gist:3801
class Grandparent
end
class Parent < Grandparent
end
class Child < Parent
end
class Grandparent
View gist:3805
# ==== 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]
View cgi.rb crap
# 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
View merb-core.rb
# ==== 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])
You can’t perform that action at this time.