weather-icons-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/weather-icons/_bootstrap.css.scss +87 -0
  3. data/app/assets/stylesheets/weather-icons/_bordered-pulled.css.scss +16 -0
  4. data/app/assets/stylesheets/weather-icons/_core.css.scss +13 -0
  5. data/app/assets/stylesheets/weather-icons/_extras.css.scss +44 -0
  6. data/app/assets/stylesheets/weather-icons/_fixed-width.css.scss +6 -0
  7. data/app/assets/stylesheets/weather-icons/_icons.css.scss +95 -0
  8. data/app/assets/stylesheets/weather-icons/_larger.css.scss +43 -0
  9. data/app/assets/stylesheets/weather-icons/_list.css.scss +19 -0
  10. data/app/assets/stylesheets/weather-icons/_mixins.css.scss +20 -0
  11. data/app/assets/stylesheets/weather-icons/_path.css.scss +13 -0
  12. data/app/assets/stylesheets/weather-icons/_rotated-flipped.css.scss +9 -0
  13. data/app/assets/stylesheets/weather-icons/_spinning.css.scss +27 -0
  14. data/app/assets/stylesheets/weather-icons/_stacked.css.scss +20 -0
  15. data/app/assets/stylesheets/weather-icons/_variables.css.scss +102 -0
  16. data/app/assets/stylesheets/weather-icons.css.scss +45 -0
  17. data/lib/weather-icons/rails/rails/engine.rb +13 -0
  18. data/lib/weather-icons/rails/rails/helpers.rb +94 -0
  19. data/lib/weather-icons/rails/rails/railtie.rb +13 -0
  20. data/lib/weather-icons/rails/version.rb +5 -0
  21. data/lib/weather-icons/rails.rb +58 -0
  22. data/lib/weather-icons-rails.rb +3 -4
  23. data/test/dummy/app/assets/stylesheets/sass-import.css.sass +1 -1
  24. data/test/dummy/app/assets/stylesheets/scss-import.css.scss +1 -1
  25. data/test/dummy/app/assets/stylesheets/sprockets-require.css +2 -2
  26. data/test/dummy/app/controllers/pages_controller.rb +2 -2
  27. data/test/dummy/app/views/pages/icons.html.erb +2 -2
  28. data/test/dummy/config/application.rb +18 -18
  29. data/test/dummy/config/boot.rb +10 -10
  30. data/test/dummy/config/environment.rb +5 -5
  31. data/test/dummy/config/initializers/secret_token.rb +8 -8
  32. data/test/dummy/config/routes.rb +3 -3
  33. data/test/dummy/config.ru +4 -4
  34. data/test/font_awesome_rails_test.rb +65 -65
  35. data/test/icon_helper_test.rb +113 -113
  36. data/test/test_helper.rb +7 -7
  37. metadata +80 -9
  38. data/app/assets/stylesheets/weather-icons.css +0 -327
  39. data/app/helpers/font_awesome/rails/icon_helper.rb +0 -92
  40. data/app/helpers/weather_icons/rails/icon_helper.rb +0 -92
  41. data/lib/weather-icons-rails/engine.rb +0 -4
  42. data/lib/weather-icons-rails/version.rb +0 -3
@@ -1,113 +1,113 @@
1
- require 'test_helper'
2
-
3
- class FontAwesome::Rails::IconHelperTest < ActionView::TestCase
4
-
5
- test "#fa_icon with no args should render a flag icon" do
6
- assert_icon i("fa fa-flag")
7
- end
8
-
9
- test "#fa_icon should render different individual icons" do
10
- assert_icon i("fa fa-flag"), "flag"
11
- assert_icon i("fa fa-camera-retro"), "camera-retro"
12
- assert_icon i("fa fa-cog"), "cog"
13
- assert_icon i("fa fa-github"), "github"
14
- end
15
-
16
- test "#fa_icon should render icons with multiple modifiers" do
17
- assert_icon i("fa fa-pencil fa-fixed-width"), "pencil fixed-width"
18
- assert_icon i("fa fa-flag fa-4x"), "flag 4x"
19
- assert_icon i("fa fa-refresh fa-2x fa-spin"), "refresh 2x spin"
20
- end
21
-
22
- test "#fa_icon should render icons with array modifiers" do
23
- assert_icon i("fa fa-flag"), ["flag"]
24
- assert_icon i("fa fa-check fa-li"), ["check", "li"]
25
- assert_icon i("fa fa-flag fa-4x"), ["flag", "4x"]
26
- assert_icon i("fa fa-refresh fa-2x fa-spin"), ["refresh", "2x", "spin"]
27
- end
28
-
29
- test "#fa_icon should incorporate additional class styles" do
30
- assert_icon i("fa fa-flag pull-right"), "flag", :class => "pull-right"
31
- assert_icon i("fa fa-flag fa-2x pull-right"), ["flag", "2x"], :class => ["pull-right"]
32
- assert_icon i("fa fa-check fa-li pull-right special"), "check li", :class => "pull-right special"
33
- assert_icon i("fa fa-check pull-right special"), "check", :class => ["pull-right", "special"]
34
- end
35
-
36
- test "#fa_icon should incorporate a text suffix" do
37
- assert_icon "#{i("fa fa-camera-retro")} Take a photo", "camera-retro", :text => "Take a photo"
38
- end
39
-
40
- test "#fa_icon should html escape text" do
41
- assert_icon "#{i("fa fa-camera-retro")} &lt;script&gt;&lt;/script&gt;", "camera-retro", :text => "<script></script>"
42
- end
43
-
44
- test "#fa_icon should not html escape safe text" do
45
- assert_icon "#{i("fa fa-camera-retro")} <script></script>", "camera-retro", :text => "<script></script>".html_safe
46
- end
47
-
48
- test "#fa_icon should pull it all together" do
49
- assert_icon "#{i("fa fa-camera-retro pull-right")} Take a photo", "camera-retro", :text => "Take a photo", :class => "pull-right"
50
- end
51
-
52
- test "#fa_icon should pass all other options through" do
53
- assert_icon %(<i class="fa fa-user" data-id="123"></i>), "user", :data => { :id => 123 }
54
- end
55
-
56
- test "#fa_stacked_icon with no args should render a flag icon" do
57
- expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-flag fa-stack-1x")}</span>)
58
- assert_stacked_icon expected
59
- end
60
-
61
- test "#fa_stacked_icon should render a stacked icon" do
62
- expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span>)
63
- assert_stacked_icon expected, "twitter", :base => "square-o"
64
- expected = %(<span class="fa-stack">#{i("fa fa-square fa-stack-2x")}#{i("fa fa-terminal fa-inverse fa-stack-1x")}</span>)
65
- assert_stacked_icon expected, ["terminal", "inverse"], :base => ["square"]
66
- end
67
-
68
- test "#fa_stacked_icon should incorporate additional class styles" do
69
- expected = %(<span class="fa-stack pull-right">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span>)
70
- assert_stacked_icon expected, "twitter", :base => "square-o", :class => "pull-right"
71
- end
72
-
73
- test "#fa_stacked_icon should reverse the stack" do
74
- expected = %(<span class="fa-stack">#{i("fa fa-facebook fa-stack-1x")}#{i("fa fa-ban fa-stack-2x")}</span>)
75
- assert_stacked_icon expected, "facebook", :base => "ban", :reverse => "true"
76
- end
77
-
78
- test "#fa_stacked_icon should html escape text" do
79
- expected = %(<span class="fa-stack">#{i("fa fa-check-empty fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span> &lt;script&gt;)
80
- assert_stacked_icon expected, "twitter", :base => "check-empty", :text => "<script>"
81
- end
82
-
83
- test "#fa_stacked_icon should not html escape safe text" do
84
- expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span> <script>)
85
- assert_stacked_icon expected, "twitter", :base => "square-o", :text => "<script>".html_safe
86
- end
87
-
88
- test "#fa_stacked_icon should accept options for base and main icons" do
89
- expected = %(<span class="fa-stack">#{i("fa fa-camera fa-stack-1x text-info")}#{i("fa fa-ban fa-stack-2x text-error")}</span>)
90
- assert_stacked_icon expected, "camera", :base => "ban", :reverse => true, :base_options => { :class => "text-error" }, :icon_options => { :class => "text-info" }
91
- end
92
-
93
- test "#fa_stacked_icon should pass all other options through" do
94
- expected = %(<span class="fa-stack" data-id="123">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-user fa-stack-1x")}</span>)
95
- assert_stacked_icon expected, "user", :base => "square-o", :data => { :id => 123 }
96
- end
97
-
98
- private
99
-
100
- def assert_icon(expected, *args)
101
- message = "`fa_icon(#{args.inspect[1...-1]})` should return `#{expected}`"
102
- assert_dom_equal expected, fa_icon(*args), message
103
- end
104
-
105
- def assert_stacked_icon(expected, *args)
106
- message = "`fa_stacked_icon(#{args.inspect[1...-1]})` should return `#{expected}`"
107
- assert_dom_equal expected, fa_stacked_icon(*args), message
108
- end
109
-
110
- def i(classes)
111
- %(<i class="#{classes}"></i>)
112
- end
113
- end
1
+ # require 'test_helper'
2
+ #
3
+ # class FontAwesome::Rails::IconHelperTest < ActionView::TestCase
4
+ #
5
+ # test "#fa_icon with no args should render a flag icon" do
6
+ # assert_icon i("fa fa-flag")
7
+ # end
8
+ #
9
+ # test "#fa_icon should render different individual icons" do
10
+ # assert_icon i("fa fa-flag"), "flag"
11
+ # assert_icon i("fa fa-camera-retro"), "camera-retro"
12
+ # assert_icon i("fa fa-cog"), "cog"
13
+ # assert_icon i("fa fa-github"), "github"
14
+ # end
15
+ #
16
+ # test "#fa_icon should render icons with multiple modifiers" do
17
+ # assert_icon i("fa fa-pencil fa-fixed-width"), "pencil fixed-width"
18
+ # assert_icon i("fa fa-flag fa-4x"), "flag 4x"
19
+ # assert_icon i("fa fa-refresh fa-2x fa-spin"), "refresh 2x spin"
20
+ # end
21
+ #
22
+ # test "#fa_icon should render icons with array modifiers" do
23
+ # assert_icon i("fa fa-flag"), ["flag"]
24
+ # assert_icon i("fa fa-check fa-li"), ["check", "li"]
25
+ # assert_icon i("fa fa-flag fa-4x"), ["flag", "4x"]
26
+ # assert_icon i("fa fa-refresh fa-2x fa-spin"), ["refresh", "2x", "spin"]
27
+ # end
28
+ #
29
+ # test "#fa_icon should incorporate additional class styles" do
30
+ # assert_icon i("fa fa-flag pull-right"), "flag", :class => "pull-right"
31
+ # assert_icon i("fa fa-flag fa-2x pull-right"), ["flag", "2x"], :class => ["pull-right"]
32
+ # assert_icon i("fa fa-check fa-li pull-right special"), "check li", :class => "pull-right special"
33
+ # assert_icon i("fa fa-check pull-right special"), "check", :class => ["pull-right", "special"]
34
+ # end
35
+ #
36
+ # test "#fa_icon should incorporate a text suffix" do
37
+ # assert_icon "#{i("fa fa-camera-retro")} Take a photo", "camera-retro", :text => "Take a photo"
38
+ # end
39
+ #
40
+ # test "#fa_icon should html escape text" do
41
+ # assert_icon "#{i("fa fa-camera-retro")} &lt;script&gt;&lt;/script&gt;", "camera-retro", :text => "<script></script>"
42
+ # end
43
+ #
44
+ # test "#fa_icon should not html escape safe text" do
45
+ # assert_icon "#{i("fa fa-camera-retro")} <script></script>", "camera-retro", :text => "<script></script>".html_safe
46
+ # end
47
+ #
48
+ # test "#fa_icon should pull it all together" do
49
+ # assert_icon "#{i("fa fa-camera-retro pull-right")} Take a photo", "camera-retro", :text => "Take a photo", :class => "pull-right"
50
+ # end
51
+ #
52
+ # test "#fa_icon should pass all other options through" do
53
+ # assert_icon %(<i class="fa fa-user" data-id="123"></i>), "user", :data => { :id => 123 }
54
+ # end
55
+ #
56
+ # test "#fa_stacked_icon with no args should render a flag icon" do
57
+ # expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-flag fa-stack-1x")}</span>)
58
+ # assert_stacked_icon expected
59
+ # end
60
+ #
61
+ # test "#fa_stacked_icon should render a stacked icon" do
62
+ # expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span>)
63
+ # assert_stacked_icon expected, "twitter", :base => "square-o"
64
+ # expected = %(<span class="fa-stack">#{i("fa fa-square fa-stack-2x")}#{i("fa fa-terminal fa-inverse fa-stack-1x")}</span>)
65
+ # assert_stacked_icon expected, ["terminal", "inverse"], :base => ["square"]
66
+ # end
67
+ #
68
+ # test "#fa_stacked_icon should incorporate additional class styles" do
69
+ # expected = %(<span class="fa-stack pull-right">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span>)
70
+ # assert_stacked_icon expected, "twitter", :base => "square-o", :class => "pull-right"
71
+ # end
72
+ #
73
+ # test "#fa_stacked_icon should reverse the stack" do
74
+ # expected = %(<span class="fa-stack">#{i("fa fa-facebook fa-stack-1x")}#{i("fa fa-ban fa-stack-2x")}</span>)
75
+ # assert_stacked_icon expected, "facebook", :base => "ban", :reverse => "true"
76
+ # end
77
+ #
78
+ # test "#fa_stacked_icon should html escape text" do
79
+ # expected = %(<span class="fa-stack">#{i("fa fa-check-empty fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span> &lt;script&gt;)
80
+ # assert_stacked_icon expected, "twitter", :base => "check-empty", :text => "<script>"
81
+ # end
82
+ #
83
+ # test "#fa_stacked_icon should not html escape safe text" do
84
+ # expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-twitter fa-stack-1x")}</span> <script>)
85
+ # assert_stacked_icon expected, "twitter", :base => "square-o", :text => "<script>".html_safe
86
+ # end
87
+ #
88
+ # test "#fa_stacked_icon should accept options for base and main icons" do
89
+ # expected = %(<span class="fa-stack">#{i("fa fa-camera fa-stack-1x text-info")}#{i("fa fa-ban fa-stack-2x text-error")}</span>)
90
+ # assert_stacked_icon expected, "camera", :base => "ban", :reverse => true, :base_options => { :class => "text-error" }, :icon_options => { :class => "text-info" }
91
+ # end
92
+ #
93
+ # test "#fa_stacked_icon should pass all other options through" do
94
+ # expected = %(<span class="fa-stack" data-id="123">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-user fa-stack-1x")}</span>)
95
+ # assert_stacked_icon expected, "user", :base => "square-o", :data => { :id => 123 }
96
+ # end
97
+ #
98
+ # private
99
+ #
100
+ # def assert_icon(expected, *args)
101
+ # message = "`fa_icon(#{args.inspect[1...-1]})` should return `#{expected}`"
102
+ # assert_dom_equal expected, fa_icon(*args), message
103
+ # end
104
+ #
105
+ # def assert_stacked_icon(expected, *args)
106
+ # message = "`fa_stacked_icon(#{args.inspect[1...-1]})` should return `#{expected}`"
107
+ # assert_dom_equal expected, fa_stacked_icon(*args), message
108
+ # end
109
+ #
110
+ # def i(classes)
111
+ # %(<i class="#{classes}"></i>)
112
+ # end
113
+ # end
data/test/test_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
1
+ # # Configure Rails Environment
2
+ # ENV["RAILS_ENV"] = "test"
3
+ #
4
+ # require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ # require "rails/test_help"
6
+ #
7
+ # Rails.backtrace_cleaner.remove_silencers!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weather-icons-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Schaaf
@@ -36,28 +36,84 @@ dependencies:
36
36
  requirements:
37
37
  - - ~>
38
38
  - !ruby/object:Gem::Version
39
- version: '0'
39
+ version: 4.1.0
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: 4.1.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sass-rails
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 4.0.1
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: 4.0.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: '1.3'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ version: '1.3'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ~>
80
+ - !ruby/object:Gem::Version
81
+ version: 10.3.0
54
82
  type: :development
55
83
  prerelease: false
56
84
  version_requirements: !ruby/object:Gem::Requirement
57
85
  requirements:
58
86
  - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: 10.3.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: compass
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '>='
59
94
  - !ruby/object:Gem::Version
60
95
  version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: sass
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '3.2'
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ~>
115
+ - !ruby/object:Gem::Version
116
+ version: '3.2'
61
117
  description: I like font-awesome, weather-icons, and rails. So I am doing my best
62
118
  to combine weather-icons into an easy to use gem.
63
119
  email:
@@ -73,12 +129,27 @@ files:
73
129
  - app/assets/font/weathericons-regular-webfont.svg
74
130
  - app/assets/font/weathericons-regular-webfont.ttf
75
131
  - app/assets/font/weathericons-regular-webfont.woff
76
- - app/assets/stylesheets/weather-icons.css
77
- - app/helpers/font_awesome/rails/icon_helper.rb
78
- - app/helpers/weather_icons/rails/icon_helper.rb
132
+ - app/assets/stylesheets/weather-icons.css.scss
133
+ - app/assets/stylesheets/weather-icons/_bootstrap.css.scss
134
+ - app/assets/stylesheets/weather-icons/_bordered-pulled.css.scss
135
+ - app/assets/stylesheets/weather-icons/_core.css.scss
136
+ - app/assets/stylesheets/weather-icons/_extras.css.scss
137
+ - app/assets/stylesheets/weather-icons/_fixed-width.css.scss
138
+ - app/assets/stylesheets/weather-icons/_icons.css.scss
139
+ - app/assets/stylesheets/weather-icons/_larger.css.scss
140
+ - app/assets/stylesheets/weather-icons/_list.css.scss
141
+ - app/assets/stylesheets/weather-icons/_mixins.css.scss
142
+ - app/assets/stylesheets/weather-icons/_path.css.scss
143
+ - app/assets/stylesheets/weather-icons/_rotated-flipped.css.scss
144
+ - app/assets/stylesheets/weather-icons/_spinning.css.scss
145
+ - app/assets/stylesheets/weather-icons/_stacked.css.scss
146
+ - app/assets/stylesheets/weather-icons/_variables.css.scss
79
147
  - lib/weather-icons-rails.rb
80
- - lib/weather-icons-rails/engine.rb
81
- - lib/weather-icons-rails/version.rb
148
+ - lib/weather-icons/rails.rb
149
+ - lib/weather-icons/rails/rails/engine.rb
150
+ - lib/weather-icons/rails/rails/helpers.rb
151
+ - lib/weather-icons/rails/rails/railtie.rb
152
+ - lib/weather-icons/rails/version.rb
82
153
  - test/dummy/app/assets/stylesheets/sass-import.css.sass
83
154
  - test/dummy/app/assets/stylesheets/scss-import.css.scss
84
155
  - test/dummy/app/assets/stylesheets/sprockets-require.css