Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rvm:
- 2.3.0
- 2.2.4
- 2.1.8
- jruby-9.0.5.0
- jruby-9.2.11.0

jobs:
# Use `fast_finish`, don't wait for any allowed failures.
Expand Down
1 change: 1 addition & 0 deletions lib/imgix/param_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Imgix
module ParamHelpers
def rect(position)
warn "Warning: `ParamHelpers.rect` has been deprecated and will be removed in the next major version.\n"
@options[:rect] = position and return self if position.is_a?(String)

@options[:rect] = [
Expand Down
16 changes: 16 additions & 0 deletions test/units/param_helpers_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require 'test_helper'

class ParamHelpers < Imgix::Test
def test_param_helpers_emits_dep_warning
msg = "Warning: `ParamHelpers.rect` has been deprecated and " \
"will be removed in the next major version.\n"

assert_output(nil,msg){
||
client = Imgix::Client.new(host: 'test.imgix.net')
client.path('/images/demo.png').rect(x: 0, y: 50, width: 200, height: 300)
}
end
end