Skip to content
This repository
Browse code

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

Conflicts:
	Rakefile
	spec/acts_as_archive/gems_spec.rb
  • Loading branch information...
commit 2a2c93293f9a54a1212c4a3963a0c14ace9b9fd0 2 parents 9959300 + bafdf83
Winton Welsh authored
49 Rakefile
@@ -31,30 +31,24 @@ if defined?(Spec::Rake::SpecTask)
31 31 end
32 32
33 33 namespace :gems do
34   - desc "Install gems (DEV=1|0 DOCS=1|0 SUDO=1|0)"
  34 + desc "Install gems (DEV=0 DOCS=0 GEMSPEC=default SUDO=0)"
35 35 task :install do
36   - file = File.dirname(__FILE__) + '/gems'
37   - sudo = (ENV['SUDO'] ||= '0').to_i
38   - docs = (ENV['DOCS'] ||= '0').to_i
39   - sudo = sudo == 1 ? 'sudo' : ''
40   - docs = docs == 1 ? '' : '--no-ri --no-rdoc'
41   - gems = []
  36 + dev = ENV['DEV'] == '1'
  37 + docs = ENV['DOCS'] == '1' ? '' : '--no-ri --no-rdoc'
  38 + gemset = ENV['GEMSET']
  39 + sudo = ENV['SUDO'] == '1' ? 'sudo' : ''
42 40
43   - if File.exists?(file)
44   - File.open(file, 'r') do |f|
45   - gems = f.readlines.collect do |line|
46   - line.split(' ')
47   - end
48   - end
  41 + ActsAsArchive::Gems.gemset = gemset if gemset
  42 +
  43 + if dev
  44 + gems = ActsAsArchive::Gems.gemspec.development_dependencies
49 45 else
50   - gems = ActsAsArchive::Gems::TYPES[:gemspec]
51   - gems = ActsAsArchive::Gems::TYPES[:gemspec_dev] if ENV['DEV'] == '1'
52   - gems.collect! do |g|
53   - [ g.to_s, ActsAsArchive::Gems::VERSIONS[g] ]
54   - end
  46 + gems = ActsAsArchive::Gems.gemspec.dependencies
55 47 end
56 48
57   - gems.each do |(name, version)|
  49 + gems.each do |name|
  50 + name = name.to_s
  51 + version = ActsAsArchive::Gems.versions[name]
58 52 if Gem.source_index.find_name(name, version).empty?
59 53 version = version ? "-v #{version}" : ''
60 54 system "#{sudo} gem install #{name} #{version} #{docs}"
@@ -65,15 +59,20 @@ namespace :gems do
65 59 end
66 60 end
67 61
68   -desc "Install gem locally"
69   -task :install => :package do
70   - sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
71   -end
72   -
73 62 desc "Validate the gemspec"
74 63 task :gemspec do
75 64 gemspec.validate
76 65 end
77 66
  67 +<<<<<<< HEAD
  68 +task :package => :gemspec
  69 +task :default => :spec
  70 +=======
  71 +desc "Install gem locally"
  72 +task :install => :package do
  73 + sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
  74 +end
  75 +
  76 +task :default => :spec
78 77 task :package => :gemspec
79   -task :default => :spec
  78 +>>>>>>> bafdf8353a6838ac0e9fc75395de82a96b8c8f3e
6 acts_as_archive.gemspec
... ... @@ -1,4 +1,10 @@
1 1 # -*- encoding: utf-8 -*-
  2 +lib = File.expand_path('../lib/', __FILE__)
  3 +$:.unshift lib unless $:.include?(lib)
  4 +
  5 +require 'gem_template/gems'
  6 +GemTemplate::Gems.gemset ||= :default
  7 +
2 8 Gem::Specification.new do |s|
3 9 ActsAsArchive::Gems.gemspec.hash.each do |key, value|
4 10 unless %w(dependencies development_dependencies).include?(key)
1  lib/acts_as_archive/gems.rb
@@ -23,7 +23,6 @@ def initialize(hash)
23 23 Gems.config = SimpleStruct.new(
24 24 :gemsets => [ "#{File.expand_path('../../../', __FILE__)}/config/gemsets.yml" ],
25 25 :gemspec => "#{File.expand_path('../../../', __FILE__)}/config/gemspec.yml",
26   - :testing => false,
27 26 :warn => true
28 27 )
29 28
1  spec/acts_as_archive/gems_spec.rb
@@ -9,7 +9,6 @@
9 9 ActsAsArchive::Gems.config.gemsets = [
10 10 "#{$root}/spec/fixtures/gemsets.yml"
11 11 ]
12   - ActsAsArchive::Gems.config.testing = true
13 12 ActsAsArchive::Gems.config.warn = true
14 13
15 14 ActsAsArchive::Gems.gemspec true

0 comments on commit 2a2c932

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