Skip to content
Newer
Older
100644 90 lines (78 sloc) 2.18 KB
e9cd7b6 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 5, 2010
1 require File.dirname(__FILE__) + '/lib/acts_as_archive/gems'
bd8481d @winton Adding `rake gemspec` for Luke
authored Feb 21, 2010
2
2f25892 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 29, 2010
3 ActsAsArchive::Gems.activate %w(rake rspec)
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
4
5 require 'rake'
6 require 'spec/rake/spectask'
c542e7f @winton Using Bundler instead of Require
authored Jun 28, 2010
7
8 def gemspec
9 @gemspec ||= begin
e9cd7b6 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 6, 2010
10 file = File.expand_path('../acts_as_archive.gemspec', __FILE__)
c542e7f @winton Using Bundler instead of Require
authored Jun 28, 2010
11 eval(File.read(file), binding, file)
12 end
13 end
14
15 if defined?(Spec::Rake::SpecTask)
16 desc "Run specs"
17 Spec::Rake::SpecTask.new do |t|
18 t.spec_files = FileList['spec/**/*_spec.rb']
19 t.spec_opts = %w(-fs --color)
20 t.warning = true
21 end
22 task :spec
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored Jan 1, 2011
23 task :default => :spec
24 end
25
26 desc "Build gem(s)"
27 task :gem do
28 old_gemset = ENV['GEMSET']
b1e78b3 @winton Gems not getting any files (oops)
authored Jan 9, 2011
29 root = File.expand_path('../', __FILE__)
30 pkg = "#{root}/pkg"
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored Jan 1, 2011
31 system "rm -Rf #{pkg}"
2d214bc @winton Merge fixes
authored Jan 2, 2011
32 ActsAsArchive::Gems.gemset_names.each do |gemset|
347be43 @winton Fixing rake gem
authored Jan 1, 2011
33 ENV['GEMSET'] = gemset.to_s
035df53 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Jan 9, 2011
34 system "cd #{root} && gem build acts_as_archive.gemspec"
b1e78b3 @winton Gems not getting any files (oops)
authored Jan 10, 2011
35 system "mkdir -p #{pkg} && mv *.gem pkg"
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored Jan 1, 2011
36 end
37 ENV['GEMSET'] = old_gemset
38 end
39
40 namespace :gem do
41 desc "Install gem(s)"
42 task :install do
43 Rake::Task['gem'].invoke
44 Dir["#{File.dirname(__FILE__)}/pkg/*.gem"].each do |pkg|
45 system "gem install #{pkg} --no-ri --no-rdoc"
46 end
47 end
48
49 desc "Push gem(s)"
50 task :push do
51 Rake::Task['gem'].invoke
52 Dir["#{File.dirname(__FILE__)}/pkg/*.gem"].each do |pkg|
53 system "gem push #{pkg}"
54 end
55 end
c542e7f @winton Using Bundler instead of Require
authored Jun 28, 2010
56 end
57
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
58 namespace :gems do
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored Jan 1, 2011
59 desc "Install gem dependencies (DEV=0 DOCS=0 GEMSPEC=default SUDO=0)"
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
60 task :install do
3bcd4eb @winton Removing rake:rename in favor of putting it in separate gem, fixing r…
authored Dec 29, 2010
61 dev = ENV['DEV'] == '1'
62 docs = ENV['DOCS'] == '1' ? '' : '--no-ri --no-rdoc'
63 gemset = ENV['GEMSET']
64 sudo = ENV['SUDO'] == '1' ? 'sudo' : ''
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
65
2a2c932 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 29, 2010
66 ActsAsArchive::Gems.gemset = gemset if gemset
3bcd4eb @winton Removing rake:rename in favor of putting it in separate gem, fixing r…
authored Dec 29, 2010
67
68 if dev
2a2c932 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 29, 2010
69 gems = ActsAsArchive::Gems.gemspec.development_dependencies
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
70 else
2a2c932 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 29, 2010
71 gems = ActsAsArchive::Gems.gemspec.dependencies
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
72 end
73
3bcd4eb @winton Removing rake:rename in favor of putting it in separate gem, fixing r…
authored Dec 29, 2010
74 gems.each do |name|
75 name = name.to_s
2a2c932 @winton Merge branch 'rails' of github.com:winton/gem_template
authored Dec 29, 2010
76 version = ActsAsArchive::Gems.versions[name]
efebcbe @winton Getting rid of bundler
authored Jul 27, 2010
77 if Gem.source_index.find_name(name, version).empty?
78 version = version ? "-v #{version}" : ''
79 system "#{sudo} gem install #{name} #{version} #{docs}"
80 else
81 puts "already installed: #{name} #{version}"
82 end
83 end
84 end
85 end
86
c542e7f @winton Using Bundler instead of Require
authored Jun 28, 2010
87 desc "Validate the gemspec"
bd8481d @winton Adding `rake gemspec` for Luke
authored Feb 21, 2010
88 task :gemspec do
c542e7f @winton Using Bundler instead of Require
authored Jun 28, 2010
89 gemspec.validate
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored Jan 1, 2011
90 end
Something went wrong with that request. Please try again.