font_awesome5_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +57 -0
- data/Rakefile +21 -0
- data/app/assets/images/fa-brands.svg +1327 -0
- data/app/assets/images/fa-regular.svg +471 -0
- data/app/assets/images/fa-solid.svg +1939 -0
- data/app/assets/javascripts/font_awesome5.js +1 -0
- data/app/assets/javascripts/fontawesome-all.min.js +5 -0
- data/app/assets/stylesheets/fa-svg-with-js.css +343 -0
- data/app/assets/stylesheets/font_awesome5.css +3 -0
- data/app/helpers/font_awesome/rails/icon_helper.rb +25 -0
- data/bin/test +5 -0
- data/lib/font_awesome5_rails.rb +4 -0
- data/lib/font_awesome5_rails/engine.rb +4 -0
- data/lib/font_awesome5_rails/version.rb +4 -0
- data/lib/tasks/font_awesome5_rails_tasks.rake +4 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +17 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +91 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/examples.txt +3 -0
- data/spec/font_awesome5_rails_spec.rb +42 -0
- data/spec/spec_helper.rb +113 -0
- metadata +162 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FontAwesome5Rails do
|
4
|
+
include RSpecHtmlMatchers
|
5
|
+
include ActionView::Context
|
6
|
+
|
7
|
+
describe 'tags' do
|
8
|
+
it 'should return correct class tags' do
|
9
|
+
expect(fa_icon 'camera-retro').to eq '<i class="fas fa-camera-retro"></i>'
|
10
|
+
expect(fa_icon('camera-retro', class: 'test')).to eq '<i class="fas fa-camera-retro test"></i>'
|
11
|
+
expect(fa_icon('camera-retro', class: 'fa-camera-retro')).to eq '<i class="fas fa-camera-retro"></i>'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should return correct size tags' do
|
15
|
+
expect(fa_icon 'camera-retro', size: '3x').to eq '<i class="fas fa-camera-retro fa-3x"></i>'
|
16
|
+
expect(fa_icon 'camera-retro', class: 'fa-3x', size: '3x').to eq '<i class="fas fa-camera-retro fa-3x"></i>'
|
17
|
+
expect(fa_icon 'camera-retro', size: '3x 2x').to eq '<i class="fas fa-camera-retro fa-3x fa-2x"></i>'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should return correct animation tags' do
|
21
|
+
expect(fa_icon 'camera-retro', animation: 'spin').to eq '<i class="fas fa-camera-retro fa-spin"></i>'
|
22
|
+
expect(fa_icon 'camera-retro', class: 'fa-spin', animation: 'spin').to eq '<i class="fas fa-camera-retro fa-spin"></i>'
|
23
|
+
expect(fa_icon 'camera-retro', animation: 'spin cog').to eq '<i class="fas fa-camera-retro fa-spin fa-cog"></i>'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should return correct style tags' do
|
27
|
+
expect(fa_icon 'camera-retro', style: 'color: Tomato;').to eq '<i class="fas fa-camera-retro" style="color: Tomato;"></i>'
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should return correct data tags' do
|
31
|
+
expect(fa_icon 'camera-retro', data: {'fa-transform': 'rotate-90'}).to eq '<i class="fas fa-camera-retro" data-fa-transform="rotate-90"></i>'
|
32
|
+
expect(fa_icon 'camera-retro', data: {fa_transform: 'rotate-90'}).to eq '<i class="fas fa-camera-retro" data-fa-transform="rotate-90"></i>'
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should return correct text tags' do
|
36
|
+
expect(fa_icon 'camera-retro', text: 'Camera').to have_tag('i', with: { class: 'fas fa-camera-retro'})
|
37
|
+
expect(fa_icon 'camera-retro', text: 'Camera').to have_tag('span', text: 'Camera')
|
38
|
+
expect(fa_icon 'camera-retro', text: 'Camera', style: 'color: Tomato;').to have_tag('span', text: 'Camera', with: {style: 'padding-left: 5px;color: Tomato;'})
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
|
+
ENV['RAILS_ENV'] ||= 'test'
|
17
|
+
|
18
|
+
require 'byebug'
|
19
|
+
require File.expand_path('../dummy/config/application', __FILE__)
|
20
|
+
#require './app/helpers/font_awesome/rails/icon_helper'
|
21
|
+
|
22
|
+
require 'font_awesome5_rails'
|
23
|
+
require 'rspec'
|
24
|
+
|
25
|
+
Dummy::Application.initialize!
|
26
|
+
|
27
|
+
RSpec.configure do |config|
|
28
|
+
config.include FontAwesome::Rails::IconHelper
|
29
|
+
config.include ActionView::Helpers
|
30
|
+
# rspec-expectations config goes here. You can use an alternate
|
31
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
32
|
+
# assertions if you prefer.
|
33
|
+
config.expect_with :rspec do |expectations|
|
34
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
35
|
+
# and `failure_message` of custom matchers include text for helper methods
|
36
|
+
# defined using `chain`, e.g.:
|
37
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
38
|
+
# # => "be bigger than 2 and smaller than 4"
|
39
|
+
# ...rather than:
|
40
|
+
# # => "be bigger than 2"
|
41
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
45
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
46
|
+
config.mock_with :rspec do |mocks|
|
47
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
48
|
+
# a real object. This is generally recommended, and will default to
|
49
|
+
# `true` in RSpec 4.
|
50
|
+
mocks.verify_partial_doubles = true
|
51
|
+
end
|
52
|
+
|
53
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
54
|
+
# have no way to turn it off -- the option exists only for backwards
|
55
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
56
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
57
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
58
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
59
|
+
|
60
|
+
# The settings below are suggested to provide a good initial experience
|
61
|
+
# with RSpec, but feel free to customize to your heart's content.
|
62
|
+
=begin
|
63
|
+
# This allows you to limit a spec run to individual examples or groups
|
64
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
65
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
66
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
67
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
68
|
+
config.filter_run_when_matching :focus
|
69
|
+
|
70
|
+
# Allows RSpec to persist some state between runs in order to support
|
71
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
72
|
+
# you configure your source control system to ignore this file.
|
73
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
74
|
+
|
75
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
76
|
+
# recommended. For more details, see:
|
77
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
78
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
79
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
80
|
+
config.disable_monkey_patching!
|
81
|
+
|
82
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
83
|
+
# be too noisy due to issues in dependencies.
|
84
|
+
config.warnings = true
|
85
|
+
|
86
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
87
|
+
# file, and it's useful to allow more verbose output when running an
|
88
|
+
# individual spec file.
|
89
|
+
if config.files_to_run.one?
|
90
|
+
# Use the documentation formatter for detailed output,
|
91
|
+
# unless a formatter has already been configured
|
92
|
+
# (e.g. via a command-line flag).
|
93
|
+
config.default_formatter = "doc"
|
94
|
+
end
|
95
|
+
|
96
|
+
# Print the 10 slowest examples and example groups at the
|
97
|
+
# end of the spec run, to help surface which specs are running
|
98
|
+
# particularly slow.
|
99
|
+
config.profile_examples = 10
|
100
|
+
|
101
|
+
# Run specs in random order to surface order dependencies. If you find an
|
102
|
+
# order dependency and want to debug it, you can fix the order by providing
|
103
|
+
# the seed, which is printed after each run.
|
104
|
+
# --seed 1234
|
105
|
+
config.order = :random
|
106
|
+
|
107
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
108
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
109
|
+
# test failures related to randomization by passing the same `--seed` value
|
110
|
+
# as the one that triggered the failure.
|
111
|
+
Kernel.srand config.seed
|
112
|
+
=end
|
113
|
+
end
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: font_awesome5_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- tomkra
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-02-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: '4.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.2'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.2'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '4.2'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4.2'
|
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: font_awesome5_rails provides Font-Awesome 5 support.
|
62
|
+
email:
|
63
|
+
- kralutomas@gmail.com
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- MIT-LICENSE
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- app/assets/images/fa-brands.svg
|
72
|
+
- app/assets/images/fa-regular.svg
|
73
|
+
- app/assets/images/fa-solid.svg
|
74
|
+
- app/assets/javascripts/font_awesome5.js
|
75
|
+
- app/assets/javascripts/fontawesome-all.min.js
|
76
|
+
- app/assets/stylesheets/fa-svg-with-js.css
|
77
|
+
- app/assets/stylesheets/font_awesome5.css
|
78
|
+
- app/helpers/font_awesome/rails/icon_helper.rb
|
79
|
+
- bin/test
|
80
|
+
- lib/font_awesome5_rails.rb
|
81
|
+
- lib/font_awesome5_rails/engine.rb
|
82
|
+
- lib/font_awesome5_rails/version.rb
|
83
|
+
- lib/tasks/font_awesome5_rails_tasks.rake
|
84
|
+
- spec/dummy/Rakefile
|
85
|
+
- spec/dummy/app/assets/config/manifest.js
|
86
|
+
- spec/dummy/app/assets/javascripts/application.js
|
87
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
88
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
89
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
90
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
91
|
+
- spec/dummy/app/controllers/application_controller.rb
|
92
|
+
- spec/dummy/app/helpers/application_helper.rb
|
93
|
+
- spec/dummy/app/jobs/application_job.rb
|
94
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
95
|
+
- spec/dummy/app/models/application_record.rb
|
96
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
97
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
98
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
99
|
+
- spec/dummy/bin/bundle
|
100
|
+
- spec/dummy/bin/rails
|
101
|
+
- spec/dummy/bin/rake
|
102
|
+
- spec/dummy/bin/setup
|
103
|
+
- spec/dummy/bin/update
|
104
|
+
- spec/dummy/bin/yarn
|
105
|
+
- spec/dummy/config.ru
|
106
|
+
- spec/dummy/config/application.rb
|
107
|
+
- spec/dummy/config/boot.rb
|
108
|
+
- spec/dummy/config/cable.yml
|
109
|
+
- spec/dummy/config/database.yml
|
110
|
+
- spec/dummy/config/environment.rb
|
111
|
+
- spec/dummy/config/environments/development.rb
|
112
|
+
- spec/dummy/config/environments/production.rb
|
113
|
+
- spec/dummy/config/environments/test.rb
|
114
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
115
|
+
- spec/dummy/config/initializers/assets.rb
|
116
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
117
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
118
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
119
|
+
- spec/dummy/config/initializers/inflections.rb
|
120
|
+
- spec/dummy/config/initializers/mime_types.rb
|
121
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
122
|
+
- spec/dummy/config/locales/en.yml
|
123
|
+
- spec/dummy/config/puma.rb
|
124
|
+
- spec/dummy/config/routes.rb
|
125
|
+
- spec/dummy/config/secrets.yml
|
126
|
+
- spec/dummy/config/spring.rb
|
127
|
+
- spec/dummy/log/test.log
|
128
|
+
- spec/dummy/package.json
|
129
|
+
- spec/dummy/public/404.html
|
130
|
+
- spec/dummy/public/422.html
|
131
|
+
- spec/dummy/public/500.html
|
132
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
133
|
+
- spec/dummy/public/apple-touch-icon.png
|
134
|
+
- spec/dummy/public/favicon.ico
|
135
|
+
- spec/examples.txt
|
136
|
+
- spec/font_awesome5_rails_spec.rb
|
137
|
+
- spec/spec_helper.rb
|
138
|
+
homepage: https://github.com/tomkra/font_awesome5_rails
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata: {}
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
require_paths:
|
145
|
+
- lib
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 2.0.0
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
requirements: []
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.7.3
|
159
|
+
signing_key:
|
160
|
+
specification_version: 4
|
161
|
+
summary: an asset gemification of the font-awesome 5 icon font library
|
162
|
+
test_files: []
|