hassox (owner)

Revisions

gist: 229788 Download_button fork
public
Public Clone URL: git://gist.github.com/229788.git
Embed All Files: show embed
my_stack_configuration_example.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
##### Configuration Example
MyStack.configuration do
  default :page_title, "Awesome!"
  default :home_url, :home
  default :use_live_resource lambda{ _use_live_resource? }
  
  def _use_live_resource?
    Pancake.env != "development"
  end
end
 
MyStack.configuration.page_title #=> "Awesome!"
MyStack.configuration.page_title = "Cool!"
MyStack.configuration.page_title #=> "Cool!"
 
MyStack.configuration.some_unkown_value #=> nil
MyStack.configuraiton.some_unknown_value = "foo"
MyStack.configuration.some_unknown_value #=> "foo"
 
class ChildStack < MyStack; end
 
ChildStack.configuration.page_title #=> "Awesome!"