Module: ThemesForRails
- Defined in:
- lib/themes_for_rails.rb,
lib/themes_for_rails/config.rb,
lib/themes_for_rails/routes.rb,
lib/themes_for_rails/railtie.rb,
lib/themes_for_rails/version.rb,
lib/themes_for_rails/action_view.rb,
lib/themes_for_rails/url_helpers.rb,
lib/themes_for_rails/action_mailer.rb,
lib/themes_for_rails/interpolation.rb,
lib/themes_for_rails/common_methods.rb,
lib/themes_for_rails/action_controller.rb,
lib/themes_for_rails/assets_controller.rb,
lib/generators/themes_for_rails/theme_generator.rb,
lib/generators/themes_for_rails/install_generator.rb
Defined Under Namespace
Modules: ActionController, ActionMailer, ActionView, CommonMethods, Generators, Interpolation, Routes, UrlHelpers
Classes: AssetsController, Config, Railtie
Constant Summary
collapse
- VERSION =
"0.5.1"
Class Method Summary
collapse
Class Method Details
.add_themes_path_to_sass ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/themes_for_rails.rb', line 21
def add_themes_path_to_sass
if ThemesForRails.config.sass_is_available?
each_theme_dir do |dir|
if File.directory?(dir)
sass_dir = "#{dir}/stylesheets/sass"
css_dir = "#{dir}/stylesheets"
unless already_configured_in_sass?(sass_dir)
Sass::Plugin.add_template_location sass_dir, css_dir
end
end
end
else
raise "Sass is not available. What are you trying to do?"
end
end
|
39
40
41
|
# File 'lib/themes_for_rails.rb', line 39
def already_configured_in_sass?(sass_dir)
Sass::Plugin.template_location_array.map(&:first).include?(sass_dir)
end
|
.available_theme_names ⇒ Object
17
18
19
|
# File 'lib/themes_for_rails.rb', line 17
def available_theme_names
available_themes.map {|theme| File.basename(theme) }
end
|
.available_themes(&block) ⇒ Object
Also known as:
each_theme_dir
12
13
14
|
# File 'lib/themes_for_rails.rb', line 12
def available_themes(&block)
Dir.glob(File.join(config.themes_path, "*"), &block)
end
|
.config {|@config| ... } ⇒ Object
6
7
8
9
10
|
# File 'lib/themes_for_rails.rb', line 6
def config
@config ||= ThemesForRails::Config.new
yield(@config) if block_given?
@config
end
|