Skip to content
Browse files

Merge branch 'rails' of github.com:winton/gem_template

Conflicts:
	Rakefile
	spec/acts_as_archive/gems_spec.rb
  • Loading branch information...
2 parents 9959300 + bafdf83 commit 2a2c93293f9a54a1212c4a3963a0c14ace9b9fd0 @winton committed Dec 29, 2010
Showing with 30 additions and 27 deletions.
  1. +24 −25 Rakefile
  2. +6 −0 acts_as_archive.gemspec
  3. +0 −1 lib/acts_as_archive/gems.rb
  4. +0 −1 spec/acts_as_archive/gems_spec.rb
View
49 Rakefile
@@ -31,30 +31,24 @@ if defined?(Spec::Rake::SpecTask)
end
namespace :gems do
- desc "Install gems (DEV=1|0 DOCS=1|0 SUDO=1|0)"
+ desc "Install gems (DEV=0 DOCS=0 GEMSPEC=default SUDO=0)"
task :install do
- file = File.dirname(__FILE__) + '/gems'
- sudo = (ENV['SUDO'] ||= '0').to_i
- docs = (ENV['DOCS'] ||= '0').to_i
- sudo = sudo == 1 ? 'sudo' : ''
- docs = docs == 1 ? '' : '--no-ri --no-rdoc'
- gems = []
+ dev = ENV['DEV'] == '1'
+ docs = ENV['DOCS'] == '1' ? '' : '--no-ri --no-rdoc'
+ gemset = ENV['GEMSET']
+ sudo = ENV['SUDO'] == '1' ? 'sudo' : ''
- if File.exists?(file)
- File.open(file, 'r') do |f|
- gems = f.readlines.collect do |line|
- line.split(' ')
- end
- end
+ ActsAsArchive::Gems.gemset = gemset if gemset
+
+ if dev
+ gems = ActsAsArchive::Gems.gemspec.development_dependencies
else
- gems = ActsAsArchive::Gems::TYPES[:gemspec]
- gems = ActsAsArchive::Gems::TYPES[:gemspec_dev] if ENV['DEV'] == '1'
- gems.collect! do |g|
- [ g.to_s, ActsAsArchive::Gems::VERSIONS[g] ]
- end
+ gems = ActsAsArchive::Gems.gemspec.dependencies
end
- gems.each do |(name, version)|
+ gems.each do |name|
+ name = name.to_s
+ version = ActsAsArchive::Gems.versions[name]
if Gem.source_index.find_name(name, version).empty?
version = version ? "-v #{version}" : ''
system "#{sudo} gem install #{name} #{version} #{docs}"
@@ -65,15 +59,20 @@ namespace :gems do
end
end
-desc "Install gem locally"
-task :install => :package do
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
-end
-
desc "Validate the gemspec"
task :gemspec do
gemspec.validate
end
+<<<<<<< HEAD
+task :package => :gemspec
+task :default => :spec
+=======
+desc "Install gem locally"
+task :install => :package do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
+
+task :default => :spec
task :package => :gemspec
-task :default => :spec
+>>>>>>> bafdf8353a6838ac0e9fc75395de82a96b8c8f3e
View
6 acts_as_archive.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|
ActsAsArchive::Gems.gemspec.hash.each do |key, value|
unless %w(dependencies development_dependencies).include?(key)
View
1 lib/acts_as_archive/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
)
View
1 spec/acts_as_archive/gems_spec.rb
@@ -9,7 +9,6 @@
ActsAsArchive::Gems.config.gemsets = [
"#{$root}/spec/fixtures/gemsets.yml"
]
- ActsAsArchive::Gems.config.testing = true
ActsAsArchive::Gems.config.warn = true
ActsAsArchive::Gems.gemspec true

0 comments on commit 2a2c932

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