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.
-
#haml_options ⇒ Object
Returns the value of attribute haml_options.
-
#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.
-
#force_export! ⇒ Object
Force overwrite export folder if it exists.
-
#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.
20 21 22 |
# File 'lib/frank/settings.rb', line 20 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 |
#haml_options ⇒ Object
Returns the value of attribute haml_options.
18 19 20 |
# File 'lib/frank/settings.rb', line 18 def @haml_options 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
80 81 82 |
# File 'lib/frank/settings.rb', line 80 def exporting! @exporting = true end |
#exporting? ⇒ Boolean
Check to see if we’re compiling
75 76 77 |
# File 'lib/frank/settings.rb', line 75 def exporting? @exporting end |
#force_export! ⇒ Object
Force overwrite export folder if it exists
100 101 102 |
# File 'lib/frank/settings.rb', line 100 def force_export! @export.force = true end |
#production! ⇒ Object
Mark this Frank run as production
95 96 97 |
# File 'lib/frank/settings.rb', line 95 def production! @production = true end |
#production? ⇒ Boolean
Check to see if we’re in production mode
90 91 92 |
# File 'lib/frank/settings.rb', line 90 def production? @production end |
#proj_name ⇒ Object
return the proj folder name
60 61 62 |
# File 'lib/frank/settings.rb', line 60 def proj_name @root.split('/').last end |
#publishing! ⇒ Object
Mark this Frank run as publishing
105 106 107 108 |
# File 'lib/frank/settings.rb', line 105 def publishing! @exporting = true @production = true end |
#reset ⇒ Object
Reset settings to the defaults
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 54 55 56 57 |
# File 'lib/frank/settings.rb', line 25 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 = "exported" @export.silent = false @export.force = false # publish options @publish = OpenStruct.new @publish.host = nil @publish.path = nil @publish.username = nil @publish.password = nil @publish.mode = nil # setup folders @static_folder = "static" @dynamic_folder = "dynamic" @layouts_folder = "layouts" # setup 3rd party configurations @sass_options = {} @haml_options = {} end |
#serving_static! ⇒ Object
Mark this Frank run as serving static
70 71 72 |
# File 'lib/frank/settings.rb', line 70 def serving_static! @serving_static = true end |
#serving_static? ⇒ Boolean
Are we serving up a raw static folder?
65 66 67 |
# File 'lib/frank/settings.rb', line 65 def serving_static? @serving_static end |
#silent_export? ⇒ Boolean
Silent export if set or in test
85 86 87 |
# File 'lib/frank/settings.rb', line 85 def silent_export? @environment == :test || @export.silent end |