From a94936fb24e5ef7c09c56ea982b2aa4e1a9e7229 Mon Sep 17 00:00:00 2001 From: winton Date: Wed, 29 Dec 2010 13:17:50 -0800 Subject: [PATCH] No longer need Gems.config.testing option, making gemspec so it can be built independently --- gem_template.gemspec | 6 ++++++ lib/gem_template/gems.rb | 1 - spec/gem_template/gems_spec.rb | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gem_template.gemspec b/gem_template.gemspec index 1aaa6b5..a43da36 100644 --- a/gem_template.gemspec +++ b/gem_template.gemspec @@ -1,4 +1,10 @@ # -*- encoding: utf-8 -*- +lib = File.expand_path('../lib/', __FILE__) +$:.unshift lib unless $:.include?(lib) + +require 'gem_template/gems' +GemTemplate::Gems.gemset ||= :default + Gem::Specification.new do |s| GemTemplate::Gems.gemspec.hash.each do |key, value| unless %w(dependencies development_dependencies).include?(key) diff --git a/lib/gem_template/gems.rb b/lib/gem_template/gems.rb index 78b9b02..9bf6c90 100644 --- a/lib/gem_template/gems.rb +++ b/lib/gem_template/gems.rb @@ -23,7 +23,6 @@ def initialize(hash) Gems.config = SimpleStruct.new( :gemsets => [ "#{File.expand_path('../../../', __FILE__)}/config/gemsets.yml" ], :gemspec => "#{File.expand_path('../../../', __FILE__)}/config/gemspec.yml", - :testing => false, :warn => true ) diff --git a/spec/gem_template/gems_spec.rb b/spec/gem_template/gems_spec.rb index e96a271..391a857 100644 --- a/spec/gem_template/gems_spec.rb +++ b/spec/gem_template/gems_spec.rb @@ -9,7 +9,6 @@ GemTemplate::Gems.config.gemsets = [ "#{$root}/spec/fixtures/gemsets.yml" ] - GemTemplate::Gems.config.testing = true GemTemplate::Gems.config.warn = true GemTemplate::Gems.gemspec true