-
Notifications
You must be signed in to change notification settings - Fork 5
Remove ks dependency #46
Changes from 12 commits
a627baf
29a25ff
75f81f2
7c34b6b
a8914e5
47c21f4
930ee2e
3563018
630f1bc
2f96c85
ed8bd17
29dac98
01f71ec
14cb0af
5caf08c
fd583fb
4b6a238
0332274
61a4434
a3fa2f5
9e82a48
dc2724f
933acea
5e7634a
5fbc8ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: ruby | ||
rvm: | ||
- 2.4.4 | ||
- 2.5.1 | ||
- 2.6.2 | ||
sudo: false | ||
- 2.7.4 | ||
- 3.0.2 | ||
cache: bundler | ||
env: | ||
global: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
## 1.0.0 | ||
* Add support for Ruby 2.7 and onwards (including Ruby 3.0) | ||
* Drop support for Ruby 2.6 and lower | ||
* Remove `ks` dependency | ||
* Add `addressable` runtime dependency | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to depend on Addressable? GIven that this is a library. Are there any features in Addressable we are using which are not provided by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question! |
||
|
||
## 0.8.2 | ||
* Change format_parser required version to allow > 0.24 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,25 +22,27 @@ Gem::Specification.new do |spec| | |
raise "RubyGems 2.0 or newer is required to protect against public gem pushes." | ||
end | ||
|
||
spec.required_ruby_version = ">= 2.7" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason we need to require 2.7+? Keyword init for structs is available since 2.5 and even a few internal WT apps are still using 2.6+ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fabioperrella suggested to only support the stable releases. Ruby 2.5 is not maintained anymore and the security maintenance for 2.6 will also end soon (https://www.ruby-lang.org/en/downloads/). I'm happy to lower this, but I'll leave that decision up to you and Fabio. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @julik is there a reason to keep compatibility with EOL Ruby versions? @kodnin I think we need to support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to make it work for Ruby 2.6. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It works™. |
||
|
||
spec.files = `git ls-files -z`.split("\x0") | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency 'patron', '~> 0.9' | ||
spec.add_dependency 'rmagick', '~> 3' | ||
spec.add_dependency 'ks' | ||
spec.add_dependency 'rack', '>= 1', '< 3' | ||
spec.add_dependency 'format_parser', '~> 0.25' | ||
spec.add_dependency 'measurometer', '~> 1' | ||
spec.add_dependency "addressable" | ||
kodnin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
spec.add_development_dependency 'magic_bytes', '~> 1' | ||
spec.add_development_dependency "bundler" | ||
spec.add_development_dependency "rake", "~> 12.2" | ||
spec.add_development_dependency "rack-test" | ||
spec.add_development_dependency "rspec", "~> 3" | ||
spec.add_development_dependency "addressable" | ||
spec.add_development_dependency "strenv" | ||
spec.add_development_dependency "simplecov" | ||
spec.add_development_dependency "pry" | ||
spec.add_development_dependency "webrick" | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
require 'ks' | ||
require 'json' | ||
require 'patron' | ||
require 'rmagick' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,11 @@ def empty? | |
@ops.empty? | ||
end | ||
|
||
def method_missing(method_name, *a, &blk) | ||
def method_missing(method_name, args = {}, &blk) | ||
operator_builder = ImageVise.operator_from(method_name) | ||
self << operator_builder.new(*a) | ||
self << operator_builder.new(**args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the 2.7 keyword argument treatment the reason we need to require 2.7? If so it is unpleasant but there likely is a solution we could try to stay backwards-compatible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the keyword argument treatment in Ruby 3 that is the problem (https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/). Ruby 2.7 builds fine without this change, Ruby 3 doesn't. Do you have a suggestion to make it backwards-compatible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wondering, isn't it backwards compatible already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like it is, I think As I suggested in another discussion, if we add support to Ruby 2.6 as well, Travis will tell us if this works 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about something like this? def method_missing(method_name, args = {}, &blk)
operator_builder = ImageVise.operator_from(method_name)
# TODO: When we remove support for Ruby 2.6, we can remove this condition
if args == {}
self << operator_builder.new
else
self << operator_builder.new(**args)
end
end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now I did this 5caf08c. I can try your solution as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There you go, fd583fb. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is good for me! |
||
end | ||
|
||
def respond_to_missing?(method_name, *a) | ||
ImageVise.defined_operators.include?(method_name.to_s) | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class ImageVise | ||
VERSION = '0.8.2' | ||
VERSION = '1.0.0' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has no effect anymore.