Class: FlexScaffold::Config
- Inherits:
-
Object
- Object
- FlexScaffold::Config
- Defined in:
- lib/config.rb
Class Method Summary collapse
- .asset_path(type, filename) ⇒ Object
- .available_themes ⇒ Object
- .default_size ⇒ Object
- .javascripts ⇒ Object
- .plugin_directory ⇒ Object
- .plugin_name ⇒ Object
- .public_folders ⇒ Object
- .template_search_path ⇒ Object
- .theme ⇒ Object
Class Method Details
.asset_path(type, filename) ⇒ Object
26 27 28 |
# File 'lib/config.rb', line 26 def asset_path(type, filename) File.join(FlexScaffold::Config.plugin_name, FlexScaffold::Config.theme.to_s, filename) end |
.available_themes ⇒ Object
43 44 45 46 |
# File 'lib/config.rb', line 43 def available_themes themes_dir = File.join(RAILS_ROOT, "vendor", "plugins", FlexScaffold::Config.plugin_directory, "themes") Dir.entries(themes_dir).reject { |e| e.match(/^\./) } # Get rid of files that start with . end |
.default_size ⇒ Object
10 11 12 |
# File 'lib/config.rb', line 10 def default_size '900x500' end |
.javascripts ⇒ Object
30 31 32 33 |
# File 'lib/config.rb', line 30 def javascripts javascript_dir = File.join(RAILS_ROOT, "vendor", "plugins", FlexScaffold::Config.plugin_directory, "public", "javascripts") Dir.entries(javascript_dir).reject { |e| !e.match(/\.js/) } end |
.plugin_directory ⇒ Object
18 19 20 |
# File 'lib/config.rb', line 18 def plugin_directory File.(__FILE__).match(/vendor\/plugins\/(\w*)/)[1] end |
.plugin_name ⇒ Object
6 7 8 |
# File 'lib/config.rb', line 6 def plugin_name "flex_scaffold" end |
.public_folders ⇒ Object
14 15 16 |
# File 'lib/config.rb', line 14 def public_folders %w[/ javascripts stylesheets images] end |
.template_search_path ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/config.rb', line 35 def template_search_path search_path = [] search_path << FlexScaffold::Config.plugin_name search_path << "../../vendor/plugins/#{FlexScaffold::Config.plugin_directory}/themes/#{FlexScaffold::Config.theme.to_s}/views" if FlexScaffold::Config.theme.to_sym != :default search_path << "../../vendor/plugins/#{FlexScaffold::Config.plugin_directory}/themes/default/views" return search_path end |
.theme ⇒ Object
22 23 24 |
# File 'lib/config.rb', line 22 def theme 'default' end |