Skip to content

Commit e7cc900

Browse files
authored
Merge pull request #165 from prograils/zeitwerk_compatibility
Remove Rails 5.1 Support. Add zeitwerk support
2 parents e03b3a4 + b7ac46d commit e7cc900

11 files changed

+186
-142
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
language: ruby
22
rvm:
3-
- 2.5.8
4-
- 2.6.6
3+
- 2.7.2
4+
- 3.0.0
55
gemfile:
6-
- gemfiles/rails_5.1.gemfile
76
- gemfiles/rails_5.2.gemfile
87
- gemfiles/rails_6.0.gemfile
8+
- gemfiles/rails_6.1.gemfile
99
services:
1010
- postgresql
1111
- redis-server

Appraisals

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
appraise 'rails-5.1' do
1+
appraise 'rails-5.2' do
22
source 'https://rubygems.org'
3-
gem 'rails', '~> 5.1.0'
3+
gem 'rails', '~> 5.2.0'
44
gem 'devise'
5-
gem 'pg', '~> 0.21.0'
5+
gem 'pg', '~> 1.1.3'
66
gem 'redis'
77
gem 'capybara'
88
gem 'database_cleaner'
@@ -17,11 +17,11 @@ appraise 'rails-5.1' do
1717
gem 'minitest'
1818
end
1919

20-
appraise 'rails-5.2' do
20+
appraise 'rails-6.0' do
2121
source 'https://rubygems.org'
22-
gem 'rails', '~> 5.2.0'
22+
gem 'rails', '~> 6.0.3'
2323
gem 'devise'
24-
gem 'pg', '~> 1.1.3'
24+
gem 'pg', '~> 1.1.4'
2525
gem 'redis'
2626
gem 'capybara'
2727
gem 'database_cleaner'
@@ -36,9 +36,9 @@ appraise 'rails-5.2' do
3636
gem 'minitest'
3737
end
3838

39-
appraise 'rails-6.0' do
39+
appraise 'rails-6.1' do
4040
source 'https://rubygems.org'
41-
gem 'rails', '~> 6.0.0.beta3'
41+
gem 'rails', '~> 6.1.3'
4242
gem 'devise'
4343
gem 'pg', '~> 1.1.4'
4444
gem 'redis'
@@ -53,4 +53,4 @@ appraise 'rails-6.0' do
5353
gem 'pry-rails'
5454
gem 'rails-controller-testing'
5555
gem 'minitest'
56-
end
56+
end

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ gem 'lit'
3737

3838
2. run `bundle install`
3939

40-
3. run installation generator `bundle exec rails g lit:install`
41-
(for production/staging environment `redis` is suggested as key value engine. `hash` will not work in multi process environment)
40+
3. Add `config.i18n.available_locales = [...]` to `application.rb` - it's required to precompile appropriate language flags in lit backend.
4241

43-
4. Add `config.i18n.available_locales = [...]` to `application.rb` - it's required to precompile appropriate language flags in lit backend.
42+
4. run installation generator `bundle exec rails g lit:install`
43+
(for production/staging environment `redis` is suggested as key value engine. `hash` will not work in multi process environment)
4444

4545
5. After doing above and restarting app, point your browser to `http://app/lit`
4646

@@ -145,10 +145,10 @@ These credentials can be given in three ways:
145145
... # see Google docs link above for reference
146146
}
147147
end
148-
148+
149149
# For example, for Rails 6, from encrypted credentials file (HashWithIndifferentAccess is used, because the keys in
150150
the credentials.config could be strings or, as well, symbols):
151-
151+
152152
Lit::CloudTranslation.configure do |config|
153153
config.keyfile_hash = HashWithIndifferentAccess.new(Rails.application.credentials.config[:google_translate_api])
154154
end
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
module Lit
2-
module Concerns
3-
module RequestInfoStore
4-
extend ::ActiveSupport::Concern
5-
included do
6-
before_action :store_request_path
7-
end
2+
module RequestInfoStore
3+
extend ::ActiveSupport::Concern
4+
included do
5+
before_action :store_request_path
6+
end
87

9-
private
8+
private
109

11-
def store_request_path
12-
Thread.current[:lit_current_request_path] = request&.path
13-
end
10+
def store_request_path
11+
Thread.current[:lit_current_request_path] = request&.path
1412
end
1513
end
1614
end
1715

16+
module Lit::Concerns::RequestInfoStore
17+
extend ActiveSupport::Concern
18+
19+
included do
20+
Rails.logger.info 'DEPRECATED: Use include Lit::RequestInfoStore'
21+
include Lit::RequestInfoStore
22+
end
23+
end
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
module Lit
2-
module Concerns
3-
module RequestKeysStore
4-
extend ::ActiveSupport::Concern
5-
included do
6-
before_action :init_request_keys
7-
end
2+
module RequestKeysStore
3+
extend ::ActiveSupport::Concern
4+
included do
5+
before_action :init_request_keys
6+
end
87

9-
private
8+
private
109

11-
def init_request_keys
12-
Thread.current[:lit_request_keys] = {}
13-
end
10+
def init_request_keys
11+
Thread.current[:lit_request_keys] = {}
1412
end
1513
end
1614
end
15+
16+
module Lit::Concerns::RequestKeysStore
17+
extend ActiveSupport::Concern
18+
19+
included do
20+
Rails.logger.info 'DEPRECATED: Use include Lit::RequestKeysStore'
21+
include Lit::RequestKeysStore
22+
end
23+
end

gemfiles/rails_5.2.gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,4 @@ DEPENDENCIES
267267
webmock
268268

269269
BUNDLED WITH
270-
1.17.3
270+
2.2.13

gemfiles/rails_6.0.gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 6.0.0.beta3"
5+
gem "rails", "~> 6.0.3"
66
gem "devise"
77
gem "pg", "~> 1.1.4"
88
gem "redis"

gemfiles/rails_6.0.gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ DEPENDENCIES
274274
pg (~> 1.1.4)
275275
pry-byebug (~> 3.9.0)
276276
pry-rails
277-
rails (~> 6.0.0.beta3)
277+
rails (~> 6.0.3)
278278
rails-controller-testing
279279
redis
280280
sass-rails
@@ -283,4 +283,4 @@ DEPENDENCIES
283283
webmock
284284

285285
BUNDLED WITH
286-
1.17.3
286+
2.2.13

gemfiles/rails_5.1.gemfile gemfiles/rails_6.1.gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
source "https://rubygems.org"
44

5-
gem "rails", "~> 5.1.0"
5+
gem "rails", "~> 6.1.3"
66
gem "devise"
7-
gem "pg", "~> 0.21.0"
7+
gem "pg", "~> 1.1.4"
88
gem "redis"
99
gem "capybara"
1010
gem "database_cleaner"

0 commit comments

Comments
 (0)