-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why doesn't `gem` allow methods?
- Loading branch information
Showing
1 changed file
with
15 additions
and
32 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
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 |