fontawesome-rails-cdn 3.2.1 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -44,6 +44,35 @@ The gem will add the `fontawesome_stylesheet_link_tag` helper. Add this to your
|
|
44
44
|
...
|
45
45
|
```
|
46
46
|
|
47
|
+
## Changing Default Behavior
|
48
|
+
|
49
|
+
### Forcing development mode to use the CDN
|
50
|
+
|
51
|
+
You can ensure the development environment follows the same behavior as production by using the `force: true` parameter in the `fontawesome_stylesheet_link_tag`.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
<%= fontawesome_stylesheet_link_tag :netdna, force: true %>
|
55
|
+
```
|
56
|
+
|
57
|
+
### Using a specific Font Awesome Version
|
58
|
+
|
59
|
+
Passing the `version` parameter in the `fontawesome_stylesheet_link_tag` allows you to override the default behavior. If a specific version is not included in the gem, it will be pulled from the CDN even if in development mode.
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
<%= fontawesome_stylesheet_link_tag :netdna, version: "3.2.1" %>
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
## Versioning
|
67
|
+
|
68
|
+
The gem follows the versioning used by Font Awesome. I.e., the 3.2.1 version of the gem defaults to version 3.2.1 of Font Awesome. the 4.0.3 version of the gem points to the 4.0.3 version of Font Awesome.
|
69
|
+
|
70
|
+
All gems can point to a specific version of Font Awesome hosted on the CDN by passing the `version` option into the `fontawesome_stylesheet_link_tag`.
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
<%= fontawesome_stylesheet_link_tag :netdna, version: "3.2.1" %>
|
74
|
+
```
|
75
|
+
|
47
76
|
## License
|
48
77
|
(c) 2014 Christopher Brito
|
49
78
|
|
@@ -2,7 +2,7 @@ module FontAwesome::Rails::CDN
|
|
2
2
|
module ActionViewExtensions
|
3
3
|
OFFLINE = ( ::Rails.env.development? )
|
4
4
|
DEFAULT_HOST = :netdna
|
5
|
-
FONTAWESOME_VERSIONS = [ '3.2.1' ]
|
5
|
+
FONTAWESOME_VERSIONS = [ '4.0.3', '3.2.1' ]
|
6
6
|
|
7
7
|
def fontawesome_stylesheet_url(host = DEFAULT_HOST, options = {})
|
8
8
|
fontawesome_cdn_url(host, options)
|
@@ -10,8 +10,9 @@ module FontAwesome::Rails::CDN
|
|
10
10
|
|
11
11
|
def fontawesome_stylesheet_link_tag(host = DEFAULT_HOST, options = {}, html_options = {})
|
12
12
|
local = fontawesome_stylesheet_url(:local, options)
|
13
|
+
options[:version] = options[:version] || FONTAWESOME_VERSIONS.first
|
13
14
|
|
14
|
-
if OFFLINE and !options[:force]
|
15
|
+
if OFFLINE and !options[:force] and FONTAWESOME_VERSIONS.include?(options[:version])
|
15
16
|
stylesheet_link_tag(local, html_options)
|
16
17
|
else
|
17
18
|
stylesheet_link_tag(fontawesome_stylesheet_url(host, options), html_options)
|