Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 65 lines (51 sloc) 1.747 kB
45dccf5 @mynyml Initial functionality.
authored
1 # --------------------------------------------------
2 # tasks mostly copied from thin's Rakefile
3 # http://github.com/macournoyer/thin/tree/master
4 # --------------------------------------------------
5 require 'rake/gempackagetask'
6 require 'pathname'
7 require 'yaml'
8
9 RUBY_1_9 = RUBY_VERSION =~ /^1\.9/
10 WIN = (RUBY_PLATFORM =~ /mswin|cygwin/)
11 SUDO = (WIN ? "" : "sudo")
12 ROOT = Pathname(__FILE__).dirname.expand_path
13
14 def gem
15 RUBY_1_9 ? 'gem19' : 'gem'
16 end
17
18 def all_except(paths)
19 Dir['**/*'] - paths.map {|path| path.strip.gsub(/^\//,'').gsub(/\/$/,'') }
20 end
21
22 def gitignored
23 ROOT.join('.gitignore').read.strip.split("\n").compact.map {|line| line.strip }
24 end
25
26 spec = Gem::Specification.new do |s|
27 s.name = 'simple_example'
28 s.version = '0.1'
8829696 @mynyml Update gem description.
authored
29 s.summary = "Add easy fancy-pants examples to your projects."
30 s.description = "Add easy fancy-pants examples to your projects."
45dccf5 @mynyml Initial functionality.
authored
31 s.author = "Martin Aumont"
32 s.email = 'mynyml@gmail.com'
33 s.homepage = ''
34 s.has_rdoc = true
35 s.require_path = "lib"
7b28611 @mynyml Update Rakefile
authored
36 s.files = all_except(gitignored << 'generate_examples_results.rb')
45dccf5 @mynyml Initial functionality.
authored
37
38 s.add_dependency 'ruby2ruby'
39 s.add_dependency 'ParseTree'
40 end
41
42 Rake::GemPackageTask.new(spec) do |p|
43 p.gem_spec = spec
44 end
45
46
47 desc "Remove package products"
48 task :clean => :clobber_package
49
50 desc "Update the gemspec for GitHub's gem server"
51 task :gemspec do
52 Pathname("#{spec.name}.gemspec").open('w') {|f| f << YAML.dump(spec) }
53 end
54
55 desc "Install gem"
56 task :install => [:clobber, :package] do
57 sh "#{SUDO} #{gem} install pkg/#{spec.full_name}.gem"
58 end
59
60 desc "Uninstall gem"
61 task :uninstall => :clean do
62 sh "#{SUDO} #{gem} uninstall -v #{spec.version} -x #{spec.name}"
63 end
64
Something went wrong with that request. Please try again.