-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,21 @@ Gem::Specification.new do |spec| | |
spec.authors = ["Canva Austria GmbH"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.platform = Gem::Platform::RUBY | ||
|
||
spec.summary = "Remove image background - 100% automatically" | ||
spec.description = "Use remove.bg with our official Ruby library to quickly, easily and 100% automatically remove the background from images." | ||
spec.homepage = "https://www.remove.bg/" | ||
spec.license = "MIT" | ||
spec.metadata["source_code_uri"] = "https://github.com/remove-bg/ruby" | ||
spec.metadata["changelog_uri"] = "https://github.com/remove-bg/ruby/blob/main/CHANGELOG.md" | ||
spec.metadata["rubygems_mfa_required"] = "true" | ||
|
||
# Require at least Ruby 2. | ||
spec.metadata = { | ||
"bug_tracker_uri" => "https://github.com/remove-bg/ruby/issues", | ||
"source_code_uri" => "https://github.com/remove-bg/ruby", | ||
"changelog_uri" => "https://github.com/remove-bg/ruby/blob/main/CHANGELOG.md", | ||
"allowed_push_host" => "https://rubygems.org", | ||
"rubygems_mfa_required" => "true", | ||
} | ||
|
||
# Require at least Ruby 2.7 | ||
spec.required_ruby_version = ">= 2.7" | ||
|
||
# Specify which files should be added to the gem when it is released. | ||
|
@@ -48,6 +55,7 @@ Gem::Specification.new do |spec| | |
spec.add_development_dependency "rubocop-rspec", "~> 2.29" | ||
spec.add_development_dependency "simplecov", "~> 0.22" | ||
spec.add_development_dependency "simplecov-cobertura", "~> 2.1" | ||
spec.add_development_dependency "simplecov_json_formatter", "~> 0.1" | ||
spec.add_development_dependency "vcr", "~> 6.2" | ||
spec.add_development_dependency "vcr_better_binary", "~> 0.2" | ||
spec.add_development_dependency "webmock", "~> 3.23" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
desc "Bump version of this gem" | ||
task :version, [:version] do |_task, args| | ||
args.with_defaults(version: nil) | ||
|
||
if args[:version].nil? | ||
puts "Version: #{RemoveBg::VERSION}" | ||
exit 0 | ||
end | ||
|
||
unless args[:version].match(/(\d+)\.(\d+)\.(\d+)/) | ||
puts "#{args[:version]} needs to be a major/minor/patch SemVer version number!" | ||
exit 1 | ||
end | ||
|
||
version_file_path = 'lib/remove_bg/version.rb' | ||
version_pattern = /VERSION = "(.+)"/ | ||
|
||
# Read the current version from file | ||
content = File.read(version_file_path) | ||
current_version = content.match(version_pattern) | ||
|
||
unless current_version = content.match(version_pattern) | ||
puts "Error in #{version_file_path} file! Cannot determine current version!" | ||
exit 1 | ||
end | ||
|
||
puts "Setting gem version to #{args[:version]}..." | ||
new_content = content.sub(version_pattern, %Q{VERSION = "#{args[:version]}"}) | ||
|
||
File.open(version_file_path, 'w') { |file| file.puts new_content } | ||
|
||
puts "Version set to #{args[:version]}" | ||
end |