i18n_helper 0.0.3 → 0.0.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
2
  SHA1:
3
- metadata.gz: 707b399d0ee9b26a6e4fa6d34878e86df21a9793
4
- data.tar.gz: 1f881ae6d572712eeeafb2364fe2b1b3fe4cf1f9
3
+ metadata.gz: 459428248d080b68b903be47e76409adda393316
4
+ data.tar.gz: 5bb8d6aaae87d3f5de5591e6ed6684949428925d
5
5
  SHA512:
6
- metadata.gz: 3e5c321567c7979da97b7771a148c979263317251875156a45a288ddb693a88fd020acfa62379582f78a418be437348325963f614723b851a3676af5a2bc8173
7
- data.tar.gz: 7880cb4812205c45f14e97e0c764508b30344cd34d10e8a614aec32981b07e49387f049a3583e0728c8db0f749450d708b1322aa9098b13deb6198ae8f7e2bf7
6
+ metadata.gz: baaf8c3ea63d8e4f4191eb469d9fb1737864705905e4cf7d8572a0b4beb41bedf9b9c8cde99847e9c4678b3a850a828d84e388c8311178d4611add7dc8444913
7
+ data.tar.gz: 3f77ce5c5e5a92482b57edea51d5045791d2b070b7795d568f0d43f4dc828490eb6055cf3772e24c18d79470f27465f6f44d7f36149e03761d837514ca2d99c2
@@ -0,0 +1 @@
1
+ i18n_helper
@@ -0,0 +1 @@
1
+ 2.2.3
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
3
+ - 2.2.3
4
4
  env:
5
5
  - RAILS_ENV=test
6
6
  script: bundle exec rspec spec
@@ -1,3 +1,8 @@
1
+ ### VERSION 0.0.4
2
+
3
+ * refactoring
4
+ * Remove hard coded callbacks
5
+
1
6
  ### VERSION 0.0.3
2
7
 
3
8
  * bug fix
@@ -1,140 +1,163 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n_helper (0.0.3)
4
+ i18n_helper (0.0.4)
5
5
  i18n-language-translations (~> 0.0)
6
- rails (~> 4.1)
6
+ rails (~> 4.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionmailer (4.1.5)
12
- actionpack (= 4.1.5)
13
- actionview (= 4.1.5)
14
- mail (~> 2.5.4)
15
- actionpack (4.1.5)
16
- actionview (= 4.1.5)
17
- activesupport (= 4.1.5)
18
- rack (~> 1.5.2)
11
+ actionmailer (4.2.4)
12
+ actionpack (= 4.2.4)
13
+ actionview (= 4.2.4)
14
+ activejob (= 4.2.4)
15
+ mail (~> 2.5, >= 2.5.4)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ actionpack (4.2.4)
18
+ actionview (= 4.2.4)
19
+ activesupport (= 4.2.4)
20
+ rack (~> 1.6)
19
21
  rack-test (~> 0.6.2)
20
- actionview (4.1.5)
21
- activesupport (= 4.1.5)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ actionview (4.2.4)
25
+ activesupport (= 4.2.4)
22
26
  builder (~> 3.1)
23
27
  erubis (~> 2.7.0)
24
- activemodel (4.1.5)
25
- activesupport (= 4.1.5)
28
+ rails-dom-testing (~> 1.0, >= 1.0.5)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
+ activejob (4.2.4)
31
+ activesupport (= 4.2.4)
32
+ globalid (>= 0.3.0)
33
+ activemodel (4.2.4)
34
+ activesupport (= 4.2.4)
26
35
  builder (~> 3.1)
27
- activerecord (4.1.5)
28
- activemodel (= 4.1.5)
29
- activesupport (= 4.1.5)
30
- arel (~> 5.0.0)
31
- activesupport (4.1.5)
32
- i18n (~> 0.6, >= 0.6.9)
36
+ activerecord (4.2.4)
37
+ activemodel (= 4.2.4)
38
+ activesupport (= 4.2.4)
39
+ arel (~> 6.0)
40
+ activesupport (4.2.4)
41
+ i18n (~> 0.7)
33
42
  json (~> 1.7, >= 1.7.7)
34
43
  minitest (~> 5.1)
35
- thread_safe (~> 0.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
36
45
  tzinfo (~> 1.1)
37
- arel (5.0.1.20140414130214)
46
+ arel (6.0.3)
38
47
  builder (3.2.2)
39
- coveralls (0.7.1)
40
- multi_json (~> 1.3)
41
- rest-client
42
- simplecov (>= 0.7)
43
- term-ansicolor
44
- thor
48
+ coveralls (0.8.2)
49
+ json (~> 1.8)
50
+ rest-client (>= 1.6.8, < 2)
51
+ simplecov (~> 0.10.0)
52
+ term-ansicolor (~> 1.3)
53
+ thor (~> 0.19.1)
45
54
  diff-lcs (1.2.5)
46
55
  docile (1.1.5)
56
+ domain_name (0.5.24)
57
+ unf (>= 0.0.5, < 1.0.0)
47
58
  erubis (2.7.0)
48
- factory_girl (4.4.0)
59
+ factory_girl (4.5.0)
49
60
  activesupport (>= 3.0.0)
50
- factory_girl_rails (4.4.1)
51
- factory_girl (~> 4.4.0)
61
+ factory_girl_rails (4.5.0)
62
+ factory_girl (~> 4.5.0)
52
63
  railties (>= 3.0.0)
53
- gemnasium (3.2.0)
54
- hike (1.2.3)
55
- i18n (0.6.11)
64
+ gemnasium (3.2.1)
65
+ globalid (0.3.6)
66
+ activesupport (>= 4.1.0)
67
+ http-cookie (1.0.2)
68
+ domain_name (~> 0.5)
69
+ i18n (0.7.0)
56
70
  i18n-language-translations (0.0.2)
57
71
  i18n (~> 0.5)
58
72
  railties (>= 3.0.0)
59
- json (1.8.1)
60
- mail (2.5.4)
61
- mime-types (~> 1.16)
62
- treetop (~> 1.4.8)
63
- mime-types (1.25.1)
64
- minitest (5.4.0)
65
- multi_json (1.10.1)
66
- netrc (0.7.7)
67
- polyglot (0.3.5)
68
- rack (1.5.2)
69
- rack-test (0.6.2)
73
+ json (1.8.3)
74
+ loofah (2.0.3)
75
+ nokogiri (>= 1.5.9)
76
+ mail (2.6.3)
77
+ mime-types (>= 1.16, < 3)
78
+ mime-types (2.6.2)
79
+ mini_portile (0.6.2)
80
+ minitest (5.8.0)
81
+ netrc (0.10.3)
82
+ nokogiri (1.6.6.2)
83
+ mini_portile (~> 0.6.0)
84
+ rack (1.6.4)
85
+ rack-test (0.6.3)
70
86
  rack (>= 1.0)
71
- rails (4.1.5)
72
- actionmailer (= 4.1.5)
73
- actionpack (= 4.1.5)
74
- actionview (= 4.1.5)
75
- activemodel (= 4.1.5)
76
- activerecord (= 4.1.5)
77
- activesupport (= 4.1.5)
87
+ rails (4.2.4)
88
+ actionmailer (= 4.2.4)
89
+ actionpack (= 4.2.4)
90
+ actionview (= 4.2.4)
91
+ activejob (= 4.2.4)
92
+ activemodel (= 4.2.4)
93
+ activerecord (= 4.2.4)
94
+ activesupport (= 4.2.4)
78
95
  bundler (>= 1.3.0, < 2.0)
79
- railties (= 4.1.5)
80
- sprockets-rails (~> 2.0)
81
- railties (4.1.5)
82
- actionpack (= 4.1.5)
83
- activesupport (= 4.1.5)
96
+ railties (= 4.2.4)
97
+ sprockets-rails
98
+ rails-deprecated_sanitizer (1.0.3)
99
+ activesupport (>= 4.2.0.alpha)
100
+ rails-dom-testing (1.0.7)
101
+ activesupport (>= 4.2.0.beta, < 5.0)
102
+ nokogiri (~> 1.6.0)
103
+ rails-deprecated_sanitizer (>= 1.0.1)
104
+ rails-html-sanitizer (1.0.2)
105
+ loofah (~> 2.0)
106
+ railties (4.2.4)
107
+ actionpack (= 4.2.4)
108
+ activesupport (= 4.2.4)
84
109
  rake (>= 0.8.7)
85
110
  thor (>= 0.18.1, < 2.0)
86
- rake (10.3.2)
87
- rest-client (1.7.2)
111
+ rake (10.4.2)
112
+ rest-client (1.8.0)
113
+ http-cookie (>= 1.0.2, < 2.0)
88
114
  mime-types (>= 1.16, < 3.0)
89
115
  netrc (~> 0.7)
90
- rspec-core (3.0.4)
91
- rspec-support (~> 3.0.0)
92
- rspec-expectations (3.0.4)
116
+ rspec-core (3.3.2)
117
+ rspec-support (~> 3.3.0)
118
+ rspec-expectations (3.3.1)
93
119
  diff-lcs (>= 1.2.0, < 2.0)
94
- rspec-support (~> 3.0.0)
95
- rspec-mocks (3.0.4)
96
- rspec-support (~> 3.0.0)
97
- rspec-rails (3.0.2)
98
- actionpack (>= 3.0)
99
- activesupport (>= 3.0)
100
- railties (>= 3.0)
101
- rspec-core (~> 3.0.0)
102
- rspec-expectations (~> 3.0.0)
103
- rspec-mocks (~> 3.0.0)
104
- rspec-support (~> 3.0.0)
105
- rspec-support (3.0.4)
106
- simplecov (0.9.0)
120
+ rspec-support (~> 3.3.0)
121
+ rspec-mocks (3.3.2)
122
+ diff-lcs (>= 1.2.0, < 2.0)
123
+ rspec-support (~> 3.3.0)
124
+ rspec-rails (3.3.3)
125
+ actionpack (>= 3.0, < 4.3)
126
+ activesupport (>= 3.0, < 4.3)
127
+ railties (>= 3.0, < 4.3)
128
+ rspec-core (~> 3.3.0)
129
+ rspec-expectations (~> 3.3.0)
130
+ rspec-mocks (~> 3.3.0)
131
+ rspec-support (~> 3.3.0)
132
+ rspec-support (3.3.0)
133
+ simplecov (0.10.0)
107
134
  docile (~> 1.1.0)
108
- multi_json
109
- simplecov-html (~> 0.8.0)
110
- simplecov-html (0.8.0)
111
- sprockets (2.12.1)
112
- hike (~> 1.2)
113
- multi_json (~> 1.0)
135
+ json (~> 1.8)
136
+ simplecov-html (~> 0.10.0)
137
+ simplecov-html (0.10.0)
138
+ sprockets (3.3.4)
114
139
  rack (~> 1.0)
115
- tilt (~> 1.1, != 1.3.0)
116
- sprockets-rails (2.1.3)
140
+ sprockets-rails (2.3.3)
117
141
  actionpack (>= 3.0)
118
142
  activesupport (>= 3.0)
119
- sprockets (~> 2.8)
120
- term-ansicolor (1.3.0)
143
+ sprockets (>= 2.8, < 4.0)
144
+ term-ansicolor (1.3.2)
121
145
  tins (~> 1.0)
122
146
  thor (0.19.1)
123
- thread_safe (0.3.4)
124
- tilt (1.4.1)
125
- tins (1.3.2)
126
- treetop (1.4.15)
127
- polyglot
128
- polyglot (>= 0.3.1)
147
+ thread_safe (0.3.5)
148
+ tins (1.6.0)
129
149
  tzinfo (1.2.2)
130
150
  thread_safe (~> 0.1)
151
+ unf (0.1.4)
152
+ unf_ext
153
+ unf_ext (0.0.7.1)
131
154
 
132
155
  PLATFORMS
133
156
  ruby
134
157
 
135
158
  DEPENDENCIES
136
- coveralls (~> 0.7)
159
+ coveralls (~> 0.8)
137
160
  factory_girl_rails (~> 4.4)
138
161
  gemnasium (~> 3.2)
139
162
  i18n_helper!
140
- rspec-rails (~> 3.0)
163
+ rspec-rails (~> 3.2)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Build Status](https://travis-ci.org/joel/i18n_helper.png?branch=master)](https://travis-ci.org/joel/i18n_helper) (Travis CI)
6
6
 
7
- [![Coverage Status](https://coveralls.io/repos/joel/i18n_helper/badge.png)](https://coveralls.io/r/joel/i18n_helper)
7
+ [![Coverage Status](https://coveralls.io/repos/joel/i18n_helper/badge.png?branch=master)](https://coveralls.io/r/joel/i18n_helper)
8
8
 
9
9
  [![Gem Version](https://badge.fury.io/rb/i18n_helper.png)](http://badge.fury.io/rb/i18n_helper)
10
10
 
@@ -14,6 +14,24 @@ This is a really straightforward I18n locales helper. It can you help to change
14
14
 
15
15
  ![Screenshot](https://f.cloud.github.com/assets/5789/1832468/0ad6491c-73b6-11e3-8f14-3358168ed5ff.png)
16
16
 
17
+ # add callbacks
18
+
19
+ If we need to add or skip some callbacks, often skip authentication you can add a initializer on your mother app
20
+
21
+ Add `config/initializers/locales.rb`
22
+
23
+ ```
24
+ module LocalesControllerCallbacks
25
+ extend ActiveSupport::Concern
26
+
27
+ included do
28
+ skip_before_action :authenticate_user!
29
+ end
30
+ end
31
+
32
+ LocalesController.send(:include, LocalesControllerCallbacks)
33
+ ```
34
+
17
35
  ## Features
18
36
 
19
37
  The locale of app is recorded on current session.
@@ -56,4 +74,4 @@ If you use an authentication system, like ```Devise```, and your ```User model``
56
74
  2. Create your feature branch (`git checkout -b my-new-feature`)
57
75
  3. Commit your changes (`git commit -am 'Added some feature'`)
58
76
  4. Push to the branch (`git push origin my-new-feature`)
59
- 5. Create new Pull Request
77
+ 5. Create new Pull Request
@@ -0,0 +1,19 @@
1
+ ### VERSION 0.0.3 => 0.0.4
2
+
3
+ If you use Devise of callback named verify_authenticity_token we need to add a initializers like
4
+
5
+ Add `config/initializers/locales.rb`
6
+
7
+ ```
8
+ module LocalesControllerCallbacks
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ skip_before_action :verify_authenticity_token
13
+ end
14
+ end
15
+
16
+ LocalesController.send(:include, LocalesControllerCallbacks)
17
+ ```
18
+
19
+ Otherwise is ok.
@@ -1,7 +1,5 @@
1
1
  class LocalesController < ApplicationController
2
2
 
3
- skip_before_action :verify_authenticity_token
4
-
5
3
  def setting
6
4
  if params[:locale] and I18n.available_locales.include?(params[:locale].to_sym)
7
5
  session[:locale] = params[:locale]
@@ -22,15 +22,15 @@ Gem::Specification.new do |s|
22
22
 
23
23
  # s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.rdoc']
24
24
 
25
- s.add_dependency 'rails', '~> 4.1'
25
+ s.add_dependency 'rails', '~> 4.2'
26
26
  s.add_dependency 'i18n-language-translations', '~> 0.0' # 0.0.2 actual
27
27
 
28
- s.add_development_dependency 'rspec-rails', '~> 3.0'
28
+ s.add_development_dependency 'rspec-rails', '~> 3.2'
29
29
  s.add_development_dependency 'factory_girl_rails', '~> 4.4'
30
30
  s.add_development_dependency 'gemnasium', '~> 3.2'
31
- s.add_development_dependency 'coveralls', '~> 0.7'
31
+ s.add_development_dependency 'coveralls', '~> 0.8'
32
32
 
33
- s.required_ruby_version = '~> 2.0'
33
+ s.required_ruby_version = '~> 2.2'
34
34
 
35
35
  s.test_files = Dir['spec/**/*']
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module I18nHelper
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -54,8 +54,8 @@ describe LocalesHelper do
54
54
  context 'en' do
55
55
  let(:data) do
56
56
  [
57
- "<a data-method=\"post\" href=\"/locales/en\" rel=\"nofollow\">English</a>",
58
- "<a data-method=\"post\" href=\"/locales/fr\" rel=\"nofollow\">French</a>"
57
+ "<a rel=\"nofollow\" data-method=\"post\" href=\"/locales/en\">English</a>",
58
+ "<a rel=\"nofollow\" data-method=\"post\" href=\"/locales/fr\">French</a>"
59
59
  ]
60
60
  end
61
61
  it do
@@ -67,4 +67,4 @@ describe LocalesHelper do
67
67
 
68
68
  end
69
69
 
70
- end
70
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel AZEMAR
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.1'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.1'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: i18n-language-translations
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '3.2'
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: '3.0'
54
+ version: '3.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: factory_girl_rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.7'
89
+ version: '0.8'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.7'
96
+ version: '0.8'
97
97
  description: Description of I18nHelper.
98
98
  email:
99
99
  - joel.azemar@gmail.com
@@ -106,6 +106,8 @@ files:
106
106
  - ".coveralls.yml"
107
107
  - ".gitignore"
108
108
  - ".rspec"
109
+ - ".ruby-gemset"
110
+ - ".ruby-version"
109
111
  - ".travis.yml"
110
112
  - CHANGELOG.md
111
113
  - Gemfile
@@ -113,6 +115,7 @@ files:
113
115
  - MIT-LICENSE
114
116
  - README.md
115
117
  - Rakefile
118
+ - UPGRADE.md
116
119
  - app/controllers/.keep
117
120
  - app/controllers/locales_controller.rb
118
121
  - app/helpers/.keep
@@ -181,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
184
  requirements:
182
185
  - - "~>"
183
186
  - !ruby/object:Gem::Version
184
- version: '2.0'
187
+ version: '2.2'
185
188
  required_rubygems_version: !ruby/object:Gem::Requirement
186
189
  requirements:
187
190
  - - ">="
@@ -189,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
192
  version: '0'
190
193
  requirements: []
191
194
  rubyforge_project:
192
- rubygems_version: 2.2.2
195
+ rubygems_version: 2.4.5.1
193
196
  signing_key:
194
197
  specification_version: 4
195
198
  summary: Summary of I18nHelper.