Class: FlexScaffold::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/config.rb

Class Method Summary collapse

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_themesObject



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_sizeObject



10
11
12
# File 'lib/config.rb', line 10

def default_size
  '900x500'
end

.javascriptsObject



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_directoryObject



18
19
20
# File 'lib/config.rb', line 18

def plugin_directory
  File.expand_path(__FILE__).match(/vendor\/plugins\/(\w*)/)[1]
end

.plugin_nameObject



6
7
8
# File 'lib/config.rb', line 6

def plugin_name
  "flex_scaffold"
end

.public_foldersObject



14
15
16
# File 'lib/config.rb', line 14

def public_folders
  %w[/ javascripts stylesheets images]
end

.template_search_pathObject



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

.themeObject



22
23
24
# File 'lib/config.rb', line 22

def theme
  'default'
end