stroke-seven-rails 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +131 -0
- data/Rakefile +12 -0
- data/app/assets/fonts/Pe-icon-7-stroke.eot +0 -0
- data/app/assets/fonts/Pe-icon-7-stroke.svg +212 -0
- data/app/assets/fonts/Pe-icon-7-stroke.ttf +0 -0
- data/app/assets/fonts/Pe-icon-7-stroke.woff +0 -0
- data/app/assets/stylesheets/stroke-seven-helper.css +191 -0
- data/app/assets/stylesheets/stroke-seven.css.erb +636 -0
- data/app/helpers/stroke_seven/rails/icon_helper.rb +50 -0
- data/lib/stroke-seven-rails/engine.rb +6 -0
- data/lib/stroke-seven-rails/version.rb +6 -0
- data/lib/stroke-seven-rails.rb +2 -0
- data/test/dummy/app/assets/stylesheets/sass-import.css.sass +1 -0
- data/test/dummy/app/assets/stylesheets/scss-import.css.scss +1 -0
- data/test/dummy/app/assets/stylesheets/sprockets-require.css +3 -0
- data/test/dummy/app/controllers/pages_controller.rb +2 -0
- data/test/dummy/app/views/pages/icons.html.erb +1 -0
- data/test/dummy/config/application.rb +19 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +8 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/log/test.log +1946 -0
- data/test/icon_helper_test.rb +50 -0
- data/test/stroke_seven_rails_test.rb +67 -0
- data/test/test_helper.rb +7 -0
- metadata +137 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class StrokeSeven::Rails::IconHelperTest < ActionView::TestCase
|
4
|
+
|
5
|
+
test "#s7_icon with no args should render an album icon" do
|
6
|
+
assert_icon i("pe-7s-album")
|
7
|
+
end
|
8
|
+
|
9
|
+
test "#s7_icon should render different individual icons" do
|
10
|
+
assert_icon i("pe-7s-album"), "album"
|
11
|
+
assert_icon i("pe-7s-female"), "female"
|
12
|
+
assert_icon i("pe-7s-magic-wand"), "magic-wand"
|
13
|
+
end
|
14
|
+
|
15
|
+
test "#s7_icon should incorporate additional class styles" do
|
16
|
+
assert_icon i("pe-7s-album pull-right"), "album", :class => "pull-right"
|
17
|
+
assert_icon i("pe-7s-album pull-right success"), "album", :class => "pull-right success"
|
18
|
+
end
|
19
|
+
|
20
|
+
test "#s7_icon should incorporate a text suffix" do
|
21
|
+
assert_icon "#{i("pe-7s-female")} Take a photo", "female", :text => "Take a photo"
|
22
|
+
end
|
23
|
+
|
24
|
+
test "#s7_icon should html escape text" do
|
25
|
+
assert_icon "#{i("pe-7s-female")} <script></script>", "female", :text => "<script></script>"
|
26
|
+
end
|
27
|
+
|
28
|
+
test "#s7_icon should not html escape safe text" do
|
29
|
+
assert_icon "#{i("pe-7s-female")} <script></script>", "female", :text => "<script></script>".html_safe
|
30
|
+
end
|
31
|
+
|
32
|
+
test "#s7_icon should pull it all together" do
|
33
|
+
assert_icon "#{i("pe-7s-female pull-right")} Take a photo", "female", :text => "Take a photo", :class => "pull-right"
|
34
|
+
end
|
35
|
+
|
36
|
+
test "#s7_icon should pass all other options through" do
|
37
|
+
assert_icon %(<i class="pe-7s-male" data-id="123"></i>), "male", :data => { :id => 123 }
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def assert_icon(expected, *args)
|
43
|
+
message = "`s7_icon(#{args.inspect[1...-1]})` should return `#{expected}`"
|
44
|
+
assert_dom_equal expected, s7_icon(*args), message
|
45
|
+
end
|
46
|
+
|
47
|
+
def i(classes)
|
48
|
+
%(<i class="#{classes}"></i>)
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class StrokeSevenRailsTest < ActionDispatch::IntegrationTest
|
4
|
+
teardown { clean_sprockets_cache }
|
5
|
+
|
6
|
+
test "engine is loaded" do
|
7
|
+
assert_equal ::Rails::Engine, StrokeSeven::Rails::Engine.superclass
|
8
|
+
end
|
9
|
+
|
10
|
+
test "fonts are served" do
|
11
|
+
get "/assets/Pe-icon-7-stroke.eot"
|
12
|
+
assert_response :success
|
13
|
+
get "/assets/Pe-icon-7-stroke.woff"
|
14
|
+
assert_response :success
|
15
|
+
get "/assets/Pe-icon-7-stroke.ttf"
|
16
|
+
assert_response :success
|
17
|
+
get "/assets/Pe-icon-7-stroke.svg"
|
18
|
+
assert_response :success
|
19
|
+
end
|
20
|
+
|
21
|
+
test "stylesheets are served" do
|
22
|
+
get "/assets/stroke-seven.css"
|
23
|
+
assert_stroke_seven(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
test "stylesheets contain asset pipeline references to fonts" do
|
27
|
+
get "/assets/stroke-seven.css"
|
28
|
+
v = StrokeSeven::Rails::S7_VERSION
|
29
|
+
assert_match "/assets/Pe-icon-7-stroke.eot?v=#{v}", response.body
|
30
|
+
assert_match "/assets/Pe-icon-7-stroke.eot?#iefix&v=#{v}", response.body
|
31
|
+
assert_match "/assets/Pe-icon-7-stroke.woff?v=#{v}", response.body
|
32
|
+
assert_match "/assets/Pe-icon-7-stroke.ttf?v=#{v}", response.body
|
33
|
+
assert_match "/assets/Pe-icon-7-stroke.svg?v=#{v}#Pe-icon-7-stroke", response.body
|
34
|
+
end
|
35
|
+
|
36
|
+
test "stylesheet is available in a css sprockets require" do
|
37
|
+
get "/assets/sprockets-require.css"
|
38
|
+
assert_stroke_seven(response)
|
39
|
+
end
|
40
|
+
|
41
|
+
test "stylesheet is available in a sass import" do
|
42
|
+
get "/assets/sass-import.css"
|
43
|
+
assert_stroke_seven(response)
|
44
|
+
end
|
45
|
+
|
46
|
+
test "stylesheet is available in a scss import" do
|
47
|
+
get "/assets/scss-import.css"
|
48
|
+
assert_stroke_seven(response)
|
49
|
+
end
|
50
|
+
|
51
|
+
test "helpers should be available in the view" do
|
52
|
+
get "/icons"
|
53
|
+
assert_response :success
|
54
|
+
assert_select "i.pe-7s-album"
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def clean_sprockets_cache
|
60
|
+
FileUtils.rm_rf File.expand_path("../dummy/tmp", __FILE__)
|
61
|
+
end
|
62
|
+
|
63
|
+
def assert_stroke_seven(response)
|
64
|
+
assert_response :success
|
65
|
+
assert_match(/font-family:\s*'Pe-icon-7-stroke';/, response.body)
|
66
|
+
end
|
67
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stroke-seven-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bimovidia
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
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.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sass-rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
description: I like Stroke 7 fonts. I like the asset pipeline. I like semantic versioning.
|
62
|
+
If you do too, you're welcome.
|
63
|
+
email:
|
64
|
+
- bimo.wijoyo@gmail.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- LICENSE
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- app/assets/fonts/Pe-icon-7-stroke.eot
|
73
|
+
- app/assets/fonts/Pe-icon-7-stroke.svg
|
74
|
+
- app/assets/fonts/Pe-icon-7-stroke.ttf
|
75
|
+
- app/assets/fonts/Pe-icon-7-stroke.woff
|
76
|
+
- app/assets/stylesheets/stroke-seven-helper.css
|
77
|
+
- app/assets/stylesheets/stroke-seven.css.erb
|
78
|
+
- app/helpers/stroke_seven/rails/icon_helper.rb
|
79
|
+
- lib/stroke-seven-rails.rb
|
80
|
+
- lib/stroke-seven-rails/engine.rb
|
81
|
+
- lib/stroke-seven-rails/version.rb
|
82
|
+
- test/dummy/app/assets/stylesheets/sass-import.css.sass
|
83
|
+
- test/dummy/app/assets/stylesheets/scss-import.css.scss
|
84
|
+
- test/dummy/app/assets/stylesheets/sprockets-require.css
|
85
|
+
- test/dummy/app/controllers/pages_controller.rb
|
86
|
+
- test/dummy/app/views/pages/icons.html.erb
|
87
|
+
- test/dummy/config.ru
|
88
|
+
- test/dummy/config/application.rb
|
89
|
+
- test/dummy/config/boot.rb
|
90
|
+
- test/dummy/config/environment.rb
|
91
|
+
- test/dummy/config/initializers/secret_token.rb
|
92
|
+
- test/dummy/config/routes.rb
|
93
|
+
- test/dummy/log/test.log
|
94
|
+
- test/icon_helper_test.rb
|
95
|
+
- test/stroke_seven_rails_test.rb
|
96
|
+
- test/test_helper.rb
|
97
|
+
homepage: https://github.com/bimovidia/stroke-seven-rails
|
98
|
+
licenses:
|
99
|
+
- MIT
|
100
|
+
- SIL Open Font License
|
101
|
+
metadata: {}
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.9.3
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 2.4.3
|
119
|
+
signing_key:
|
120
|
+
specification_version: 4
|
121
|
+
summary: an asset gemification of the Stroke 7 icon font library
|
122
|
+
test_files:
|
123
|
+
- test/dummy/app/assets/stylesheets/sass-import.css.sass
|
124
|
+
- test/dummy/app/assets/stylesheets/scss-import.css.scss
|
125
|
+
- test/dummy/app/assets/stylesheets/sprockets-require.css
|
126
|
+
- test/dummy/app/controllers/pages_controller.rb
|
127
|
+
- test/dummy/app/views/pages/icons.html.erb
|
128
|
+
- test/dummy/config/application.rb
|
129
|
+
- test/dummy/config/boot.rb
|
130
|
+
- test/dummy/config/environment.rb
|
131
|
+
- test/dummy/config/initializers/secret_token.rb
|
132
|
+
- test/dummy/config/routes.rb
|
133
|
+
- test/dummy/config.ru
|
134
|
+
- test/dummy/log/test.log
|
135
|
+
- test/icon_helper_test.rb
|
136
|
+
- test/stroke_seven_rails_test.rb
|
137
|
+
- test/test_helper.rb
|