From 045319af5c5582cdb319f788e290a8cb743ca023 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Wed, 18 Jul 2018 16:16:32 -0600 Subject: [PATCH 1/4] Update so we can use this on rails 5 --- .ruby-version | 2 +- .travis.yml | 3 + Gemfile | 6 +- Gemfile.lock | 210 ++++++++++++++++--------- app/helpers/recurring_select_helper.rb | 8 +- lib/recurring_select/version.rb | 2 +- spec/gemfiles/Gemfile.rails-5.0.x | 8 + 7 files changed, 154 insertions(+), 85 deletions(-) create mode 100644 spec/gemfiles/Gemfile.rails-5.0.x diff --git a/.ruby-version b/.ruby-version index ac2cdeba..00355e29 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.3 +2.3.7 diff --git a/.travis.yml b/.travis.yml index 829f3efd..e8119e95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ rvm: - 2.0.0 - 2.1.5 - 2.2.0 + - 2.3.7 - jruby-19mode gemfile: - spec/gemfiles/Gemfile.rails-4.0.x @@ -19,6 +20,8 @@ matrix: gemfile: spec/gemfiles/rails-4.1.x.gemfile - rvm: 1.9.3 gemfile: spec/gemfiles/rails-4.2.x.gemfile + - rvm: 2.3.7 + gemfile: spec/gemfiles/rails-5.0.x.gemfile - rvm: jruby-19mode gemfile: spec/gemfiles/Gemfile.rails-3.2.x fast_finish: true diff --git a/Gemfile b/Gemfile index f9e1be74..ccc7b4d9 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,5 @@ gemspec gem 'pg', platform: :ruby gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby -gem 'jquery-rails' - -gem 'rails', '~> 4.0.12' -gem 'sass-rails', '~> 4.0.5' +gem "rails", "~> 5.2" +gem "sass-rails", "~> 5.0" diff --git a/Gemfile.lock b/Gemfile.lock index 70357775..1ccbd237 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - recurring_select (2.0.0) + recurring_select (2.1.0) coffee-rails (>= 3.1) ice_cube (>= 0.11) jquery-rails (>= 3.0) @@ -11,71 +11,118 @@ PATH GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.13) - actionpack (= 4.0.13) + actioncable (5.2.0) + actionpack (= 5.2.0) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) mail (~> 2.5, >= 2.5.4) - actionpack (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activemodel (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - activerecord (4.0.13) - activemodel (= 4.0.13) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.13) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activesupport (4.0.13) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - arel (4.0.2) - builder (3.1.4) - coffee-rails (4.1.0) + rails-dom-testing (~> 2.0) + actionpack (5.2.0) + actionview (= 5.2.0) + activesupport (= 5.2.0) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.0) + activesupport (= 5.2.0) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.0) + activesupport (= 5.2.0) + globalid (>= 0.3.6) + activemodel (5.2.0) + activesupport (= 5.2.0) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activestorage (5.2.0) + actionpack (= 5.2.0) + activerecord (= 5.2.0) + marcel (~> 0.3.1) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (9.0.0) + builder (3.2.3) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.9.1.1) + coffee-script-source (1.12.2) + concurrent-ruby (1.0.5) + crass (1.0.4) diff-lcs (1.2.5) - erubis (2.7.0) - execjs (2.6.0) - hike (1.2.3) - i18n (0.7.0) - ice_cube (0.13.0) - jquery-rails (3.1.2) - railties (>= 3.0, < 5.0) + erubi (1.7.1) + execjs (2.7.0) + ffi (1.9.25) + globalid (0.4.1) + activesupport (>= 4.2.0) + i18n (1.0.1) + concurrent-ruby (~> 1.0) + ice_cube (0.16.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.6.2) - minitest (4.7.5) - multi_json (1.11.2) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) + method_source (0.9.0) + mimemagic (0.3.2) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + nio4r (2.3.1) + nokogiri (1.8.4) + mini_portile2 (~> 2.3.0) pg (0.17.1) - rack (1.5.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.0.13) - actionmailer (= 4.0.13) - actionpack (= 4.0.13) - activerecord (= 4.0.13) - activesupport (= 4.0.13) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.13) - sprockets-rails (~> 2.0) - railties (4.0.13) - actionpack (= 4.0.13) - activesupport (= 4.0.13) + rack (2.0.5) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rails (5.2.0) + actioncable (= 5.2.0) + actionmailer (= 5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + activemodel (= 5.2.0) + activerecord (= 5.2.0) + activestorage (= 5.2.0) + activesupport (= 5.2.0) + bundler (>= 1.3.0) + railties (= 5.2.0) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.2.0) + actionpack (= 5.2.0) + activesupport (= 5.2.0) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.4.2) + rake (12.3.1) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rspec (3.1.0) rspec-core (~> 3.1.0) rspec-expectations (~> 3.1.0) @@ -96,25 +143,32 @@ GEM rspec-mocks (~> 3.1.0) rspec-support (~> 3.1.0) rspec-support (3.1.2) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) + sass (3.5.7) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) sprockets (>= 2.8, < 4.0) - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - tzinfo (0.3.44) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.0) + thread_safe (0.3.6) + tilt (2.0.8) + tzinfo (1.2.5) + thread_safe (~> 0.1) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) PLATFORMS ruby @@ -122,11 +176,13 @@ PLATFORMS DEPENDENCIES activerecord-jdbcpostgresql-adapter bundler (>= 1.3.5) - jquery-rails pg - rails (~> 4.0.12) + rails (~> 5.2) rake (>= 0.9.6) recurring_select! rspec (>= 2.14) rspec-rails (>= 2.14) - sass-rails (~> 4.0.5) + sass-rails (~> 5.0) + +BUNDLED WITH + 1.16.2 diff --git a/app/helpers/recurring_select_helper.rb b/app/helpers/recurring_select_helper.rb index b4fc7e70..807935f2 100644 --- a/app/helpers/recurring_select_helper.rb +++ b/app/helpers/recurring_select_helper.rb @@ -2,7 +2,7 @@ module RecurringSelectHelper module FormHelper - if Rails::VERSION::MAJOR == 4 + if Rails::VERSION::MAJOR >= 4 def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {}) RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render end @@ -114,7 +114,11 @@ def initialize(object, method, template_object, default_schedules = nil, options end def render - option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object)) + if Rails::VERSION::STRING >= '5.2' + option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value) + else + option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object)) + end select_content_tag(option_tags, @options, @html_options) end end diff --git a/lib/recurring_select/version.rb b/lib/recurring_select/version.rb index 86e59cce..3e6c68a6 100644 --- a/lib/recurring_select/version.rb +++ b/lib/recurring_select/version.rb @@ -1,3 +1,3 @@ module RecurringSelect - VERSION = "2.0.0" + VERSION = "2.1.0" end diff --git a/spec/gemfiles/Gemfile.rails-5.0.x b/spec/gemfiles/Gemfile.rails-5.0.x new file mode 100644 index 00000000..b42c6e4b --- /dev/null +++ b/spec/gemfiles/Gemfile.rails-5.0.x @@ -0,0 +1,8 @@ +source "https://rubygems.org" +gemspec :path => "./../.." + +gem 'pg', platform: :ruby +gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby + +gem "rails", "~> 5.2" +gem "sass-rails", "~> 5.0" \ No newline at end of file From 39fcfbe9c697cf2a140a67248936386a2c0cd641 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Thu, 19 Jul 2018 13:13:12 -0600 Subject: [PATCH 2/4] Let's leave the demo app on rails 4 --- Gemfile | 6 +- Gemfile.lock | 195 +++++++++++++++++++-------------------------------- 2 files changed, 75 insertions(+), 126 deletions(-) diff --git a/Gemfile b/Gemfile index ccc7b4d9..f9e1be74 100644 --- a/Gemfile +++ b/Gemfile @@ -4,5 +4,7 @@ gemspec gem 'pg', platform: :ruby gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby -gem "rails", "~> 5.2" -gem "sass-rails", "~> 5.0" +gem 'jquery-rails' + +gem 'rails', '~> 4.0.12' +gem 'sass-rails', '~> 4.0.5' diff --git a/Gemfile.lock b/Gemfile.lock index 1ccbd237..0add2dbb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,49 +11,32 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (5.2.0) - actionpack (= 5.2.0) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.0) - actionpack (= 5.2.0) - actionview (= 5.2.0) - activejob (= 5.2.0) + actionmailer (4.0.13) + actionpack (= 4.0.13) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.0) - actionview (= 5.2.0) - activesupport (= 5.2.0) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.0) - activesupport (= 5.2.0) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.0) - activesupport (= 5.2.0) - globalid (>= 0.3.6) - activemodel (5.2.0) - activesupport (= 5.2.0) - activerecord (5.2.0) - activemodel (= 5.2.0) - activesupport (= 5.2.0) - arel (>= 9.0) - activestorage (5.2.0) - actionpack (= 5.2.0) - activerecord (= 5.2.0) - marcel (~> 0.3.1) - activesupport (5.2.0) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - builder (3.2.3) + actionpack (4.0.13) + activesupport (= 4.0.13) + builder (~> 3.1.0) + erubis (~> 2.7.0) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + activemodel (4.0.13) + activesupport (= 4.0.13) + builder (~> 3.1.0) + activerecord (4.0.13) + activemodel (= 4.0.13) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.13) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.4) + activesupport (4.0.13) + i18n (~> 0.6, >= 0.6.9) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) + arel (4.0.2) + builder (3.1.4) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@ -61,68 +44,38 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) - crass (1.0.4) diff-lcs (1.2.5) - erubi (1.7.1) + erubis (2.7.0) execjs (2.7.0) - ffi (1.9.25) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (1.0.1) - concurrent-ruby (~> 1.0) + hike (1.2.3) + i18n (0.7.0) ice_cube (0.16.2) - jquery-rails (4.3.3) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) + jquery-rails (3.1.2) + railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - loofah (2.2.2) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.0) - mini_mime (>= 0.1.1) - marcel (0.3.2) - mimemagic (~> 0.3.2) - method_source (0.9.0) - mimemagic (0.3.2) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.11.3) - nio4r (2.3.1) - nokogiri (1.8.4) - mini_portile2 (~> 2.3.0) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mime-types (2.6.2) + minitest (4.7.5) + multi_json (1.11.2) pg (0.17.1) - rack (2.0.5) - rack-test (1.0.0) - rack (>= 1.0, < 3) - rails (5.2.0) - actioncable (= 5.2.0) - actionmailer (= 5.2.0) - actionpack (= 5.2.0) - actionview (= 5.2.0) - activejob (= 5.2.0) - activemodel (= 5.2.0) - activerecord (= 5.2.0) - activestorage (= 5.2.0) - activesupport (= 5.2.0) - bundler (>= 1.3.0) - railties (= 5.2.0) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.2.0) - actionpack (= 5.2.0) - activesupport (= 5.2.0) - method_source + rack (1.5.5) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.0.13) + actionmailer (= 4.0.13) + actionpack (= 4.0.13) + activerecord (= 4.0.13) + activesupport (= 4.0.13) + bundler (>= 1.3.0, < 2.0) + railties (= 4.0.13) + sprockets-rails (~> 2.0) + railties (4.0.13) + actionpack (= 4.0.13) + activesupport (= 4.0.13) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.3.1) - rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) + rake (10.4.2) rspec (3.1.0) rspec-core (~> 3.1.0) rspec-expectations (~> 3.1.0) @@ -143,32 +96,25 @@ GEM rspec-mocks (~> 3.1.0) rspec-support (~> 3.1.0) rspec-support (3.1.2) - sass (3.5.7) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) + sass (3.2.19) + sass-rails (4.0.5) + railties (>= 4.0.0, < 5.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 3.0) + sprockets-rails (~> 2.0) + sprockets (2.12.4) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sprockets-rails (2.3.3) + actionpack (>= 3.0) + activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (0.20.0) - thread_safe (0.3.6) - tilt (2.0.8) - tzinfo (1.2.5) - thread_safe (~> 0.1) - websocket-driver (0.7.0) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) + thor (0.19.1) + thread_safe (0.3.5) + tilt (1.4.1) + tzinfo (0.3.44) PLATFORMS ruby @@ -176,13 +122,14 @@ PLATFORMS DEPENDENCIES activerecord-jdbcpostgresql-adapter bundler (>= 1.3.5) + jquery-rails pg - rails (~> 5.2) + rails (~> 4.0.12) rake (>= 0.9.6) recurring_select! rspec (>= 2.14) rspec-rails (>= 2.14) - sass-rails (~> 5.0) + sass-rails (~> 4.0.5) BUNDLED WITH 1.16.2 From 0bc6331d1bba9e85a54b4f10a1174a0a51da7b99 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Thu, 19 Jul 2018 13:16:06 -0600 Subject: [PATCH 3/4] Add rails 5 travis friend --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e8119e95..f6e55438 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ gemfile: - spec/gemfiles/Gemfile.rails-4.0.x - spec/gemfiles/Gemfile.rails-4.1.x - spec/gemfiles/Gemfile.rails-4.2.x + - spec/gemfiles/Gemfile.rails-5.0.x matrix: exclude: - rvm: 1.9.3 From 9e02f39863d57ee91321ab8c9c86b789a086de9b Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Thu, 19 Jul 2018 13:24:49 -0600 Subject: [PATCH 4/4] Add some more excludes since rails 5 only likes new ruby --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f6e55438..fa254a6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,19 @@ matrix: exclude: - rvm: 1.9.3 gemfile: spec/gemfiles/rails-4.0.x.gemfile + - rvm: 1.9.3 + gemfile: spec/gemfiles/rails-5.0.x.gemfile - rvm: 1.9.3 gemfile: spec/gemfiles/rails-4.1.x.gemfile + - rvm: 1.9.3 + gemfile: spec/gemfiles/rails-5.0.x.gemfile - rvm: 1.9.3 gemfile: spec/gemfiles/rails-4.2.x.gemfile - - rvm: 2.3.7 + - rvm: 2.0.0 + gemfile: spec/gemfiles/rails-5.0.x.gemfile + - rvm: 2.1.5 + gemfile: spec/gemfiles/rails-5.0.x.gemfile + - rvm: 2.2.2 gemfile: spec/gemfiles/rails-5.0.x.gemfile - rvm: jruby-19mode gemfile: spec/gemfiles/Gemfile.rails-3.2.x