Class: Frank::Settings
- Inherits:
-
Object
- Object
- Frank::Settings
- Includes:
- Singleton
- Defined in:
- lib/frank/settings.rb
Instance Attribute Summary collapse
-
#dynamic_folder ⇒ Object
Returns the value of attribute dynamic_folder.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#export ⇒ Object
Returns the value of attribute export.
-
#layouts_folder ⇒ Object
Returns the value of attribute layouts_folder.
-
#options ⇒ Object
Returns the value of attribute options.
-
#publish ⇒ Object
Returns the value of attribute publish.
-
#root ⇒ Object
Returns the value of attribute root.
-
#sass_options ⇒ Object
Returns the value of attribute sass_options.
-
#server ⇒ Object
Returns the value of attribute server.
-
#static_folder ⇒ Object
Returns the value of attribute static_folder.
Instance Method Summary collapse
-
#exporting! ⇒ Object
Mark this Frank run as compiling.
-
#exporting? ⇒ Boolean
Check to see if we’re compiling.
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
-
#production! ⇒ Object
Mark this Frank run as production.
-
#production? ⇒ Boolean
Check to see if we’re in production mode.
-
#proj_name ⇒ Object
return the proj folder name.
-
#publishing! ⇒ Object
Mark this Frank run as publishing.
-
#reset ⇒ Object
Reset settings to the defaults.
-
#serving_static! ⇒ Object
Mark this Frank run as serving static.
-
#serving_static? ⇒ Boolean
Are we serving up a raw static folder?.
-
#silent_export? ⇒ Boolean
Silent export if set or in test.
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
19 20 21 |
# File 'lib/frank/settings.rb', line 19 def initialize reset end |
Instance Attribute Details
#dynamic_folder ⇒ Object
Returns the value of attribute dynamic_folder.
13 14 15 |
# File 'lib/frank/settings.rb', line 13 def dynamic_folder @dynamic_folder end |
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/frank/settings.rb', line 7 def environment @environment end |
#export ⇒ Object
Returns the value of attribute export.
15 16 17 |
# File 'lib/frank/settings.rb', line 15 def export @export end |
#layouts_folder ⇒ Object
Returns the value of attribute layouts_folder.
14 15 16 |
# File 'lib/frank/settings.rb', line 14 def layouts_folder @layouts_folder end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/frank/settings.rb', line 11 def @options end |
#publish ⇒ Object
Returns the value of attribute publish.
16 17 18 |
# File 'lib/frank/settings.rb', line 16 def publish @publish end |
#root ⇒ Object
Returns the value of attribute root.
8 9 10 |
# File 'lib/frank/settings.rb', line 8 def root @root end |
#sass_options ⇒ Object
Returns the value of attribute sass_options.
17 18 19 |
# File 'lib/frank/settings.rb', line 17 def @sass_options end |
#server ⇒ Object
Returns the value of attribute server.
10 11 12 |
# File 'lib/frank/settings.rb', line 10 def server @server end |
#static_folder ⇒ Object
Returns the value of attribute static_folder.
12 13 14 |
# File 'lib/frank/settings.rb', line 12 def static_folder @static_folder end |
Instance Method Details
#exporting! ⇒ Object
Mark this Frank run as compiling
76 77 78 |
# File 'lib/frank/settings.rb', line 76 def exporting! @exporting = true end |
#exporting? ⇒ Boolean
Check to see if we’re compiling
71 72 73 |
# File 'lib/frank/settings.rb', line 71 def exporting? @exporting end |
#production! ⇒ Object
Mark this Frank run as production
91 92 93 |
# File 'lib/frank/settings.rb', line 91 def production! @production = true end |
#production? ⇒ Boolean
Check to see if we’re in production mode
86 87 88 |
# File 'lib/frank/settings.rb', line 86 def production? @production end |
#proj_name ⇒ Object
return the proj folder name
56 57 58 |
# File 'lib/frank/settings.rb', line 56 def proj_name @root.split('/').last end |
#publishing! ⇒ Object
Mark this Frank run as publishing
96 97 98 99 |
# File 'lib/frank/settings.rb', line 96 def publishing! @exporting = true @production = true end |
#reset ⇒ Object
Reset settings to the defaults
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/frank/settings.rb', line 24 def reset # reset server settings @server = OpenStruct.new @server.handler = "mongrel" @server.hostname = "0.0.0.0" @server.port = "3601" # reset options @options = OpenStruct.new # export settings @export = OpenStruct.new @export.path = nil @export.silent = false # publish options @publish = OpenStruct.new @publish.host = nil @publish.path = nil @publish.username = nil @publish.password = nil # setup folders @static_folder = "static" @dynamic_folder = "dynamic" @layouts_folder = "layouts" # setup 3rd party configurations @sass_options = {} end |
#serving_static! ⇒ Object
Mark this Frank run as serving static
66 67 68 |
# File 'lib/frank/settings.rb', line 66 def serving_static! @serving_static = true end |
#serving_static? ⇒ Boolean
Are we serving up a raw static folder?
61 62 63 |
# File 'lib/frank/settings.rb', line 61 def serving_static? @serving_static end |
#silent_export? ⇒ Boolean
Silent export if set or in test
81 82 83 |
# File 'lib/frank/settings.rb', line 81 def silent_export? @environment == :test || @export.silent end |