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