diff --git a/.travis.yml b/.travis.yml index d7cb3a4..67c4422 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,10 @@ sudo: false language: ruby rvm: - - 1.9.3 - - 2.0.0 - 2.1.0 - 2.2.0 - 2.3.0 - rbx-2 - - jruby-19mode - jruby-9.0.0.0 script: "bundle exec rake test" @@ -18,3 +15,12 @@ gemfile: - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile + +matrix: + allow_failures: + - rvm: rbx-2 + include: + - rvm: 2.2.2 + gemfile: gemfiles/5.0.gemfile + - rvm: 2.3.0 + gemfile: gemfiles/5.0.gemfile diff --git a/CHANGELOG.md b/CHANGELOG.md index c84c7a6..ea92a51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 2.0.0 / 2016-10-06 ### + +* Drop support for EOL'd Ruby 1.9.x and Ruby 2.0, please use version 1.2.0 if you need support for older + Ruby versions. +* Fix compatibility to Ruby >=2.1 and Rails 5 (thanks @einzige) + ### 1.2.0 / 2016-03-27 ### * Allow to pass `max_size` to the helper (thanks @avokhmin) diff --git a/README.md b/README.md index c18a45a..43ad87d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is the official Rails gem for [Transloadit](http://transloadit.com). It all you to automate uploading files through the Transloadit REST API. This gem provides browser integration. If you're looking to do video transcoding / image resizing -initiated from your own serverside Ruby code, please use the [ruby-sdk](https://github.com/transloadit/ruby-sdk) +initiated from your own serverside Ruby code, please use the [ruby-sdk](https://github.com/transloadit/ruby-sdk) instead. ## Install @@ -51,7 +51,7 @@ auth: templates: # template identified by template_id s3_store: '4d2e...' - + # template defined inline image_resize: steps: @@ -289,6 +289,15 @@ def example_json end ``` +## Compatibility + +At a minimum, this gem should work on MRI 2.3.0, 2.2.0, 2.1.0, Rubinius, and JRuby. +It may also work on older ruby versions, but support for those Rubies is not guaranteed. +If it doesn't work on one of the officially supported Rubies, please file a bug report. +Compatibility patches for other Rubies are welcome. + +Testing against these versions is performed automatically by [Travis CI](https://travis-ci.org/transloadit/rails-sdk). + ## License MIT, see [LICENSE](LICENSE) diff --git a/gemfiles/5.0.gemfile b/gemfiles/5.0.gemfile new file mode 100644 index 0000000..e9fef15 --- /dev/null +++ b/gemfiles/5.0.gemfile @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +gem 'railties', '~> 5.0.0' +gemspec :path => '../' diff --git a/lib/transloadit/rails/params_decoder.rb b/lib/transloadit/rails/params_decoder.rb index 88dca60..a4e4074 100644 --- a/lib/transloadit/rails/params_decoder.rb +++ b/lib/transloadit/rails/params_decoder.rb @@ -4,7 +4,11 @@ module Transloadit::Rails::ParamsDecoder extend ActiveSupport::Concern included do - before_filter :decode_transloadit_json + if respond_to?(:before_action) + before_action :decode_transloadit_json + else + before_filter :decode_transloadit_json + end end def decode_transloadit_json diff --git a/transloadit-rails.gemspec b/transloadit-rails.gemspec index 57f516a..a8d6fbd 100644 --- a/transloadit-rails.gemspec +++ b/transloadit-rails.gemspec @@ -15,7 +15,8 @@ Gem::Specification.new do |gem| gem.summary = 'Official Rails gem for Transloadit' gem.description = 'The transloadit-rails gem allows you to automate uploading files through the Transloadit REST API' - gem.required_rubygems_version = '>= 1.3.6' + gem.required_rubygems_version = '>= 2.1.0' + gem.required_ruby_version = '>= 2.1.0' gem.rubyforge_project = 'transloadit-rails' gem.files = `git ls-files`.split("\n") @@ -26,7 +27,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'transloadit', '>= 1.1.1' gem.add_dependency 'railties', '>= 3' - gem.add_dependency 'mime-types', '~> 2.99' + gem.add_dependency 'mime-types' gem.add_development_dependency 'rake' gem.add_development_dependency 'test-unit'