Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Make RbVmomi a proper Ruby Gem
Browse files Browse the repository at this point in the history
- add rbvmomi.gemspec to build Gem
- remove Gemfile.lock as it should not be versioned in Gem repository
- add lib/rbvmomi/version.rb so VERSION can be used from library
- remove VERSION as lib/rbvmomi/version.rb replaces it
- modify .gitignore to include and remove necessary files
- move bindir to exe/ so binstubs don't get included
- remove jeweler, rdoc, and rcov from Rakefile
- only use SimpleCov in tests
  • Loading branch information
jrgarcia committed Aug 4, 2016
1 parent 61852eb commit c704319
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 114 deletions.
18 changes: 11 additions & 7 deletions .gitignore
@@ -1,9 +1,13 @@
*.rbc
*.swp
*.swo
pkg/
*.gemspec
vmodl
doc
.yardoc
*.rbc
coverage
.ruby-version
.ruby-gemset
Gemfile.lock
/.bundle/
/.yardoc/
/coverage/
/doc/
/pkg/
/vendor/bundle/
/vmodl/
7 changes: 2 additions & 5 deletions Gemfile
@@ -1,6 +1,3 @@
source "https://rubygems.org"
source 'https://rubygems.org'

group :development do
gem "jeweler", "~> 2.0.1"
gem "yard"
end
gemspec
58 changes: 0 additions & 58 deletions Gemfile.lock

This file was deleted.

35 changes: 1 addition & 34 deletions Rakefile
@@ -1,26 +1,7 @@
require 'rake/testtask'
require 'rdoc/task'
require 'yard'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rbvmomi"
gem.summary = "Ruby interface to the VMware vSphere API"
#gem.description = ""
gem.email = "rlane@vmware.com"
gem.homepage = "https://github.com/vmware/rbvmomi"
gem.authors = ["Rich Lane", "Christian Dickmann"]
gem.add_dependency 'nokogiri', '>= 1.4.1'
gem.add_dependency 'builder'
gem.add_dependency 'trollop'
gem.required_ruby_version = '>= 1.8.7'
gem.files.include 'vmodl.db'
gem.files.include '.yardopts'
end
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
task(default: :test)

Rake::TestTask.new do |t|
t.libs << "test"
Expand All @@ -29,17 +10,3 @@ Rake::TestTask.new do |t|
end

YARD::Rake::YardocTask.new

begin
require 'rcov/rcovtask'
desc 'Measures test coverage using rcov'
Rcov::RcovTask.new do |rcov|
rcov.pattern = 'test/test_*.rb'
rcov.output_dir = 'coverage'
rcov.verbose = true
rcov.libs << "test"
rcov.rcov_opts << '--exclude "gems/*"'
end
rescue LoadError
puts "Rcov not available. Install it with: gem install rcov"
end
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions lib/rbvmomi/version.rb
@@ -0,0 +1,3 @@
module RbVmomi
VERSION = '1.8.3.pre'.freeze
end
28 changes: 28 additions & 0 deletions rbvmomi.gemspec
@@ -0,0 +1,28 @@
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))

require 'rbvmomi/version'

Gem::Specification.new do |spec|
spec.name = 'rbvmomi'
spec.summary = 'Ruby interface to the VMware vSphere API'
spec.version = RbVmomi::VERSION

spec.authors = ['Rich Lane', 'Christian Dickmann']
spec.email = 'jr@garciaole.com'
spec.homepage = 'https://github.com/vmware/rbvmomi'

spec.bindir = 'exe'
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^test\//) }
spec.executables << 'rbvmomish'

spec.add_runtime_dependency('builder', '~> 3.2')
spec.add_runtime_dependency('nokogiri', '~> 1.5.11')

This comment has been minimized.

Copy link
@anatol

anatol Aug 19, 2016

Please bump nokogiti and other dependencies to a more recent one

This comment has been minimized.

Copy link
@jrgarcia

jrgarcia Aug 19, 2016

Author Contributor

The problem is that we are still supporting Ruby 1.8.7 (it is still the latest available in some Linux distros) and this is the latest available version of Nokogiri that still provides support for Ruby 1.8.7. Soon, we may support only newer versions of Ruby (hopefully sooner than later!) and then we could more easily bump the version of Nokogiri.

This comment has been minimized.

Copy link
@domcleal

domcleal Aug 22, 2016

Contributor

I opened #88 to move the pinnings into the Gemfile which lets the gem be used on either new or old rubies by only having the runtime requirements specify the compatible versions.

This comment has been minimized.

Copy link
@luyseyal

luyseyal Aug 22, 2016

This broke our builds because it was using a nokogiri-1.6.8 until Saturday which bundles libxml2/libxslt. This commit forced a downgrade to 1.5.11 which requires installation of libxml2-devel and libxslt-devel on RHEL 6.7. FYI

This comment has been minimized.

Copy link
@jrgarcia

jrgarcia Aug 22, 2016

Author Contributor

@luyseyal I'm working on alleviating this right now. Sorry about that!

This comment has been minimized.

Copy link
@jrgarcia

jrgarcia Aug 22, 2016

Author Contributor

@luyseyal I just released 1.9.1 which should fix that for you. If not, please create a new issue and I'll take a look at it ASAP. I definitely don't want to break other people's builds. Thanks to @domcleal for the contribution!

This comment has been minimized.

Copy link
@luyseyal

luyseyal Aug 22, 2016

@jrgarcia Just re-ran the build with 1.9.1 and it is fixed. Thanks!

spec.add_runtime_dependency('trollop', '~> 2.1')

spec.add_development_dependency('rake', '~> 11.2')
spec.add_development_dependency('simplecov', '~> 0.12.0')
spec.add_development_dependency('test-unit', '~> 3.2')
spec.add_development_dependency('yard', '~> 0.9.5')

spec.required_ruby_version = '>= 1.8.7'
end
11 changes: 2 additions & 9 deletions test/test_helper.rb
@@ -1,12 +1,5 @@
coverage_tool = :simplecov if ENV['RBVMOMI_COVERAGE']

case coverage_tool
when :simplecov
require 'simplecov'
SimpleCov.start
when :cover_me
require 'cover_me'
end
require 'simplecov'
SimpleCov.start { add_filter '/test/' }

require 'rbvmomi'
VIM = RbVmomi::VIM
Expand Down

0 comments on commit c704319

Please sign in to comment.