Skip to content
Open
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
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
AllCops:
NewCops: disable
SuggestExtensions: false
Exclude:
- bin/*

plugins:
- rubocop-performance
- rubocop-rspec
- rubocop-rake

Expand Down Expand Up @@ -65,4 +68,4 @@ RSpec/SpecFilePathFormat:
RSpec/ContextWording:
Enabled: false
RSpec/OverwritingSetup:
Enabled: false
Enabled: false
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ gemspec

gem 'json', '~> 2.1'
gem 'mini_mime'
gem 'pry', '~> 0.16.0'
gem 'rails'
gem 'rake', '~> 13.3.1'
gem 'rspec', '~> 3.13.0'
gem 'rspec-its', '~> 2.0.0'
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rake'
gem 'rubocop-rspec'
gem 'simplecov'
gem 'vcr', '~> 6.4.0'
gem 'webmock', '~> 3.7'
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ RSpec::Core::RakeTask.new('spec:all') do |t|
t.pattern = 'spec/**/*_spec.rb'
end

task default: 'spec:unit'
task default: 'spec:all'
16 changes: 16 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")
16 changes: 16 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rspec-core", "rspec")
16 changes: 16 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rubocop' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rubocop", "rubocop")
2 changes: 1 addition & 1 deletion lib/mailgun/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(api_key = Mailgun.api_key,
'Accept' => '*/*'
}
}
request_options.merge!(request: { timeout: timeout }) if timeout
request_options[:request] = { timeout: timeout } if timeout

@http_client = build_http_client(api_key, request_options)

Expand Down
4 changes: 2 additions & 2 deletions lib/mailgun/helpers/api_version_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def requires_api_version(version, *method_names)

define_method(method_name) do |*args, **kwargs, &block|
warn_unless_api_version(version)
original_method.bind(self).call(*args, **kwargs, &block)
original_method.bind_call(self, *args, **kwargs, &block)
end
end
end
Expand All @@ -24,7 +24,7 @@ def enforces_api_version(version, *method_names)

define_method(method_name) do |*args, **kwargs, &block|
require_api_version(version)
original_method.bind(self).call(*args, **kwargs, &block)
original_method.bind_call(self, *args, **kwargs, &block)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mailgun/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_yaml!
#
# @return [Boolean] A boolean that binarizes the response status result.
def success?
(200..299).include?(status)
(200..299).cover?(status)
end
end
end
22 changes: 2 additions & 20 deletions mailgun.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mailgun/version'
require_relative 'lib/mailgun/version'

Gem::Specification.new do |spec|
spec.name = 'mailgun-ruby'
Expand All @@ -20,26 +18,10 @@ Gem::Specification.new do |spec|
spec.metadata['documentation_uri'] = 'https://documentation.mailgun.com/'
spec.metadata['source_code_uri'] = 'https://github.com/mailgun/mailgun-ruby'

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
spec.files = Dir['README.md', 'LICENSE', 'CHANGELOG.md', 'lib/**/*.rb']

spec.required_ruby_version = '>= 3.0.0'

spec.add_development_dependency 'bundler', '>= 1.16.2'
spec.add_development_dependency 'pry', '~> 0.16.0'
spec.add_development_dependency 'rails'
spec.add_development_dependency 'rake', '~> 13.3.1'
spec.add_development_dependency 'rspec', '~> 3.13.0'
spec.add_development_dependency 'rspec-its', '~> 2.0.0'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov-json'
spec.add_development_dependency 'vcr', '~> 6.4.0'
spec.add_development_dependency 'webmock', '~> 3.7'
spec.add_dependency 'faraday', '~> 2.1'
spec.add_dependency 'faraday-multipart', '< 2'
spec.add_dependency 'mini_mime'
Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# frozen_string_literal: true

require 'simplecov'
require 'simplecov-json'
require 'simplecov_json_formatter'

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
Expand Down
Loading