Skip to content
This repository
Browse code

Fixing rake gem

  • Loading branch information...
commit 347be43eb03eb86068f7c403e5a977b2098912a1 1 parent b3f7765
Winton Welsh authored
4 Rakefile
@@ -28,8 +28,8 @@ task :gem do
28 28 old_gemset = ENV['GEMSET']
29 29 pkg = "#{File.dirname(__FILE__)}/pkg"
30 30 system "rm -Rf #{pkg}"
31   - (GemTemplate::Gems.gemspecs.keys + %w(default nodep)).each do |gemset|
32   - ENV['GEMSET'] = gemset
  31 + GemTemplate::Gems.gemset_names.each do |gemset|
  32 + ENV['GEMSET'] = gemset.to_s
33 33 system "mkdir -p #{pkg} && cd #{pkg} && gem build ../gem_template.gemspec"
34 34 end
35 35 ENV['GEMSET'] = old_gemset
2  gem_template.gemspec
@@ -9,6 +9,8 @@ Gem::Specification.new do |s|
9 9 GemTemplate::Gems.gemspec.hash.each do |key, value|
10 10 if key == 'name' && GemTemplate::Gems.gemset != :default
11 11 s.name = "#{value}-#{GemTemplate::Gems.gemset}"
  12 + elsif key == 'summary' && GemTemplate::Gems.gemset == :solo
  13 + s.summary = value + " (no dependencies)"
12 14 elsif !%w(dependencies development_dependencies).include?(key)
13 15 s.send "#{key}=", value
14 16 end
7 lib/gem_template/gems.rb
@@ -83,6 +83,13 @@ def gemset=(gemset)
83 83 end
84 84 end
85 85
  86 + def gemset_names
  87 + [ :default, :solo ] + @gemsets[gemspec.name.to_sym].inject([]) { |array, (key, value)|
  88 + array.push(key) if value.is_a?(::Hash)
  89 + array
  90 + }
  91 + end
  92 +
86 93 def gemspec(reload=false)
87 94 if @gemspec && !reload
88 95 @gemspec

0 comments on commit 347be43

Please sign in to comment.
Something went wrong with that request. Please try again.