font_awesome-sass-rails 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -119,6 +119,12 @@ For hyphenated icon names, surround the icon name with quotes:
119
119
  awesome_icon(:'bookmark-empty').should == "<i class=\"icon-bookmark-empty\"></i>"
120
120
  ```
121
121
 
122
+ Or just use underscores, which will be auto-converted to dashes.
123
+
124
+ ```ruby
125
+ awesome_icon(:bookmark_empty).should == "<i class=\"icon-bookmark-empty\"></i>"
126
+ ```
127
+
122
128
  ## Version
123
129
 
124
130
  Font Awesome 2.0 is currently included. Enjoy :)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "font_awesome-sass-rails"
8
- s.version = "2.2.1"
8
+ s.version = "2.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = "2012-11-26"
12
+ s.date = "2012-12-03"
13
13
  s.description = "Use Font Awesome in your Rails app :)"
14
14
  s.email = "kmandrup@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -7,6 +7,9 @@ module FontAwesomeSass
7
7
  content ||= capture(&block) if block_given?
8
8
  content ||= ''
9
9
 
10
+ name = name.to_s.dasherize
11
+ name.gsub! /^icon-/, ''
12
+
10
13
  clazz = "icon-#{name}"
11
14
  clazz << " icon-#{size}" if size.to_s == 'large'
12
15
  clazz << " " << options.delete(:class) if options[:class]
@@ -19,7 +22,7 @@ module FontAwesomeSass
19
22
  size = options[:size] if options[:size]
20
23
  type = options.delete(:type) if options[:type]
21
24
 
22
- clazz = "btn "
25
+ clazz = "btn"
23
26
  clazz << " btn-#{size}" if size
24
27
  clazz << " btn-#{type}" if type && %w{primary}.include?(type.to_s)
25
28
 
@@ -5,13 +5,25 @@ describe FontAwesomeSass::ViewHelper do
5
5
  FontAwesomeSass::ViewHelper
6
6
 
7
7
  describe 'awesome_icon' do
8
- describe ".awesome_icon :ok, 'Okay :)'" do
8
+ describe ".awesome_icon :ok" do
9
9
  specify do
10
10
  awesome_icon(:ok).should == "<i class=\"icon-ok\"></i>"
11
11
  end
12
12
  end
13
13
 
14
- describe ".awesome_icon :ok, 'Okay :)'" do
14
+ describe ".awesome_icon :oki_doki'" do
15
+ specify do
16
+ awesome_icon(:oki_doki).should == "<i class=\"icon-oki-doki\"></i>"
17
+ end
18
+ end
19
+
20
+ describe ".awesome_icon :icon_oki_doki'" do
21
+ specify do
22
+ awesome_icon(:icon_oki_doki).should == "<i class=\"icon-oki-doki\"></i>"
23
+ end
24
+ end
25
+
26
+ describe ".awesome_icon :ok, size: :large'" do
15
27
  specify do
16
28
  awesome_icon(:ok, size: :large).should == "<i class=\"icon-ok icon-large\"></i>"
17
29
  end
@@ -51,13 +63,22 @@ describe FontAwesomeSass::ViewHelper do
51
63
  end
52
64
 
53
65
  describe 'awesome_btn' do
66
+ specify do
67
+ res = awesome_btn do
68
+ awesome_icon(:ok) + awesome_icon(:plus)
69
+ end
70
+ res.should == "<a class=\"btn\" href=\"#\"><i class=\"icon-ok\"></i><i class=\"icon-plus\"></i></a>"
71
+ end
72
+
54
73
  specify do
55
74
  res = awesome_btn(:ok, size: 'large', type: 'primary', href: 'google.com') do
56
75
  awesome_icon(:ok) + awesome_icon(:plus)
57
76
  end
58
- res.should == "<a class=\"btn btn-large btn-primary\" href=\"google.com\"><i class=\"icon-ok\"></i><i class=\"icon-plus\"></i></a>"
77
+ res.should == "<a class=\"btn btn-large btn-primary\" href=\"google.com\"><i class=\"icon-ok\"></i><i class=\"icon-plus\"></i></a>"
59
78
  end
60
79
  end
80
+
81
+
61
82
 
62
83
  describe 'awesome_button' do
63
84
  describe ".awesome_button(:ok, size: 'large', type: 'primary', href: 'google.com') {'Okay :)'}" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: font_awesome-sass-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-26 00:00:00.000000000 Z
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -189,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: 4348156922474268699
192
+ hash: -3702657322275677174
193
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements: