From b503a7c5fa75e15690cc4d7e252624fad0a7ed1a Mon Sep 17 00:00:00 2001 From: Todd Hambley Date: Tue, 8 Oct 2019 12:33:02 -0400 Subject: [PATCH 1/5] fix gem dependency and test --- gemfiles/rails_52.gemfile | 1 + gemfiles/rails_60.gemfile | 1 + spec/xls/unit/resource_controller_spec.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gemfiles/rails_52.gemfile b/gemfiles/rails_52.gemfile index 3387ad4..b260d2a 100644 --- a/gemfiles/rails_52.gemfile +++ b/gemfiles/rails_52.gemfile @@ -7,6 +7,7 @@ ruby_minor_version = RUBY_VERSION.split('.')[1].to_i eval_gemfile(File.expand_path(File.join('..', 'Gemfile'), __dir__)) gem 'activeadmin', '2.4.0' +gem 'bootsnap', require: false gem 'devise', '~> 4.7' gem 'rails', ' ~> 5.2' gem 'turbolinks', '~> 5.2.0' diff --git a/gemfiles/rails_60.gemfile b/gemfiles/rails_60.gemfile index 70fd83a..054f3b0 100644 --- a/gemfiles/rails_60.gemfile +++ b/gemfiles/rails_60.gemfile @@ -7,6 +7,7 @@ ruby_minor_version = RUBY_VERSION.split('.')[1].to_i eval_gemfile(File.expand_path(File.join('..', 'Gemfile'), __dir__)) gem 'activeadmin', '2.4.0' +gem 'bootsnap', require: false gem 'devise', '~> 4.7' gem 'rails', '~> 6' gem 'turbolinks', '~> 5.2.0' diff --git a/spec/xls/unit/resource_controller_spec.rb b/spec/xls/unit/resource_controller_spec.rb index 57181a3..22a91fb 100644 --- a/spec/xls/unit/resource_controller_spec.rb +++ b/spec/xls/unit/resource_controller_spec.rb @@ -3,7 +3,7 @@ let(:mime) { Mime::Type.lookup_by_extension(:xls) } let(:filename) do - "#{controller.resource_class.to_s.downcase.pluralize}-#{Time.now.strftime('%Y-%m-%d')}.xls" + "categories-#{Time.now.strftime('%Y-%m-%d')}.xls" end it 'generates an xls filename' do From 7770549eecd075e7026d8a6a1f1d62e335ed8e06 Mon Sep 17 00:00:00 2001 From: Todd Hambley Date: Tue, 8 Oct 2019 14:23:49 -0400 Subject: [PATCH 2/5] move sqlite dependency to rails gemfiles --- Gemfile | 3 +-- gemfiles/rails_42.gemfile | 1 + gemfiles/rails_52.gemfile | 1 + gemfiles/rails_60.gemfile | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index fc6382e..64acb36 100644 --- a/Gemfile +++ b/Gemfile @@ -4,15 +4,14 @@ gem 'spreadsheet', '~> 1.1', '>= 1.1.4' group :development, :test do gem 'rails-i18n' # Gives us default i18n for many languages - gem 'sqlite3', '~> 1.3.0' gem 'yard' end group :test do + gem 'codecov', require: false gem 'cucumber-rails', require: false gem 'database_cleaner' gem 'rspec-mocks', '~> 3.7' gem 'rspec-rails', '~> 3.7' gem 'simplecov', require: false - gem 'codecov', require: false end diff --git a/gemfiles/rails_42.gemfile b/gemfiles/rails_42.gemfile index 54026b2..8cbdf17 100644 --- a/gemfiles/rails_42.gemfile +++ b/gemfiles/rails_42.gemfile @@ -9,6 +9,7 @@ eval_gemfile(File.expand_path(File.join('..', 'Gemfile'), __dir__)) gem 'activeadmin', '1.2.1' gem 'devise', '~> 4.2' gem 'rails', '4.2.10' +gem 'sqlite3', '~> 1.3.0' gem 'turbolinks', '~> 5.0.0' gem 'tzinfo-data' diff --git a/gemfiles/rails_52.gemfile b/gemfiles/rails_52.gemfile index b260d2a..21eff9d 100644 --- a/gemfiles/rails_52.gemfile +++ b/gemfiles/rails_52.gemfile @@ -10,6 +10,7 @@ gem 'activeadmin', '2.4.0' gem 'bootsnap', require: false gem 'devise', '~> 4.7' gem 'rails', ' ~> 5.2' +gem 'sqlite3', '~> 1.4.0' gem 'turbolinks', '~> 5.2.0' gem 'tzinfo-data' diff --git a/gemfiles/rails_60.gemfile b/gemfiles/rails_60.gemfile index 054f3b0..893d21a 100644 --- a/gemfiles/rails_60.gemfile +++ b/gemfiles/rails_60.gemfile @@ -10,6 +10,7 @@ gem 'activeadmin', '2.4.0' gem 'bootsnap', require: false gem 'devise', '~> 4.7' gem 'rails', '~> 6' +gem 'sqlite3', '~> 1.4.0' gem 'turbolinks', '~> 5.2.0' gem 'tzinfo-data' From 26cb718b7933a75a6843823ee79611c9eada462d Mon Sep 17 00:00:00 2001 From: Todd Hambley Date: Tue, 8 Oct 2019 14:24:15 -0400 Subject: [PATCH 3/5] update readme test instructions --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f7cd668..13ccb4e 100644 --- a/README.md +++ b/README.md @@ -146,18 +146,18 @@ BUNDLE_GEMFILE=gemfiles/rails_42.gemfile bundle exec rake setup BUNDLE_GEMFILE=gemfiles/rails_42.gemfile bundle exec rake ``` -### Rails 5.1 +### Rails 5.2 ```text -bundle install --gemfile=gemfiles/rails_51.gemfile +bundle install --gemfile=gemfiles/rails_52.gemfile ``` ```text -BUNDLE_GEMFILE=gemfiles/rails_51.gemfile bundle exec rake setup +BUNDLE_GEMFILE=gemfiles/rails_52.gemfile bundle exec rake setup ``` ```text -BUNDLE_GEMFILE=gemfiles/rails_51.gemfile bundle exec rake +BUNDLE_GEMFILE=gemfiles/rails_52.gemfile bundle exec rake ``` [Active Admin]:https://www.activeadmin.info/ From 6b69dd64e9529b75192765420dcdfd6ab0cc9f7a Mon Sep 17 00:00:00 2001 From: Todd Hambley Date: Tue, 8 Oct 2019 14:45:13 -0400 Subject: [PATCH 4/5] fix rails 6 test --- gemfiles/rails_60.gemfile | 1 + spec/xls/unit/resource_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gemfiles/rails_60.gemfile b/gemfiles/rails_60.gemfile index 893d21a..dbc187e 100644 --- a/gemfiles/rails_60.gemfile +++ b/gemfiles/rails_60.gemfile @@ -13,6 +13,7 @@ gem 'rails', '~> 6' gem 'sqlite3', '~> 1.4.0' gem 'turbolinks', '~> 5.2.0' gem 'tzinfo-data' +gem 'webpacker', '~> 4.x' group :test do gem 'shoulda-matchers', '~> 3.1' diff --git a/spec/xls/unit/resource_controller_spec.rb b/spec/xls/unit/resource_controller_spec.rb index 22a91fb..c38f580 100644 --- a/spec/xls/unit/resource_controller_spec.rb +++ b/spec/xls/unit/resource_controller_spec.rb @@ -15,7 +15,7 @@ request.accept = mime get :index disposition = "attachment; filename=\"#{filename}\"" - expect(response.headers['Content-Disposition']).to eq(disposition) + expect(response.headers['Content-Disposition']).to start_with(disposition) expect(response.headers['Content-Transfer-Encoding']).to eq('binary') end end From 21922af14b5f3fd5745acafe09c088d044a9f5c7 Mon Sep 17 00:00:00 2001 From: Todd Hambley Date: Tue, 8 Oct 2019 15:29:51 -0400 Subject: [PATCH 5/5] update rails 4.2 gemfile to latest supported --- gemfiles/rails_42.gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/rails_42.gemfile b/gemfiles/rails_42.gemfile index 8cbdf17..a966565 100644 --- a/gemfiles/rails_42.gemfile +++ b/gemfiles/rails_42.gemfile @@ -6,9 +6,9 @@ ruby_minor_version = RUBY_VERSION.split('.')[1].to_i eval_gemfile(File.expand_path(File.join('..', 'Gemfile'), __dir__)) -gem 'activeadmin', '1.2.1' +gem 'activeadmin', '1.4.3' gem 'devise', '~> 4.2' -gem 'rails', '4.2.10' +gem 'rails', '4.2.11' gem 'sqlite3', '~> 1.3.0' gem 'turbolinks', '~> 5.0.0' gem 'tzinfo-data'