Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 77 lines (63 sloc) 2.01 kB
2895bb2 @banister first commit
authored
1 dlext = Config::CONFIG['DLEXT']
2 direc = File.dirname(__FILE__)
3
4 require 'rake/clean'
5 require 'rake/gempackagetask'
6 require "#{direc}/lib/method_source/version"
7
8 CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
9 CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
534fd83 @banister version 0.6.0pre1. added *.rbc files to CLEAN task
authored
10 "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*.rbc",
2895bb2 @banister first commit
authored
11 "ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake")
12
13 def apply_spec_defaults(s)
14 s.name = "method_source"
15 s.summary = "retrieve the sourcecode for a method"
16 s.version = MethodSource::VERSION
17 s.date = Time.now.strftime '%Y-%m-%d'
18 s.author = "John Mair (banisterfiend)"
19 s.email = 'jrmair@gmail.com'
20 s.description = s.summary
21 s.require_path = 'lib'
534fd83 @banister version 0.6.0pre1. added *.rbc files to CLEAN task
authored
22
82a14ee @banister updated Rakefile for travis
authored
23 s.add_development_dependency("bacon","~>1.1.0")
e05c921 @banister added gemspec and updated Rakefile
authored
24 s.add_development_dependency("rake", "~>0.9")
2895bb2 @banister first commit
authored
25 s.homepage = "http://banisterfiend.wordpress.com"
26 s.has_rdoc = 'yard'
e05c921 @banister added gemspec and updated Rakefile
authored
27 s.files = `git ls-files`.split("\n")
28 s.test_files = `git ls-files -- test/*`.split("\n")
2895bb2 @banister first commit
authored
29 end
30
31 task :test do
e05c921 @banister added gemspec and updated Rakefile
authored
32 sh "bacon -q #{direc}/test/test.rb"
2895bb2 @banister first commit
authored
33 end
34
7bd1f9b @banister version 0.7.1
authored
35 desc "reinstall gem"
36 task :reinstall => :gems do
37 sh "gem uninstall method_source" rescue nil
38 sh "gem install #{direc}/pkg/method_source-#{MethodSource::VERSION}.gem"
39 end
40
82a14ee @banister updated Rakefile for travis
authored
41 desc "Set up and run tests"
42 task :default => [:test]
43
2895bb2 @banister first commit
authored
44 namespace :ruby do
45 spec = Gem::Specification.new do |s|
534fd83 @banister version 0.6.0pre1. added *.rbc files to CLEAN task
authored
46 apply_spec_defaults(s)
2895bb2 @banister first commit
authored
47 s.platform = Gem::Platform::RUBY
48 end
534fd83 @banister version 0.6.0pre1. added *.rbc files to CLEAN task
authored
49
2895bb2 @banister first commit
authored
50 Rake::GemPackageTask.new(spec) do |pkg|
51 pkg.need_zip = false
52 pkg.need_tar = false
53 end
e05c921 @banister added gemspec and updated Rakefile
authored
54
55 desc "Generate gemspec file"
56 task :gemspec do
57 File.open("#{spec.name}.gemspec", "w") do |f|
58 f << spec.to_ruby
59 end
60 end
2895bb2 @banister first commit
authored
61 end
62
63 desc "build all platform gems at once"
64 task :gems => [:rmgems, "ruby:gem"]
65
66 desc "remove all platform gems"
67 task :rmgems => ["ruby:clobber_package"]
68
69 desc "build and push latest gems"
70 task :pushgems => :gems do
71 chdir("#{direc}/pkg") do
72 Dir["*.gem"].each do |gemfile|
73 sh "gem push #{gemfile}"
74 end
75 end
76 end
Something went wrong with that request. Please try again.