Skip to content

Commit

Permalink
🐞 Fix gemspec
Browse files Browse the repository at this point in the history
Why doesn't `gem` allow methods?
  • Loading branch information
cimnine committed Aug 17, 2018
1 parent 3df12f8 commit 921079a
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions netbox-client-ruby.gemspec
Original file line number Diff line number Diff line change
@@ -1,56 +1,39 @@
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

def authors(spec)
Gem::Specification.new do |spec|
spec.name = 'netbox-client-ruby'
spec.version = File.read(File.expand_path('VERSION', __dir__)).strip

spec.summary = 'A read/write client for Netbox v2.'
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
spec.license = 'MIT'

spec.authors = ['Christian Mäder']
spec.email = ['[email protected]']
end

def files_and_paths(spec)
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
end

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
end

def allowed_push_host(spec)
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
end

def add_runtime_dependencies(spec)
spec.add_runtime_dependency 'dry-configurable', '~> 0.1'
spec.add_runtime_dependency 'faraday', '>= 0.11.0'
spec.add_runtime_dependency 'faraday', '~> 0.11', '>= 0.11.0'
spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
spec.add_runtime_dependency 'faraday_middleware', '~> 0.11.0'
spec.add_runtime_dependency 'ipaddress', '>= 0.8.3'
spec.add_runtime_dependency 'openssl', '>= 2.0.5'
end
spec.add_runtime_dependency 'ipaddress', '~> 0.8', '>= 0.8.3'
spec.add_runtime_dependency 'openssl', '~> 2.0', '>= 2.0.5'

def add_development_dependencies(spec)
spec.add_development_dependency 'bundler', '~> 1.14'
spec.add_development_dependency 'pry', '~> 0.10'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.5'
spec.add_development_dependency 'rubocop', '~> 0.48'
spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
end

Gem::Specification.new do |spec|
spec.name = 'netbox-client-ruby'
spec.version = File.read(File.expand_path('VERSION', __dir__)).strip

spec.summary = 'A read/write client for Netbox v2.'
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
spec.license = 'MIT'

authors(spec)

allowed_push_host(spec) if spec.respond_to?(:metadata)

files_and_paths(spec)

add_runtime_dependencies(spec)
add_development_dependencies(spec)
end

0 comments on commit 921079a

Please sign in to comment.