friendly_id-mobility 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7bbbfe1f2a1b85a565297ba1acf35fc086db825f
4
- data.tar.gz: 5722fb89af5c709d3393f4d2f997fec2b739b0b3
2
+ SHA256:
3
+ metadata.gz: 5b9dc85b6c90a5b80039281fc5215b8c42f0866c5a9e498b575973ea3b65e5c9
4
+ data.tar.gz: bb492b5e1d921a9aa298a1779111af13d2521a25b7a2de763b0600fc23c6ec14
5
5
  SHA512:
6
- metadata.gz: fd4e2e61e3534e19d8346226a70187f47daeeb3d22c451d0acd9860922038d4b9c0d7164f083953cbc502988c928e11a1bea319d72f792004039bcbe32085d3c
7
- data.tar.gz: 9a744f53daf92d599f926196e6275ad8151f7c4e55a9e3e97c6dbde05f3cce1da2b4b804c60fc10cdb4ada816880450c675118140c531431119f9fa29bad8da7
6
+ metadata.gz: 8a5a28fc2171ab3d3d72c8b9c5903a178bdc91045d2a8bed119909c04045ee91f191643f7427b93744417a40d6e207f111969eb3b641281ca2cb1670d556a98b
7
+ data.tar.gz: 72ce38757353f93559053412771f0d8825921f00ae5c1fb4ccb428af2c7bee9cd1ba708147eb23816a4c7d6b3eee0fb8acbedfd79936032bb3bedd775b28fef3
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## 0.5
4
4
 
5
+ ### 0.5.4
6
+ * Generate all translated slugs when model is saved
7
+ ([#12](https://github.com/shioyama/friendly_id-mobility/pull/12))
8
+
5
9
  ### 0.5.3
6
10
  * Update gemspec to allow all Mobility versions < 1.0
7
11
 
data/Gemfile CHANGED
@@ -10,8 +10,10 @@ group :development, :test do
10
10
 
11
11
  if ENV['RAILS_VERSION'] == '5.1'
12
12
  gem 'rails', '>= 5.1', '< 5.2'
13
- else
13
+ elsif ENV['RAILS_VERSION'] == '5.0'
14
14
  gem 'rails', '>= 5.0', '< 5.1'
15
+ else
16
+ gem 'rails', '>= 5.2.0.rc2', '< 5.3'
15
17
  end
16
18
 
17
19
  gem 'pry'
@@ -1,122 +1,131 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- friendly_id-mobility (0.5.1)
4
+ friendly_id-mobility (0.5.3)
5
5
  friendly_id (>= 5.0.0, <= 5.3.0)
6
- mobility (>= 0.3.0, < 0.4.0)
6
+ mobility (>= 0.5.1, < 1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.0.6)
12
- actionpack (= 5.0.6)
13
- nio4r (>= 1.2, < 3.0)
14
- websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.6)
16
- actionpack (= 5.0.6)
17
- actionview (= 5.0.6)
18
- activejob (= 5.0.6)
11
+ actioncable (5.2.0.rc2)
12
+ actionpack (= 5.2.0.rc2)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailer (5.2.0.rc2)
16
+ actionpack (= 5.2.0.rc2)
17
+ actionview (= 5.2.0.rc2)
18
+ activejob (= 5.2.0.rc2)
19
19
  mail (~> 2.5, >= 2.5.4)
20
20
  rails-dom-testing (~> 2.0)
21
- actionpack (5.0.6)
22
- actionview (= 5.0.6)
23
- activesupport (= 5.0.6)
21
+ actionpack (5.2.0.rc2)
22
+ actionview (= 5.2.0.rc2)
23
+ activesupport (= 5.2.0.rc2)
24
24
  rack (~> 2.0)
25
- rack-test (~> 0.6.3)
25
+ rack-test (>= 0.6.3)
26
26
  rails-dom-testing (~> 2.0)
27
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.6)
29
- activesupport (= 5.0.6)
28
+ actionview (5.2.0.rc2)
29
+ activesupport (= 5.2.0.rc2)
30
30
  builder (~> 3.1)
31
- erubis (~> 2.7.0)
31
+ erubi (~> 1.4)
32
32
  rails-dom-testing (~> 2.0)
33
33
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
- activejob (5.0.6)
35
- activesupport (= 5.0.6)
34
+ activejob (5.2.0.rc2)
35
+ activesupport (= 5.2.0.rc2)
36
36
  globalid (>= 0.3.6)
37
- activemodel (5.0.6)
38
- activesupport (= 5.0.6)
39
- activerecord (5.0.6)
40
- activemodel (= 5.0.6)
41
- activesupport (= 5.0.6)
42
- arel (~> 7.0)
43
- activesupport (5.0.6)
37
+ activemodel (5.2.0.rc2)
38
+ activesupport (= 5.2.0.rc2)
39
+ activerecord (5.2.0.rc2)
40
+ activemodel (= 5.2.0.rc2)
41
+ activesupport (= 5.2.0.rc2)
42
+ arel (>= 9.0)
43
+ activestorage (5.2.0.rc2)
44
+ actionpack (= 5.2.0.rc2)
45
+ activerecord (= 5.2.0.rc2)
46
+ marcel (~> 0.3.1)
47
+ activesupport (5.2.0.rc2)
44
48
  concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (~> 0.7)
49
+ i18n (>= 0.7, < 2)
46
50
  minitest (~> 5.1)
47
51
  tzinfo (~> 1.1)
48
- arel (7.1.4)
52
+ arel (9.0.0)
49
53
  builder (3.2.3)
50
- byebug (9.1.0)
54
+ byebug (10.0.1)
51
55
  coderay (1.1.2)
52
56
  concurrent-ruby (1.0.5)
53
57
  crass (1.0.3)
54
58
  database_cleaner (1.6.2)
55
59
  diff-lcs (1.3)
56
- erubis (2.7.0)
57
- friendly_id (5.2.3)
60
+ erubi (1.7.1)
61
+ friendly_id (5.2.4)
58
62
  activerecord (>= 4.0.0)
59
63
  generator_spec (0.9.4)
60
64
  activesupport (>= 3.0.0)
61
65
  railties (>= 3.0.0)
62
66
  globalid (0.4.1)
63
67
  activesupport (>= 4.2.0)
64
- i18n (0.9.1)
68
+ i18n (1.0.1)
65
69
  concurrent-ruby (~> 1.0)
66
- loofah (2.1.1)
70
+ loofah (2.2.2)
67
71
  crass (~> 1.0.2)
68
72
  nokogiri (>= 1.5.9)
69
73
  mail (2.7.0)
70
74
  mini_mime (>= 0.1.1)
75
+ marcel (0.3.2)
76
+ mimemagic (~> 0.3.2)
71
77
  method_source (0.9.0)
78
+ mimemagic (0.3.2)
72
79
  mini_mime (1.0.0)
73
80
  mini_portile2 (2.3.0)
74
- minitest (5.10.3)
75
- mobility (0.3.6)
76
- i18n (>= 0.6.10, < 0.10)
81
+ minitest (5.11.3)
82
+ mobility (0.5.1)
83
+ i18n (>= 0.6.10, < 1.1)
77
84
  request_store (~> 1.0)
78
- nio4r (2.1.0)
79
- nokogiri (1.8.1)
85
+ nio4r (2.3.0)
86
+ nokogiri (1.8.2)
80
87
  mini_portile2 (~> 2.3.0)
81
88
  pry (0.11.3)
82
89
  coderay (~> 1.1.0)
83
90
  method_source (~> 0.9.0)
84
- pry-byebug (3.5.1)
85
- byebug (~> 9.1)
91
+ pry-byebug (3.6.0)
92
+ byebug (~> 10.0)
86
93
  pry (~> 0.10)
87
- rack (2.0.3)
88
- rack-test (0.6.3)
89
- rack (>= 1.0)
90
- rails (5.0.6)
91
- actioncable (= 5.0.6)
92
- actionmailer (= 5.0.6)
93
- actionpack (= 5.0.6)
94
- actionview (= 5.0.6)
95
- activejob (= 5.0.6)
96
- activemodel (= 5.0.6)
97
- activerecord (= 5.0.6)
98
- activesupport (= 5.0.6)
94
+ rack (2.0.4)
95
+ rack-test (1.0.0)
96
+ rack (>= 1.0, < 3)
97
+ rails (5.2.0.rc2)
98
+ actioncable (= 5.2.0.rc2)
99
+ actionmailer (= 5.2.0.rc2)
100
+ actionpack (= 5.2.0.rc2)
101
+ actionview (= 5.2.0.rc2)
102
+ activejob (= 5.2.0.rc2)
103
+ activemodel (= 5.2.0.rc2)
104
+ activerecord (= 5.2.0.rc2)
105
+ activestorage (= 5.2.0.rc2)
106
+ activesupport (= 5.2.0.rc2)
99
107
  bundler (>= 1.3.0)
100
- railties (= 5.0.6)
108
+ railties (= 5.2.0.rc2)
101
109
  sprockets-rails (>= 2.0.0)
102
110
  rails-dom-testing (2.0.3)
103
111
  activesupport (>= 4.2.0)
104
112
  nokogiri (>= 1.6)
105
- rails-html-sanitizer (1.0.3)
106
- loofah (~> 2.0)
107
- railties (5.0.6)
108
- actionpack (= 5.0.6)
109
- activesupport (= 5.0.6)
113
+ rails-html-sanitizer (1.0.4)
114
+ loofah (~> 2.2, >= 2.2.2)
115
+ railties (5.2.0.rc2)
116
+ actionpack (= 5.2.0.rc2)
117
+ activesupport (= 5.2.0.rc2)
110
118
  method_source
111
119
  rake (>= 0.8.7)
112
120
  thor (>= 0.18.1, < 2.0)
113
- rake (12.3.0)
114
- request_store (1.3.2)
121
+ rake (12.3.1)
122
+ request_store (1.4.1)
123
+ rack (>= 1.4)
115
124
  rspec (3.7.0)
116
125
  rspec-core (~> 3.7.0)
117
126
  rspec-expectations (~> 3.7.0)
118
127
  rspec-mocks (~> 3.7.0)
119
- rspec-core (3.7.0)
128
+ rspec-core (3.7.1)
120
129
  rspec-support (~> 3.7.0)
121
130
  rspec-expectations (3.7.0)
122
131
  diff-lcs (>= 1.2.0, < 2.0)
@@ -124,7 +133,7 @@ GEM
124
133
  rspec-mocks (3.7.0)
125
134
  diff-lcs (>= 1.2.0, < 2.0)
126
135
  rspec-support (~> 3.7.0)
127
- rspec-support (3.7.0)
136
+ rspec-support (3.7.1)
128
137
  sprockets (3.7.1)
129
138
  concurrent-ruby (~> 1.0)
130
139
  rack (> 1, < 3)
@@ -135,9 +144,9 @@ GEM
135
144
  sqlite3 (1.3.13)
136
145
  thor (0.20.0)
137
146
  thread_safe (0.3.6)
138
- tzinfo (1.2.4)
147
+ tzinfo (1.2.5)
139
148
  thread_safe (~> 0.1)
140
- websocket-driver (0.6.5)
149
+ websocket-driver (0.7.0)
141
150
  websocket-extensions (>= 0.1.0)
142
151
  websocket-extensions (0.1.3)
143
152
 
@@ -151,10 +160,10 @@ DEPENDENCIES
151
160
  generator_spec (~> 0.9.3)
152
161
  pry
153
162
  pry-byebug
154
- rails (>= 5.0, < 5.1)
163
+ rails (>= 5.2.0.rc2, < 5.3)
155
164
  rake
156
165
  rspec (~> 3.0)
157
166
  sqlite3
158
167
 
159
168
  BUNDLED WITH
160
- 1.16.0
169
+ 1.16.1
data/README.md CHANGED
@@ -16,7 +16,7 @@ Installation
16
16
  Add this line to your application's Gemfile:
17
17
 
18
18
  ```ruby
19
- gem 'friendly_id-mobility', '~> 0.5.3'
19
+ gem 'friendly_id-mobility', '~> 0.5.4'
20
20
  ```
21
21
 
22
22
  And then execute:
@@ -46,21 +46,19 @@ module FriendlyId
46
46
  end
47
47
 
48
48
  def should_generate_new_friendly_id?
49
- send(friendly_id_config.slug_column).nil?
49
+ send(friendly_id_config.slug_column, locale: ::Mobility.locale).nil?
50
50
  end
51
51
 
52
- include(Module.new do
53
- def set_slug(normalized_slug = nil)
54
- super
55
- changed.each do |change|
56
- if change =~ /\A#{friendly_id_config.base}_([a-z]{2}(_[a-z]{2})?)/
57
- locale, suffix = $1.split('_'.freeze)
58
- locale = "#{locale}-#{suffix.upcase}".freeze if suffix
59
- ::Mobility.with_locale(locale) { super }
60
- end
52
+ def set_slug(normalized_slug = nil)
53
+ super
54
+ changed.each do |change|
55
+ if change =~ /\A(?:#{friendly_id_config.base}|#{friendly_id_config.slug_column})_([a-z]{2}(_[a-z]{2})?)/
56
+ locale, suffix = $1.split('_'.freeze)
57
+ locale = "#{locale}-#{suffix.upcase}".freeze if suffix
58
+ ::Mobility.with_locale(locale) { super }
61
59
  end
62
60
  end
63
- end)
61
+ end
64
62
 
65
63
  module FinderMethods
66
64
  include ::FriendlyId::History::FinderMethods
@@ -1,5 +1,5 @@
1
1
  module FriendlyId
2
2
  module Mobility
3
- VERSION = "0.5.3"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_id-mobility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2018-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mobility
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.0
19
+ version: 0.5.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.3.0
29
+ version: 0.5.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.6.14
169
+ rubygems_version: 2.7.6
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Translate your FriendlyId slugs with Mobility.