Permalink
Browse files

Use a gemspec to define dependencies

We shouldn't be using a Gemfile to define gem dependencies here, since
this is intended to be used in other components. Also, remove Gemfile.lock
and add it to .gitignore.

Change-Id: Ief7ed26cea3f646dd52245de3b234cd86c377bc4
  • Loading branch information...
1 parent d5e2a8d commit 13ef69a4f2b7bf35850f3f09427477856b6806d9 mpage committed Nov 10, 2011
View
@@ -0,0 +1 @@
+Gemfile.lock
View
@@ -1,7 +1,3 @@
source :rubygems
-gem 'rake'
-
-group :test do
- gem 'rspec'
-end
+gemspec
View
@@ -1,20 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- diff-lcs (1.1.2)
- rake (0.8.7)
- rspec (2.5.0)
- rspec-core (~> 2.5.0)
- rspec-expectations (~> 2.5.0)
- rspec-mocks (~> 2.5.0)
- rspec-core (2.5.1)
- rspec-expectations (2.5.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.5.0)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- rake
- rspec
View
@@ -1,51 +1,10 @@
require 'rubygems'
-require 'rake'
-require 'rake/gempackagetask'
+require 'bundler'
+Bundler.setup
+Bundler::GemHelper.install_tasks
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
-require 'vcap/logging/version'
-
-GEM_NAME = 'vcap_logging'
-GEM_VERSION = VCAP::Logging::VERSION
-
-gemspec = Gem::Specification.new do |s|
- s.name = GEM_NAME
- s.version = GEM_VERSION
- s.platform = Gem::Platform::RUBY
- s.summary = 'Common logging library for VCAP projects'
- s.description = s.summary
- s.authors = ['Matt Page']
- s.email = 'mpage@vmware.com'
- s.homepage = 'http://www.cloudfoundry.com'
- s.executables = [] # log_grep coming soon...
- s.bindir = 'bin'
- s.require_path = 'lib'
- s.files = %w(README.md Rakefile) + Dir.glob("{lib,spec,vendor}/**/*")
-end
-
-Rake::GemPackageTask.new(gemspec) do |pkg|
- pkg.gem_spec = gemspec
-end
-
-task :install => [:package] do
- sh "gem install --no-ri --no-rdoc pkg/#{GEM_NAME}-#{GEM_VERSION}"
-end
-
-task :spec => ['bundler:install:test'] do
+task :spec do
desc 'Run tests'
+ sh('bundle install')
sh('cd spec && rake spec')
end
-
-namespace 'bundler' do
- task 'install' do
- sh('bundle install')
- end
-
- environments = %w(test development production)
- environments.each do |env|
- desc "Install gems for #{env}"
- task "install:#{env}" do
- sh("bundle install --local --without #{(environments - [env]).join(' ')}")
- end
- end
-end
@@ -1,5 +1,5 @@
module VCAP
module Logging
- VERSION = '0.1.3'
+ VERSION = '0.1.4'
end
end
@@ -1,11 +1,10 @@
-require 'rake'
-
BASE_DIR = File.expand_path(File.join('..', '..'), __FILE__)
ENV["BUNDLE_GEMFILE"] ||= File.join(BASE_DIR, 'Gemfile')
require 'rubygems'
require 'bundler'
-Bundler.setup(:default, :test)
+Bundler.setup
+require 'rake'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
+$:.push File.expand_path("../lib", __FILE__)
+require "vcap/logging/version"
+
+Gem::Specification.new do |s|
+ s.name = "vcap_logging"
+ s.version = VCAP::Logging::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["mpage"]
+ s.email = ["mpage@vmware.com"]
+ s.homepage = "http://www.cloudfoundry.com"
+ s.summary = %q{Minimal logging gem used for CF components}
+ s.description = %q{This provides a minimal logging gem to be used across CF components}
+
+ s.files = %w(Rakefile Gemfile) + Dir.glob("{lib,spec}/**/*")
+ s.require_paths = ["lib"]
+
+ s.add_dependency 'rake'
+ s.add_development_dependency 'rspec'
+end

0 comments on commit 13ef69a

Please sign in to comment.