From e92ce704b9b695940185639f40dc313c1990f7c4 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Sun, 29 May 2022 13:35:27 -0700 Subject: [PATCH 01/11] Remove rails dependency Still haven't gotten bundle install working --- Gemfile | 2 +- Gemfile.lock | 0 rails_db.gemspec | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile index 0af694e..35e076e 100755 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gemspec -gem 'rails' +# gem 'rails' gem 'terminal-table' gem 'simple_form', '>= 5.0.1' gem 'ransack', '>= 2.3.2' diff --git a/Gemfile.lock b/Gemfile.lock old mode 100755 new mode 100644 diff --git a/rails_db.gemspec b/rails_db.gemspec index 7307e28..0a38d95 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.executables = ["railsdb", "rails_db", 'runsql'] - s.add_dependency 'rails', ">= 5.0.0" + # s.add_dependency 'rails', ">= 5.0.0" s.add_dependency 'terminal-table' s.add_dependency 'simple_form', '>= 5.0.1' s.add_dependency 'activerecord' From 23800dc9b1043ab7eddfc0284113d4710074ad07 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 14:54:35 -0700 Subject: [PATCH 02/11] Initial commit, passes tests --- .gitignore | 2 + Gemfile | 39 +++--- Gemfile.lock | 211 ++++++++++++------------------- Rakefile | 7 +- bin/rails | 21 ++- config/manifest.js | 1 + lib/rails_db/version.rb | 2 +- rails_db.gemspec | 41 ++++-- test/dummy/config/application.rb | 20 ++- test/test_helper.rb | 2 +- 10 files changed, 184 insertions(+), 162 deletions(-) create mode 100644 config/manifest.js diff --git a/.gitignore b/.gitignore index 8f7c852..603d084 100755 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ test/standalone/db/*.sqlite3 test/standalone/db/*.sqlite3-journal test/standalone/log/*.log test/standalone/tmp/ + +Gemfile.lock \ No newline at end of file diff --git a/Gemfile b/Gemfile index 35e076e..bf1cada 100755 --- a/Gemfile +++ b/Gemfile @@ -2,25 +2,34 @@ source 'https://rubygems.org' gemspec +# NOTE: As a result of the gemspec, bundler reports duplicates: +# Your Gemfile lists the gem caxlsx_rails (>= 0) more than once. +# Your Gemfile lists the gem sqlite3 (~> 1.4) more than once. +# Your Gemfile lists the gem paranoia (>= 0) more than once. +# You should probably keep only one of them. +# Remove any duplicate entries and specify the gem only once (per group). +# - +# I believe the gemspec should take precedence. [nimmolo 2022-05-31] + # gem 'rails' -gem 'terminal-table' -gem 'simple_form', '>= 5.0.1' -gem 'ransack', '>= 2.3.2' -gem 'kaminari', '>= 0.17.0' +# gem 'terminal-table' +# gem 'simple_form', '>= 5.0.1' +# gem 'ransack', '>= 2.3.2' +# gem 'kaminari', '>= 0.17.0' # for Rails 5+ -gem 'rubyzip', '>= 1.2.1' -gem 'caxlsx' -gem 'caxlsx_rails' +# gem 'rubyzip', '>= 1.2.1' +# gem 'caxlsx' # For some reason, doesn't load from gemspec in Rails 6 +# gem 'caxlsx_rails' # For some reason, doesn't load from gemspec in Rails 6 -group :assets do - gem 'uglifier' -end +# group :assets do +# gem 'uglifier' # Needs to be in group :assets +# end -group :test do - gem "sqlite3", '~> 1.4' -end +# group :test do + # gem "sqlite3", '~> 1.4' +# end -gem 'will_paginate' +# gem 'will_paginate' -gem 'paranoia' \ No newline at end of file +# gem 'paranoia' diff --git a/Gemfile.lock b/Gemfile.lock index 05e40a2..69850f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,196 +1,160 @@ PATH remote: . specs: - rails_db (2.4.1) + rails_db (2.5.0) + actionmailer + actionpack activerecord kaminari - rails (>= 5.0.0) + railties + rake ransack (>= 2.3.2) + rubyzip (>= 1.2.1) simple_form (>= 5.0.1) + sprockets-rails terminal-table + uglifier GEM remote: https://rubygems.org/ specs: - actioncable (6.1.3.2) - actionpack (= 6.1.3.2) - activesupport (= 6.1.3.2) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.1.3.2) - actionpack (= 6.1.3.2) - activejob (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) - mail (>= 2.7.1) - actionmailer (6.1.3.2) - actionpack (= 6.1.3.2) - actionview (= 6.1.3.2) - activejob (= 6.1.3.2) - activesupport (= 6.1.3.2) + actionmailer (6.1.6) + actionpack (= 6.1.6) + actionview (= 6.1.6) + activejob (= 6.1.6) + activesupport (= 6.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.3.2) - actionview (= 6.1.3.2) - activesupport (= 6.1.3.2) + actionpack (6.1.6) + actionview (= 6.1.6) + activesupport (= 6.1.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.3.2) - actionpack (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) - nokogiri (>= 1.8.5) - actionview (6.1.3.2) - activesupport (= 6.1.3.2) + actionview (6.1.6) + activesupport (= 6.1.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.3.2) - activesupport (= 6.1.3.2) + activejob (6.1.6) + activesupport (= 6.1.6) globalid (>= 0.3.6) - activemodel (6.1.3.2) - activesupport (= 6.1.3.2) - activerecord (6.1.3.2) - activemodel (= 6.1.3.2) - activesupport (= 6.1.3.2) - activestorage (6.1.3.2) - actionpack (= 6.1.3.2) - activejob (= 6.1.3.2) - activerecord (= 6.1.3.2) - activesupport (= 6.1.3.2) - marcel (~> 1.0.0) - mini_mime (~> 1.0.2) - activesupport (6.1.3.2) + activemodel (6.1.6) + activesupport (= 6.1.6) + activerecord (6.1.6) + activemodel (= 6.1.6) + activesupport (= 6.1.6) + activesupport (6.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) builder (3.2.4) - caxlsx (3.1.0) + caxlsx (3.2.0) htmlentities (~> 4.3, >= 4.3.4) marcel (~> 1.0) nokogiri (~> 1.10, >= 1.10.4) rubyzip (>= 1.3.0, < 3) - caxlsx_rails (0.6.2) + caxlsx_rails (0.6.3) actionpack (>= 3.1) caxlsx (>= 3.0) coderay (1.1.3) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) crass (1.0.6) erubi (1.10.0) execjs (2.8.1) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.0.0) + activesupport (>= 5.0) htmlentities (4.3.4) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) - kaminari (1.2.1) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) launchy (2.5.0) addressable (~> 2.7) - loofah (2.10.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) method_source (1.0.0) - mime-types (2.99.3) - mini_mime (1.0.3) - mini_portile2 (2.5.3) - minitest (5.14.4) - mysql2 (0.3.20) - nio4r (2.5.7) - nokogiri (1.11.7) - mini_portile2 (~> 2.5.0) + mime-types (3.4.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2022.0105) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.15.0) + mysql2 (0.5.4) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - paranoia (2.4.3) - activerecord (>= 4.0, < 6.2) - pg (1.2.3) + paranoia (2.6.0) + activerecord (>= 5.1, < 7.1) + pg (1.3.5) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (4.0.6) - racc (1.5.2) - rack (2.2.3) + public_suffix (4.0.7) + racc (1.6.0) + rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.1.3.2) - actioncable (= 6.1.3.2) - actionmailbox (= 6.1.3.2) - actionmailer (= 6.1.3.2) - actionpack (= 6.1.3.2) - actiontext (= 6.1.3.2) - actionview (= 6.1.3.2) - activejob (= 6.1.3.2) - activemodel (= 6.1.3.2) - activerecord (= 6.1.3.2) - activestorage (= 6.1.3.2) - activesupport (= 6.1.3.2) - bundler (>= 1.15.0) - railties (= 6.1.3.2) - sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (6.1.3.2) - actionpack (= 6.1.3.2) - activesupport (= 6.1.3.2) + railties (6.1.6) + actionpack (= 6.1.6) + activesupport (= 6.1.6) method_source - rake (>= 0.8.7) + rake (>= 12.2) thor (~> 1.0) - rake (13.0.3) - ransack (2.4.2) - activerecord (>= 5.2.4) - activesupport (>= 5.2.4) + rake (13.0.6) + ransack (3.0.1) + activerecord (>= 6.0.4) + activesupport (>= 6.0.4) i18n - rubyzip (2.3.0) + rubyzip (2.3.2) simple_form (5.1.0) actionpack (>= 5.2) activemodel (>= 5.2) - sprockets (4.0.2) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.2) - terminal-table (3.0.1) + terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.1.0) + thor (1.2.1) tzinfo (2.0.4) concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.0.0) - websocket-driver (0.7.4) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - will_paginate (3.3.0) - zeitwerk (2.4.2) + unicode-display_width (2.1.0) + will_paginate (3.3.1) + zeitwerk (2.5.4) PLATFORMS ruby @@ -198,22 +162,15 @@ PLATFORMS DEPENDENCIES caxlsx caxlsx_rails - kaminari (>= 0.17.0) launchy - mime-types (< 3.0) - mysql2 (<= 0.3.20) + mime-types + mysql2 paranoia - pg + pg (>= 1.2.3) pry-rails - rails rails_db! - ransack (>= 2.3.2) - rubyzip (>= 1.2.1) - simple_form (>= 5.0.1) - sqlite3 (~> 1.4) - terminal-table - uglifier - will_paginate + sqlite3 (>= 1.4) + will_paginate (>= 3.1.0) BUNDLED WITH - 1.17.3 + 1.17.2 diff --git a/Rakefile b/Rakefile index 14c5057..d91cea8 100755 --- a/Rakefile +++ b/Rakefile @@ -15,11 +15,10 @@ RDoc::Task.new(:rdoc) do |rdoc| end APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) -load 'rails/tasks/engine.rake' - - -load 'rails/tasks/statistics.rake' +# these are not there... +# load 'rails/tasks/engine.rake' +# load 'rails/tasks/statistics.rake' Bundler::GemHelper.install_tasks diff --git a/bin/rails b/bin/rails index b97ae54..a80483f 100755 --- a/bin/rails +++ b/bin/rails @@ -8,5 +8,24 @@ ENGINE_PATH = File.expand_path('../../lib/rails_db/engine', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -require 'rails/all' +# require 'rails/all' +# To choose what Rails frameworks to load, and skip others: +# NOTE: Be sure this list reflects the same choices made in the gemspec +require 'rails' # NOTE: not 'rails/rails' or 'rails/all' +require 'active_model/railtie' +# require 'active_job/railtie' +require 'active_record/railtie' +# require 'active_storage/engine' +require 'action_controller/railtie' +require 'action_mailer/railtie' +# require 'action_mailbox/engine' +# require 'action_text/engine' +require 'action_view/railtie' +# require 'action_cable/engine' +require 'sprockets/railtie' +require 'rails/test_unit/railtie' + require 'rails/engine/commands' + +require 'caxlsx' +require 'caxlsx_rails' diff --git a/config/manifest.js b/config/manifest.js new file mode 100644 index 0000000..65db7d1 --- /dev/null +++ b/config/manifest.js @@ -0,0 +1 @@ +// Needed for sprockets-rails? diff --git a/lib/rails_db/version.rb b/lib/rails_db/version.rb index 67b48f5..07c4d14 100755 --- a/lib/rails_db/version.rb +++ b/lib/rails_db/version.rb @@ -1,3 +1,3 @@ module RailsDb - VERSION = "2.4.1" + VERSION = "2.5.0" end diff --git a/rails_db.gemspec b/rails_db.gemspec index 0a38d95..1349145 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -15,24 +15,41 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,lib,test}/**/*", "rails_db.gemspec", "Gemfile", "Gemfile.lock", "MIT-LICENSE", "Rakefile", "README.rdoc", "bin/rails_db", "bin/railsdb", "bin/runsql"] s.test_files = Dir["test/**/*"] - s.executables = ["railsdb", "rails_db", 'runsql'] + s.executables = ['railsdb', 'rails_db', 'runsql'] - # s.add_dependency 'rails', ">= 5.0.0" - s.add_dependency 'terminal-table' - s.add_dependency 'simple_form', '>= 5.0.1' + # s.add_dependency 'rails', '>= 5.0.0' + # To skip loading all of Rails, add the minimum gems separately. + # This helps users whose Rails apps are similarly configured. + # + # NOTE: We must require these separately also in + # * test/dummy/config/application.rb + # * bin/rails + # NOTE: Be sure no other gems list `rails` as a dependency in Gemfile.lock, + # or else all of Rails will load anyway. + s.add_dependency 'actionmailer' + s.add_dependency 'actionpack' s.add_dependency 'activerecord' - s.add_dependency 'ransack', '>= 2.3.2' + s.add_dependency 'railties' + s.add_dependency 'rake' + s.add_dependency 'kaminari' + s.add_dependency 'ransack', '>= 2.3.2' + s.add_dependency 'rubyzip', '>= 1.2.1' + s.add_dependency 'simple_form', '>= 5.0.1' + s.add_dependency 'sprockets-rails' + s.add_dependency 'terminal-table' + s.add_dependency 'uglifier' # was in gemfile group :assets - s.add_development_dependency "launchy" - s.add_development_dependency "sqlite3", '~> 1.4' - s.add_development_dependency "mysql2", '<= 0.3.20' - s.add_development_dependency "pg" - s.add_development_dependency "caxlsx_rails" - s.add_development_dependency 'will_paginate', '>= 3.1.0' - s.add_development_dependency 'mime-types', '< 3.0' + s.add_development_dependency 'caxlsx' # Needs to be required also + s.add_development_dependency 'caxlsx_rails' # Needs to be required also + s.add_development_dependency 'launchy' + s.add_development_dependency 'mime-types' #, '< 3.0' + s.add_development_dependency 'mysql2' #, '<= 0.3.20' s.add_development_dependency 'paranoia' + s.add_development_dependency 'pg', '>= 1.2.3' # '~> 1.2.3' s.add_development_dependency 'pry-rails' + s.add_development_dependency 'sqlite3', '>= 1.4' # '~> 1.4' + s.add_development_dependency 'will_paginate', '>= 3.1.0' # s.add_development_dependency 'populator' # s.add_development_dependency 'faker' # s.add_development_dependency 'pry' diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index d321b31..ae22724 100755 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,6 +1,24 @@ require File.expand_path('../boot', __FILE__) -require 'rails/all' +# require 'rails/all' +# To choose what Rails frameworks to load, and skip others: +# NOTE: Be sure this list reflects the same choices made in the gemspec +require 'rails' # NOTE: not 'rails/rails' or 'rails/all' +require 'active_model/railtie' +# require 'active_job/railtie' +require 'active_record/railtie' +# require 'active_storage/engine' +require 'action_controller/railtie' +require 'action_mailer/railtie' +# require 'action_mailbox/engine' +# require 'action_text/engine' +require 'action_view/railtie' +# require 'action_cable/engine' +require 'sprockets/railtie' +require 'rails/test_unit/railtie' + +require 'caxlsx' +require 'caxlsx_rails' Bundler.require(*Rails.groups) diff --git a/test/test_helper.rb b/test/test_helper.rb index 174f9ff..797bbb5 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,7 +9,7 @@ require "rails/test_help" puts "USING DB: #{RailsDb::Database.adapter.adapter_name}" -puts "USING Rails: #{Gem.loaded_specs['rails'].version}" +puts "USING Rails: #{Gem.loaded_specs['activerecord'].version}" # Filter out Minitest backtrace while allowing backtrace from other libraries # to be shown. From 0bfa56e81d3c9152d8de8fbed362641747f23c93 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 14:57:38 -0700 Subject: [PATCH 03/11] Modify notes --- rails_db.gemspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rails_db.gemspec b/rails_db.gemspec index 1349145..955624a 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -20,12 +20,12 @@ Gem::Specification.new do |s| # s.add_dependency 'rails', '>= 5.0.0' # To skip loading all of Rails, add the minimum gems separately. # This helps users whose Rails apps are similarly configured. + # NOTE: Be sure no other dependencies list `rails` as a dependency + # (check Gemfile.lock) or else all of Rails will load anyway. # - # NOTE: We must require these separately also in - # * test/dummy/config/application.rb - # * bin/rails - # NOTE: Be sure no other gems list `rails` as a dependency in Gemfile.lock, - # or else all of Rails will load anyway. + # NOTE: The following Rails component classes must also be required in + # * rails_db/test/dummy/config/application.rb + # * rails_db/bin/rails s.add_dependency 'actionmailer' s.add_dependency 'actionpack' s.add_dependency 'activerecord' From 7bb3667b3e5f69d89e23539a506e148ce04fd03c Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 15:54:57 -0700 Subject: [PATCH 04/11] Cleanup --- .gitignore | 1 - Gemfile | 32 -------------------------------- Rakefile | 2 +- bin/rails | 1 - test/dummy/config/application.rb | 1 - 5 files changed, 1 insertion(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 603d084..e74d32b 100755 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,4 @@ test/standalone/db/*.sqlite3 test/standalone/db/*.sqlite3-journal test/standalone/log/*.log test/standalone/tmp/ - Gemfile.lock \ No newline at end of file diff --git a/Gemfile b/Gemfile index bf1cada..fa75df1 100755 --- a/Gemfile +++ b/Gemfile @@ -1,35 +1,3 @@ source 'https://rubygems.org' gemspec - -# NOTE: As a result of the gemspec, bundler reports duplicates: -# Your Gemfile lists the gem caxlsx_rails (>= 0) more than once. -# Your Gemfile lists the gem sqlite3 (~> 1.4) more than once. -# Your Gemfile lists the gem paranoia (>= 0) more than once. -# You should probably keep only one of them. -# Remove any duplicate entries and specify the gem only once (per group). -# - -# I believe the gemspec should take precedence. [nimmolo 2022-05-31] - -# gem 'rails' -# gem 'terminal-table' -# gem 'simple_form', '>= 5.0.1' -# gem 'ransack', '>= 2.3.2' -# gem 'kaminari', '>= 0.17.0' - -# for Rails 5+ -# gem 'rubyzip', '>= 1.2.1' -# gem 'caxlsx' # For some reason, doesn't load from gemspec in Rails 6 -# gem 'caxlsx_rails' # For some reason, doesn't load from gemspec in Rails 6 - -# group :assets do -# gem 'uglifier' # Needs to be in group :assets -# end - -# group :test do - # gem "sqlite3", '~> 1.4' -# end - -# gem 'will_paginate' - -# gem 'paranoia' diff --git a/Rakefile b/Rakefile index d91cea8..5481378 100755 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ end APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) -# these are not there... +# FIXME: these directories/files are not present in the gem directory... # load 'rails/tasks/engine.rake' # load 'rails/tasks/statistics.rake' diff --git a/bin/rails b/bin/rails index a80483f..c8d62e5 100755 --- a/bin/rails +++ b/bin/rails @@ -8,7 +8,6 @@ ENGINE_PATH = File.expand_path('../../lib/rails_db/engine', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -# require 'rails/all' # To choose what Rails frameworks to load, and skip others: # NOTE: Be sure this list reflects the same choices made in the gemspec require 'rails' # NOTE: not 'rails/rails' or 'rails/all' diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index ae22724..69577b8 100755 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,6 +1,5 @@ require File.expand_path('../boot', __FILE__) -# require 'rails/all' # To choose what Rails frameworks to load, and skip others: # NOTE: Be sure this list reflects the same choices made in the gemspec require 'rails' # NOTE: not 'rails/rails' or 'rails/all' From dfd30a5fe28aa4ccb51628688670df5b487a2568 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 15:59:45 -0700 Subject: [PATCH 05/11] unlock gem pg version (to match master) --- Gemfile.lock | 2 +- rails_db.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 69850f8..3180278 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -166,7 +166,7 @@ DEPENDENCIES mime-types mysql2 paranoia - pg (>= 1.2.3) + pg pry-rails rails_db! sqlite3 (>= 1.4) diff --git a/rails_db.gemspec b/rails_db.gemspec index 955624a..9b9b949 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -46,7 +46,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'mime-types' #, '< 3.0' s.add_development_dependency 'mysql2' #, '<= 0.3.20' s.add_development_dependency 'paranoia' - s.add_development_dependency 'pg', '>= 1.2.3' # '~> 1.2.3' + s.add_development_dependency 'pg' #, '>= 1.2.3', '~> 1.2.3' s.add_development_dependency 'pry-rails' s.add_development_dependency 'sqlite3', '>= 1.4' # '~> 1.4' s.add_development_dependency 'will_paginate', '>= 3.1.0' From 3a434ebf768b672a9bf9119abbf128dacbd930d6 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 16:00:43 -0700 Subject: [PATCH 06/11] unlock gem version will_paginate to match master --- rails_db.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rails_db.gemspec b/rails_db.gemspec index 9b9b949..66c8846 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -49,7 +49,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'pg' #, '>= 1.2.3', '~> 1.2.3' s.add_development_dependency 'pry-rails' s.add_development_dependency 'sqlite3', '>= 1.4' # '~> 1.4' - s.add_development_dependency 'will_paginate', '>= 3.1.0' + s.add_development_dependency 'will_paginate' #, '>= 3.1.0' # s.add_development_dependency 'populator' # s.add_development_dependency 'faker' # s.add_development_dependency 'pry' From 4accd5833a6586f825c4a160b98ce28cb77dad43 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 16:01:31 -0700 Subject: [PATCH 07/11] Update Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3180278..d69fbbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ DEPENDENCIES pry-rails rails_db! sqlite3 (>= 1.4) - will_paginate (>= 3.1.0) + will_paginate BUNDLED WITH 1.17.2 From 1ef865d785ff28df7d8f38ae6662d38a432755ee Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 16:05:33 -0700 Subject: [PATCH 08/11] Edit notes --- rails_db.gemspec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rails_db.gemspec b/rails_db.gemspec index 66c8846..a71649b 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -17,11 +17,11 @@ Gem::Specification.new do |s| s.executables = ['railsdb', 'rails_db', 'runsql'] - # s.add_dependency 'rails', '>= 5.0.0' - # To skip loading all of Rails, add the minimum gems separately. - # This helps users whose Rails apps are similarly configured. + # To skip loading all of Rails, adds the minimum gems separately. + # Helps users with similar Rails config to avoid extra dependencies. + # # NOTE: Be sure no other dependencies list `rails` as a dependency - # (check Gemfile.lock) or else all of Rails will load anyway. + # (check Gemfile.lock), or else all of Rails will load anyway. # # NOTE: The following Rails component classes must also be required in # * rails_db/test/dummy/config/application.rb From cace554419a2f09cbce136f0ed6bf13456637c76 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 16:07:46 -0700 Subject: [PATCH 09/11] Update rails_db.gemspec --- rails_db.gemspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rails_db.gemspec b/rails_db.gemspec index a71649b..45d5c97 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -19,11 +19,9 @@ Gem::Specification.new do |s| # To skip loading all of Rails, adds the minimum gems separately. # Helps users with similar Rails config to avoid extra dependencies. - # # NOTE: Be sure no other dependencies list `rails` as a dependency # (check Gemfile.lock), or else all of Rails will load anyway. - # - # NOTE: The following Rails component classes must also be required in + # NOTE: Must also `require` corresponding Rails component classes in # * rails_db/test/dummy/config/application.rb # * rails_db/bin/rails s.add_dependency 'actionmailer' From 4d5b21cd0bb59aa7bb32ddec8e2c3738bad19b7c Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Tue, 31 May 2022 16:43:13 -0700 Subject: [PATCH 10/11] DRY up requires Move rails classes requires to a single file to avoid future errors! --- bin/rails | 21 ++++----------------- config/rails_classes.rb | 15 +++++++++++++++ rails_db.gemspec | 3 +-- test/dummy/config/application.rb | 17 ++--------------- 4 files changed, 22 insertions(+), 34 deletions(-) create mode 100644 config/rails_classes.rb diff --git a/bin/rails b/bin/rails index c8d62e5..fe94380 100755 --- a/bin/rails +++ b/bin/rails @@ -8,23 +8,10 @@ ENGINE_PATH = File.expand_path('../../lib/rails_db/engine', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -# To choose what Rails frameworks to load, and skip others: -# NOTE: Be sure this list reflects the same choices made in the gemspec -require 'rails' # NOTE: not 'rails/rails' or 'rails/all' -require 'active_model/railtie' -# require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -require 'rails/engine/commands' +# Require only the minimum Rails classes +require_relative 'rails_db/config/rails_classes' require 'caxlsx' require 'caxlsx_rails' + +require 'rails/engine/commands' diff --git a/config/rails_classes.rb b/config/rails_classes.rb new file mode 100644 index 0000000..e102e18 --- /dev/null +++ b/config/rails_classes.rb @@ -0,0 +1,15 @@ +# To choose what Rails frameworks to load, and skip others: +# NOTE: Be sure this list reflects the same choices made in the gemspec +require 'rails' # NOTE: not 'rails/rails' or 'rails/all' +require 'active_model/railtie' +# require 'active_job/railtie' +require 'active_record/railtie' +# require 'active_storage/engine' +require 'action_controller/railtie' +require 'action_mailer/railtie' +# require 'action_mailbox/engine' +# require 'action_text/engine' +require 'action_view/railtie' +# require 'action_cable/engine' +require 'sprockets/railtie' +require 'rails/test_unit/railtie' diff --git a/rails_db.gemspec b/rails_db.gemspec index 45d5c97..23d47a7 100755 --- a/rails_db.gemspec +++ b/rails_db.gemspec @@ -22,8 +22,7 @@ Gem::Specification.new do |s| # NOTE: Be sure no other dependencies list `rails` as a dependency # (check Gemfile.lock), or else all of Rails will load anyway. # NOTE: Must also `require` corresponding Rails component classes in - # * rails_db/test/dummy/config/application.rb - # * rails_db/bin/rails + # * rails_db/config/rails_classes.rb s.add_dependency 'actionmailer' s.add_dependency 'actionpack' s.add_dependency 'activerecord' diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 69577b8..8d676fe 100755 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,20 +1,7 @@ require File.expand_path('../boot', __FILE__) -# To choose what Rails frameworks to load, and skip others: -# NOTE: Be sure this list reflects the same choices made in the gemspec -require 'rails' # NOTE: not 'rails/rails' or 'rails/all' -require 'active_model/railtie' -# require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -require 'sprockets/railtie' -require 'rails/test_unit/railtie' +# Require only the minimum Rails classes +require_relative '../../../config/rails_classes' require 'caxlsx' require 'caxlsx_rails' From 8f44c8f63f3fa067612cda1f72ceb2d980c02f57 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Thu, 1 Sep 2022 17:20:00 -0700 Subject: [PATCH 11/11] Add new minor version to track dev changes --- Gemfile.lock | 2 +- lib/rails_db/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d69fbbc..18c9353 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -173,4 +173,4 @@ DEPENDENCIES will_paginate BUNDLED WITH - 1.17.2 + 2.3.15 diff --git a/lib/rails_db/version.rb b/lib/rails_db/version.rb index 07c4d14..726596c 100755 --- a/lib/rails_db/version.rb +++ b/lib/rails_db/version.rb @@ -1,3 +1,3 @@ module RailsDb - VERSION = "2.5.0" + VERSION = "2.5.0.102" end