less-rails-fontawesome 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -7
  3. data/{vendor → app}/assets/fonts/FontAwesome.otf +0 -0
  4. data/{vendor → app}/assets/fonts/fontawesome-webfont.eot +0 -0
  5. data/{vendor → app}/assets/fonts/fontawesome-webfont.svg +0 -0
  6. data/{vendor → app}/assets/fonts/fontawesome-webfont.ttf +0 -0
  7. data/{vendor → app}/assets/fonts/fontawesome-webfont.woff +0 -0
  8. data/app/assets/stylesheets/font-awesome/font-awesome-ie7.less +1 -0
  9. data/app/assets/stylesheets/font-awesome/font-awesome.less +1 -0
  10. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/bootstrap.less +0 -0
  11. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/core.less +0 -0
  12. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/extras.less +0 -0
  13. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/font-awesome-ie7.less +0 -0
  14. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/font-awesome.less +0 -0
  15. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/icons.less +0 -0
  16. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/mixins.less +0 -0
  17. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/path.less +0 -0
  18. data/{vendor/frameworks/font-awesome → app/frameworks/fontawesome}/variables.less +0 -0
  19. data/less-rails-fontawesome.gemspec +3 -4
  20. data/lib/less-rails-fontawesome.rb +6 -8
  21. data/lib/less/rails/fontawesome.rb +3 -0
  22. data/lib/less/rails/fontawesome/engine.rb +47 -0
  23. data/lib/less/rails/fontawesome/link_helper.rb +52 -0
  24. data/lib/less/rails/fontawesome/version.rb +7 -0
  25. metadata +30 -43
  26. data/lib/less-rails-fontawesome/engine.rb +0 -21
  27. data/lib/less-rails-fontawesome/link_helper.rb +0 -54
  28. data/lib/less-rails-fontawesome/version.rb +0 -9
  29. data/vendor/assets/stylesheets/font-awesome-ie7.css.less +0 -1
  30. data/vendor/assets/stylesheets/font-awesome.css.less +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7080f306a780fbe774007622621ad35dded93247
4
- data.tar.gz: b8d9956524451e87a3b73f4ad0acb55350996e41
3
+ metadata.gz: 5b2c90882ce64d24c522e49693c38db5bb1e1a58
4
+ data.tar.gz: ff0317ddb98d89f1269619f7307e9421c0b65d4b
5
5
  SHA512:
6
- metadata.gz: 116c1c19d45364e8c790c557f472bde91d960ec07c685df8a2ebd308324341366456e6f5cb1ba6b822e7465b879594fb88b18db7e62532b2fb4cbc214a7e5c9c
7
- data.tar.gz: 23a48cc6e638a4cb0a7c9ade47a12dc5f4a91a515cb5a0b496c8da4d69d0ceb1fe0b3a4c5e35f8a7ff1a49a2f1961bffe08e970e4f6245d2dbd8912c08348239
6
+ metadata.gz: 63e7d95e4cf6066ec7d7c752941ea120893d8c837dfc5446c0b23869bbbea3149d0ff6542189d6208c32b6bd6f380ba977a1db76f007e17a4ee8f8ccd4f24677
7
+ data.tar.gz: f28802d7b55306c8eb074d7a0ae9c07e06b1aa88290f03e831e1794173a4e40cf293219a2fdd65331d3b852588d2281fe629bd68edf826107c012b6fb084140f
data/README.md CHANGED
@@ -2,10 +2,13 @@
2
2
 
3
3
  With LESS and fonts from [Font Awesome](http://fortawesome.github.io/Font-Awesome/),
4
4
  *less-rails-fontawesome* is a gem to integrate Font Awesome
5
- to your Rails application. It works wit Rails 3.2 and 4.
5
+ to your Rails application. It works with Rails 4.
6
6
 
7
7
  ### Updates
8
8
 
9
+ November 21, 2013: moved from *vendor/* to *app/* folder; now,
10
+ the files should be precompiled
11
+
9
12
  May 16, 2013: Now using Font Awesome 3.1.1 and works with Rails 4!
10
13
 
11
14
  March 23, 2013: Now using Font Awesome 3.0.2!
@@ -20,25 +23,30 @@ Add the gem to your *assets* group in the *Gemfile*:
20
23
 
21
24
  ```ruby
22
25
  gem 'therubyracer'
23
- gem 'less'
24
26
  gem 'less-rails'
25
27
  gem 'less-rails-fontawesome'
26
28
  ```
27
29
 
28
- Then in your *app/assets/stylesheets/application.css.less*:
30
+ Get the full Fontawesome stylesheet with a single line in your *application.css*:
31
+
32
+ ```css
33
+ *= require font-awesome/font-awesome
34
+ ```
35
+
36
+ Alternatively, remove *app/assets/stylesheets/application.css*
37
+ and create *app/assets/stylesheets/application.less* with the content
29
38
 
30
39
  ```css
31
40
  @import 'font-awesome/font-awesome';
32
- @import 'font-awesome/font-awesome-ie7';
33
41
  ```
34
42
 
35
- You can also use it with the [less-rails-bootstrap](https://github.com/metaskills/less-rails-bootstrap) gem.
43
+ You can also use it with
44
+ the [less-rails-bootstrap](https://github.com/metaskills/less-rails-bootstrap) gem.
36
45
  Just import *fontawesome* right after *twitter/bootstrap*:
37
46
 
38
47
  ```css
39
48
  @import 'twitter/bootstrap';
40
49
  @import 'font-awesome/font-awesome';
41
- @import 'font-awesome/font-awesome-ie7';
42
50
  ```
43
51
 
44
52
  <!-- [Simple demo](http://sharp-ocean-6085.herokuapp.com/). -->
@@ -65,7 +73,8 @@ For example, to place the *icon-upload-alt* icon next to *Edit* write something
65
73
  or to place *icon-trash* next to text *Destroy* button write:
66
74
 
67
75
  ```rhtml
68
- <%= ilink_to "trash", "Destroy", post, confirm: 'Are you sure?', method: :delete, class: 'btn btn-mini btn-danger'%>
76
+ <%= ilink_to "trash", "Destroy", post, confirm: 'Are you sure?',
77
+ method: :delete, class: 'btn btn-mini btn-danger'%>
69
78
  ```
70
79
 
71
80
  (precede the link text with the icon name stripped off *icon-* prefix)
@@ -0,0 +1 @@
1
+ @import "fontawesome/font-awesome-ie7";
@@ -0,0 +1 @@
1
+ @import "fontawesome/font-awesome";
@@ -1,10 +1,10 @@
1
1
  $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
- require "less-rails-fontawesome/version"
3
+ require "less/rails/fontawesome/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "less-rails-fontawesome"
7
- s.version = Font::Awesome::Less::Rails::VERSION
7
+ s.version = Less::Rails::Fontawesome::VERSION
8
8
  s.authors = ["Wlodek Bzyl"]
9
9
  s.email = ["matwb@ug.edu.pl"]
10
10
  s.homepage = "https://github.com/wbzyl/less-rails-fontawesome"
@@ -18,6 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_runtime_dependency 'railties', '>= 3.1.1'
22
- s.add_runtime_dependency 'less-rails', '>= 2.1.7'
21
+ s.add_runtime_dependency 'less-rails', '~> 2.4.2'
23
22
  end
@@ -1,11 +1,9 @@
1
- module Font
2
- module Awesome
3
- module Less
4
- module Rails
5
- require "less-rails-fontawesome/link_helper"
6
- require "less-rails-fontawesome/engine"
7
- require "less-rails-fontawesome/version"
8
- end
1
+ module Less
2
+ module Rails
3
+ module Fontawesome
9
4
  end
10
5
  end
11
6
  end
7
+
8
+ require 'less-rails'
9
+ require 'less/rails/fontawesome'
@@ -0,0 +1,3 @@
1
+ require 'less/rails/fontawesome/version'
2
+ require 'less/rails/fontawesome/engine'
3
+ require 'less/rails/fontawesome/link_helper'
@@ -0,0 +1,47 @@
1
+ require 'rails'
2
+
3
+ module Less
4
+ module Rails
5
+ module Fontawesome
6
+ class Engine < ::Rails::Engine
7
+
8
+ # initializer 'less-rails-bootstrap.setup', :after => 'less-rails.before.load_config_initializers', :group => :all do |app|
9
+ # app.config.less.paths << File.join(config.root, 'app', 'frameworks')
10
+ # end
11
+
12
+ initializer 'less-rails-fontawesome.setup', :after => 'less-rails.before.load_config_initializers', :group => :all do |app|
13
+ app.config.less.paths << File.join(config.root, 'app', 'frameworks')
14
+ end
15
+
16
+ initializer 'less-rails-fontawesome.action_controller' do |app|
17
+ ActiveSupport.on_load :action_controller do
18
+ helper Less::Rails::Fontawesome::LinkHelper
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ # module Font
28
+ # module Awesome
29
+ # module Less
30
+ # module Rails
31
+ # class Engine < ::Rails::Engine
32
+
33
+ # initializer 'font.awesome.less.rails.setup', :after => 'less-rails.after.load_config_initializers', :group => :all do |app|
34
+ # app.config.less.paths << File.join(config.root, 'vendor', 'frameworks')
35
+ # end
36
+
37
+ # initializer 'font.awesome.less.rails.action_controller' do |app|
38
+ # ActiveSupport.on_load :action_controller do
39
+ # helper Font::Awesome::Less::Rails::LinkHelper
40
+ # end
41
+ # end
42
+
43
+ # end
44
+ # end
45
+ # end
46
+ # end
47
+ # end
@@ -0,0 +1,52 @@
1
+ module Less
2
+ module Rails
3
+ module Fontawesome
4
+ module LinkHelper
5
+ def ilink_to(*args, &block)
6
+ if block_given?
7
+ icon = args[0]
8
+ options = args[1] || {}
9
+ html_options = args[2]
10
+ ilink_to(icon, capture(&block), options, html_options)
11
+ else
12
+ icon = args[0]
13
+ name = args[1]
14
+ options = args[2] || {}
15
+ html_options = args[3]
16
+
17
+ html_options = convert_options_to_data_attributes(options, html_options)
18
+ url = url_for(options)
19
+
20
+ href = html_options['href']
21
+ tag_options = tag_options(html_options)
22
+
23
+ href_attr = "href=\"#{ERB::Util.html_escape(url)}\"" unless href
24
+ "<a #{href_attr}#{tag_options}><i class=\"icon-#{icon}\"></i> #{ERB::Util.html_escape(name || url)}</a>".html_safe
25
+ end
26
+ end
27
+
28
+ # TODO:
29
+
30
+ # def ilink_to_unless
31
+ # if condition
32
+ # if block_given?
33
+ # block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
34
+ # else
35
+ # name
36
+ # end
37
+ # else
38
+ # ilink_to(name, options, html_options)
39
+ # end
40
+ # end
41
+
42
+ # def ilink_to_if(condition, name, options = {}, html_options = {}, &block)
43
+ # ilink_to_unless !condition, name, options, html_options, &block
44
+ # end
45
+
46
+ # def ilink_to_unless_current(name, options = {}, html_options = {}, &block)
47
+ # ilink_to_unless current_page?(options), name, options, html_options, &block
48
+ # end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,7 @@
1
+ module Less
2
+ module Rails
3
+ module Fontawesome
4
+ VERSION = "0.6.0"
5
+ end
6
+ end
7
+ end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less-rails-fontawesome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wlodek Bzyl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-14 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: railties
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 3.1.1
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 3.1.1
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: less-rails
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - '>='
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 2.1.7
19
+ version: 2.4.2
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - '>='
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 2.1.7
26
+ version: 2.4.2
41
27
  description: Font Awesome, LESS version, with assets pipeline for Rails Asset Pipeline
42
28
  email:
43
29
  - matwb@ug.edu.pl
@@ -45,31 +31,32 @@ executables: []
45
31
  extensions: []
46
32
  extra_rdoc_files: []
47
33
  files:
48
- - .gitignore
34
+ - ".gitignore"
49
35
  - Gemfile
50
36
  - README.md
51
37
  - Rakefile
38
+ - app/assets/fonts/FontAwesome.otf
39
+ - app/assets/fonts/fontawesome-webfont.eot
40
+ - app/assets/fonts/fontawesome-webfont.svg
41
+ - app/assets/fonts/fontawesome-webfont.ttf
42
+ - app/assets/fonts/fontawesome-webfont.woff
43
+ - app/assets/stylesheets/font-awesome/font-awesome-ie7.less
44
+ - app/assets/stylesheets/font-awesome/font-awesome.less
45
+ - app/frameworks/fontawesome/bootstrap.less
46
+ - app/frameworks/fontawesome/core.less
47
+ - app/frameworks/fontawesome/extras.less
48
+ - app/frameworks/fontawesome/font-awesome-ie7.less
49
+ - app/frameworks/fontawesome/font-awesome.less
50
+ - app/frameworks/fontawesome/icons.less
51
+ - app/frameworks/fontawesome/mixins.less
52
+ - app/frameworks/fontawesome/path.less
53
+ - app/frameworks/fontawesome/variables.less
52
54
  - less-rails-fontawesome.gemspec
53
55
  - lib/less-rails-fontawesome.rb
54
- - lib/less-rails-fontawesome/engine.rb
55
- - lib/less-rails-fontawesome/link_helper.rb
56
- - lib/less-rails-fontawesome/version.rb
57
- - vendor/assets/fonts/FontAwesome.otf
58
- - vendor/assets/fonts/fontawesome-webfont.eot
59
- - vendor/assets/fonts/fontawesome-webfont.svg
60
- - vendor/assets/fonts/fontawesome-webfont.ttf
61
- - vendor/assets/fonts/fontawesome-webfont.woff
62
- - vendor/assets/stylesheets/font-awesome-ie7.css.less
63
- - vendor/assets/stylesheets/font-awesome.css.less
64
- - vendor/frameworks/font-awesome/bootstrap.less
65
- - vendor/frameworks/font-awesome/core.less
66
- - vendor/frameworks/font-awesome/extras.less
67
- - vendor/frameworks/font-awesome/font-awesome-ie7.less
68
- - vendor/frameworks/font-awesome/font-awesome.less
69
- - vendor/frameworks/font-awesome/icons.less
70
- - vendor/frameworks/font-awesome/mixins.less
71
- - vendor/frameworks/font-awesome/path.less
72
- - vendor/frameworks/font-awesome/variables.less
56
+ - lib/less/rails/fontawesome.rb
57
+ - lib/less/rails/fontawesome/engine.rb
58
+ - lib/less/rails/fontawesome/link_helper.rb
59
+ - lib/less/rails/fontawesome/version.rb
73
60
  homepage: https://github.com/wbzyl/less-rails-fontawesome
74
61
  licenses: []
75
62
  metadata: {}
@@ -79,17 +66,17 @@ require_paths:
79
66
  - lib
80
67
  required_ruby_version: !ruby/object:Gem::Requirement
81
68
  requirements:
82
- - - '>='
69
+ - - ">="
83
70
  - !ruby/object:Gem::Version
84
71
  version: '0'
85
72
  required_rubygems_version: !ruby/object:Gem::Requirement
86
73
  requirements:
87
- - - '>='
74
+ - - ">="
88
75
  - !ruby/object:Gem::Version
89
76
  version: '0'
90
77
  requirements: []
91
78
  rubyforge_project: less-rails-fontawesome
92
- rubygems_version: 2.0.3
79
+ rubygems_version: 2.0.7
93
80
  signing_key:
94
81
  specification_version: 4
95
82
  summary: Font Awesome in LESS for Rails Asset Pipeline
@@ -1,21 +0,0 @@
1
- module Font
2
- module Awesome
3
- module Less
4
- module Rails
5
- class Engine < ::Rails::Engine
6
-
7
- initializer 'font.awesome.less.rails.setup', :after => 'less-rails.after.load_config_initializers', :group => :all do |app|
8
- app.config.less.paths << File.join(config.root, 'vendor', 'frameworks')
9
- end
10
-
11
- initializer 'font.awesome.less.rails.action_controller' do |app|
12
- ActiveSupport.on_load :action_controller do
13
- helper Font::Awesome::Less::Rails::LinkHelper
14
- end
15
- end
16
-
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,54 +0,0 @@
1
- module Font
2
- module Awesome
3
- module Less
4
- module Rails
5
- module LinkHelper
6
- def ilink_to(*args, &block)
7
- if block_given?
8
- icon = args[0]
9
- options = args[1] || {}
10
- html_options = args[2]
11
- ilink_to(icon, capture(&block), options, html_options)
12
- else
13
- icon = args[0]
14
- name = args[1]
15
- options = args[2] || {}
16
- html_options = args[3]
17
-
18
- html_options = convert_options_to_data_attributes(options, html_options)
19
- url = url_for(options)
20
-
21
- href = html_options['href']
22
- tag_options = tag_options(html_options)
23
-
24
- href_attr = "href=\"#{ERB::Util.html_escape(url)}\"" unless href
25
- "<a #{href_attr}#{tag_options}><i class=\"icon-#{icon}\"></i> #{ERB::Util.html_escape(name || url)}</a>".html_safe
26
- end
27
- end
28
-
29
- # TODO:
30
-
31
- # def ilink_to_unless
32
- # if condition
33
- # if block_given?
34
- # block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
35
- # else
36
- # name
37
- # end
38
- # else
39
- # ilink_to(name, options, html_options)
40
- # end
41
- # end
42
-
43
- # def ilink_to_if(condition, name, options = {}, html_options = {}, &block)
44
- # ilink_to_unless !condition, name, options, html_options, &block
45
- # end
46
-
47
- # def ilink_to_unless_current(name, options = {}, html_options = {}, &block)
48
- # ilink_to_unless current_page?(options), name, options, html_options, &block
49
- # end
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,9 +0,0 @@
1
- module Font
2
- module Awesome
3
- module Less
4
- module Rails
5
- VERSION = "0.5.1"
6
- end
7
- end
8
- end
9
- end
@@ -1 +0,0 @@
1
- @import "font-awesome/font-awesome-ie7";
@@ -1 +0,0 @@
1
- @import "font-awesome/font-awesome";