it 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +14 -0
- data/README.md +7 -8
- data/it.gemspec +6 -5
- data/lib/it.rb +1 -1
- data/lib/it/helper.rb +1 -1
- data/lib/it/interpolation.rb +1 -3
- data/lib/it/link.rb +1 -1
- data/lib/it/parser.rb +1 -1
- data/lib/it/version.rb +1 -1
- metadata +30 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4b79069211ccb670779e106ffa6802ab17feac3d72ca87b4088ce4eab9b928b7
|
4
|
+
data.tar.gz: 61b097f8a810653820c8376c523b56f5a7435c93a966505511688f139f3d7837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a508fd6bb549cdee9b7dd8a9e1fedf9ef0ede81b739fc7cec3e29fc610119e42528e21696bde282847725633b1f029896194b28a4b7bbb0ba6ae5a364cb84a17
|
7
|
+
data.tar.gz: 912d6c0e1db45ecf52cd5c80be7780f6385400f0e84e3ab88076ba639ce8e25569b9a373fa32f23901e50ffa1f73837302425927300301abff04f66e39570557
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# 2.0.0 (2020-08-07)
|
2
|
+
|
3
|
+
## Breaking changes
|
4
|
+
|
5
|
+
* Support dropped for Ruby 2.3, 2.4 and for Rails 4.2, 5.0, and 5.1
|
6
|
+
|
7
|
+
## Fixes
|
8
|
+
|
9
|
+
* Fix 'TypeError - hash key raise is not a Symbol' when used with Rails 6.0.3 [#28](https://github.com/iGEL/it/pull/28)
|
10
|
+
*Jason Barnabe* and *wingice*
|
11
|
+
* Fix Ruby 2.7 deprecations
|
12
|
+
* `It.link` now accepts `ActiveSupport::SafeBuffer`s
|
13
|
+
Reported by *James Balazs*
|
14
|
+
|
1
15
|
# 1.0.0 (2017-06-03)
|
2
16
|
|
3
17
|
* Allow whitespace after the colon without considering it part of the value [#20](https://github.com/iGEL/it/pull/20)
|
data/README.md
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
[![
|
2
|
-
[![Build Status](http://img.shields.io/travis/iGEL/it/
|
3
|
-
[![Coverage](http://img.shields.io/coveralls/iGEL/it/
|
1
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/6f705ee22d3eb7422d8f/maintainability)](https://codeclimate.com/github/iGEL/it/maintainability)
|
2
|
+
[![Build Status](http://img.shields.io/travis/iGEL/it/main.svg?style=flat)](https://travis-ci.org/iGEL/it)
|
3
|
+
[![Coverage](http://img.shields.io/coveralls/iGEL/it/main.svg?style=flat)](https://coveralls.io/r/iGEL/it)
|
4
4
|
[![Rubygems](http://img.shields.io/gem/v/it.svg?style=flat)](http://rubygems.org/gems/it)
|
5
5
|
[![Github Issues](http://img.shields.io/github/issues/iGEL/it.svg?style=flat)](https://github.com/iGEL/it/issues)
|
6
|
-
[![Dependency Status](http://img.shields.io/gemnasium/iGEL/it.svg?style=flat)](https://gemnasium.com/iGEL/it)
|
7
6
|
|
8
|
-
Tested against Ruby 2.
|
7
|
+
Tested against Ruby 2.7, 2.6, and 2.5 and Rails 6.0 and 5.2
|
9
8
|
|
10
9
|
What is **it**?
|
11
10
|
=============
|
@@ -51,14 +50,14 @@ You may have as many links inside your translations as you like, and normal inte
|
|
51
50
|
|
52
51
|
```yaml
|
53
52
|
en:
|
54
|
-
copy: "Read the %{guide:Rails I18n guide} for more than %{advises} advises. Fork it at {repo:github}."
|
53
|
+
copy: "Read the %{guide:Rails I18n guide} for more than %{advises} advises. Fork it at %{repo:github}."
|
55
54
|
```
|
56
55
|
|
57
56
|
```erb
|
58
57
|
<%=it "copy",
|
59
58
|
guide: It.link("http://guides.rubyonrails.org/i18n.html"),
|
60
59
|
advices: 100,
|
61
|
-
repo: It.link("https://github.com/
|
60
|
+
repo: It.link("https://github.com/rails/rails") %>
|
62
61
|
```
|
63
62
|
|
64
63
|
As you see above, unless the interpolation name is `link` or starts with `link_` or ends with `_link`, you need to call `It.link` to create a link. The advantage of `It.link`: You may specify options like you would with `link_to`:
|
@@ -105,7 +104,7 @@ en:
|
|
105
104
|
```
|
106
105
|
|
107
106
|
```erb
|
108
|
-
https://github.com/
|
107
|
+
https://github.com/rails/rails
|
109
108
|
<%= it "mail_copy", link: It.link("http://www.rubyonrails.org/") %>
|
110
109
|
|
111
110
|
Plain mail:
|
data/it.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'it/version'
|
4
4
|
|
@@ -15,13 +15,14 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.files = %w[MIT-LICENSE README.md Rakefile Gemfile CHANGELOG.md it.gemspec] + Dir['lib/**/*.rb']
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
+
spec.required_ruby_version = '>= 2.5.0'
|
18
19
|
spec.add_dependency 'actionpack', '>= 3.0.0'
|
19
20
|
|
20
|
-
spec.add_development_dependency 'bundler'
|
21
|
-
spec.add_development_dependency 'rake', '~> 12'
|
22
|
-
spec.add_development_dependency 'rspec', '~> 3.2'
|
21
|
+
spec.add_development_dependency 'bundler'
|
23
22
|
spec.add_development_dependency 'coveralls'
|
24
23
|
spec.add_development_dependency 'nokogiri'
|
25
|
-
spec.add_development_dependency '
|
24
|
+
spec.add_development_dependency 'rake', '~> 12'
|
26
25
|
spec.add_development_dependency 'reek'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
27
|
+
spec.add_development_dependency 'rubocop'
|
27
28
|
end
|
data/lib/it.rb
CHANGED
@@ -15,7 +15,7 @@ module It
|
|
15
15
|
# It outside of your views. See documentation at Helper#it
|
16
16
|
def self.it(identifier, options = {})
|
17
17
|
Parser.new(
|
18
|
-
I18n.t(identifier, Parser.backend_options(options)),
|
18
|
+
I18n.t(identifier, **Parser.backend_options(options).symbolize_keys),
|
19
19
|
options.stringify_keys
|
20
20
|
).process
|
21
21
|
end
|
data/lib/it/helper.rb
CHANGED
data/lib/it/interpolation.rb
CHANGED
@@ -45,9 +45,7 @@ module It
|
|
45
45
|
|
46
46
|
# Convert keys with String arguments into It::Links, if they are named link, link_* or *_link
|
47
47
|
def convert_link
|
48
|
-
if key =~ /(\Alink\z|_link\z|\Alink_)/ && value.is_a?(String)
|
49
|
-
@value = It::Link.new(value)
|
50
|
-
end
|
48
|
+
@value = It::Link.new(value) if key =~ /(\Alink\z|_link\z|\Alink_)/ && value.is_a?(String)
|
51
49
|
end
|
52
50
|
|
53
51
|
def process_it_tag
|
data/lib/it/link.rb
CHANGED
@@ -7,7 +7,7 @@ module It
|
|
7
7
|
|
8
8
|
# See It.link for details. You can do everything there and save 6 characters.
|
9
9
|
def initialize(href, options = {})
|
10
|
-
raise TypeError, 'Invalid href given' unless [Hash, String].include?(href.class)
|
10
|
+
raise TypeError, 'Invalid href given' unless [Hash, String, ActiveSupport::SafeBuffer].include?(href.class)
|
11
11
|
|
12
12
|
super(:a, options)
|
13
13
|
@href = href
|
data/lib/it/parser.rb
CHANGED
data/lib/it/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Barre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -28,60 +28,60 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '12'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '12'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: reek
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,21 +95,21 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '3.2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '3.2'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -155,15 +155,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
requirements:
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
158
|
+
version: 2.5.0
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
|
166
|
-
rubygems_version: 2.6.10
|
165
|
+
rubygems_version: 3.1.2
|
167
166
|
signing_key:
|
168
167
|
specification_version: 4
|
169
168
|
summary: A helper for links and other html tags in your translations
|