Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing rake gem

  • Loading branch information...
commit 347be43eb03eb86068f7c403e5a977b2098912a1 1 parent b3f7765
Winton Welsh authored
Showing with 11 additions and 2 deletions.
  1. +2 −2 Rakefile
  2. +2 −0  gem_template.gemspec
  3. +7 −0 lib/gem_template/gems.rb
4 Rakefile
View
@@ -28,8 +28,8 @@ task :gem do
old_gemset = ENV['GEMSET']
pkg = "#{File.dirname(__FILE__)}/pkg"
system "rm -Rf #{pkg}"
- (GemTemplate::Gems.gemspecs.keys + %w(default nodep)).each do |gemset|
- ENV['GEMSET'] = gemset
+ GemTemplate::Gems.gemset_names.each do |gemset|
+ ENV['GEMSET'] = gemset.to_s
system "mkdir -p #{pkg} && cd #{pkg} && gem build ../gem_template.gemspec"
end
ENV['GEMSET'] = old_gemset
2  gem_template.gemspec
View
@@ -9,6 +9,8 @@ Gem::Specification.new do |s|
GemTemplate::Gems.gemspec.hash.each do |key, value|
if key == 'name' && GemTemplate::Gems.gemset != :default
s.name = "#{value}-#{GemTemplate::Gems.gemset}"
+ elsif key == 'summary' && GemTemplate::Gems.gemset == :solo
+ s.summary = value + " (no dependencies)"
elsif !%w(dependencies development_dependencies).include?(key)
s.send "#{key}=", value
end
7 lib/gem_template/gems.rb
View
@@ -83,6 +83,13 @@ def gemset=(gemset)
end
end
+ def gemset_names
+ [ :default, :solo ] + @gemsets[gemspec.name.to_sym].inject([]) { |array, (key, value)|
+ array.push(key) if value.is_a?(::Hash)
+ array
+ }
+ end
+
def gemspec(reload=false)
if @gemspec && !reload
@gemspec
Please sign in to comment.
Something went wrong with that request. Please try again.