Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 64 lines (57 sloc) 1.344 kb
648ace07 »
2009-06-15 First commit
1 require 'rubygems'
2 require 'rake'
3 require 'rake/gempackagetask'
4 require 'spec/rake/spectask'
5 require 'gemspec'
6
7 begin
8 require 'vendor/active_wrapper/lib/active_wrapper/tasks'
9
10 ActiveWrapper::Tasks.new(
11 :base => File.dirname(__FILE__),
12 :env => ENV['ENV']
13 )
14 rescue Exception
15 end
16
17 desc "Generate gemspec"
18 task :gemspec do
19 File.open("#{Dir.pwd}/#{GEM_NAME}.gemspec", 'w') do |f|
20 f.write(GEM_SPEC.to_ruby)
21 end
22 end
23
24 desc "Install gem"
25 task :install do
26 Rake::Task['gem'].invoke
27 `sudo gem uninstall #{GEM_NAME} -x`
28 `sudo gem install pkg/#{GEM_NAME}*.gem`
29 `rm -Rf pkg`
30 end
31
32 desc "Package gem"
33 Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
34 pkg.gem_spec = GEM_SPEC
35 end
36
37 desc "Setup project"
38 task :setup do
39 name = File.basename(Dir.pwd)
40 `rm -Rf .git`
41 begin
42 dir = Dir['**/gem_template*']
43 from = dir.pop
44 if from
45 rb = from.include?('.rb')
46 to = File.dirname(from) + "/#{name}#{'.rb' if rb}"
47 FileUtils.mv(from, to)
48 end
49 end while dir.length > 0
50 Dir["**/*"].each do |path|
51 next if path.include?('Rakefile')
52 if File.file?(path)
53 `sed -i "" 's/gem_template/#{name}/g' #{path}`
54 end
55 end
56 `git init`
57 end
58
59 desc "Run specs"
60 Spec::Rake::SpecTask.new do |t|
61 t.rcov = true
62 t.spec_opts = ["--format", "specdoc", "--colour"]
63 t.spec_files = FileList["spec/**/*_spec.rb"]
64 end
Something went wrong with that request. Please try again.