Skip to content

Commit

Permalink
update font-awesome to 3.2.1, add support for loading icon definition…
Browse files Browse the repository at this point in the history
…s from a specified path
  • Loading branch information
brentkirby committed Jul 3, 2013
1 parent c5c7720 commit e513a73
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 313 deletions.
5 changes: 3 additions & 2 deletions lib/facades.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Facades
extend self
autoload :Helpers, 'facades/helpers'
autoload :Patterns, 'facades/patterns'

def app_path
File.expand_path("../../app", __FILE__)
end
Expand All @@ -25,11 +25,12 @@ def image_path
def icon_path
File.join(File.expand_path("../../src", __FILE__), 'icons')
end

end

require 'facades/config'
require 'facades/sass_extensions'


##
# Use the rails pipeline directly unless functioning
# in a non-rails environment. Otherwise include the
Expand Down
12 changes: 12 additions & 0 deletions lib/facades/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Facades
module Config
extend self

def icon_definitions
{
:font_awesome => File.join(Facades.icon_path, 'font-awesome.yml'),
:facades => File.join(Facades.icon_path, 'facades.yml')
}
end
end
end
3 changes: 2 additions & 1 deletion lib/facades/sass_extensions/icons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def icon_font(name)

def icon_translations(set)
set = set.value if set.respond_to?(:value)
glyphs = Icons.glyph_sets[set] || YAML::load(File.open(File.join(Facades.icon_path, "#{set}.yml")))
#glyphs = Icons.glyph_sets[set] || YAML::load(File.open(File.join(Facades.icon_path, "#{set}.yml")))
glyphs = Icons.glyph_sets[set] || YAML::load(Facades::Config.icon_definitions[set.to_s.underscore.to_sym])
Icons.glyph_sets[set] ||= Hash[glyphs.map{ |k, v| [k.to_s.gsub("_", "-"), v] }]
Icons.glyph_sets[set]
end
Expand Down
1 change: 1 addition & 0 deletions lib/facades/support/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#
module Facades
class Engine < Rails::Engine
config.facades = Facades::Config

paths['app/views'] << Facades.view_path
paths['app/controllers'] << File.join(Facades.app_path, 'controllers')
Expand Down
2 changes: 1 addition & 1 deletion lib/facades/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Facades
VERSION = "1.0.6"
VERSION = "1.0.7"
end
Loading

0 comments on commit e513a73

Please sign in to comment.