-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile.rb
70 lines (58 loc) · 1.91 KB
/
Rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require 'rubygems'
require 'pathname'
require 'spec'
__DIR__ = Pathname.new(__FILE__).dirname
task :default => 'spec:all'
namespace :spec do
task :prepare do
@specs= Dir.glob("#{__DIR__}/spec/**/*.rb").join(' ')
end
task :all => :prepare do
system "spec #{@specs}"
end
task :doc => :prepare do
system "spec #{@specs} --format specdoc"
system "mv doc/* ../google_ajax_feed_api_docs -r"
end
end
task :cleanup do
Dir.glob("**/*.*~")+Dir.glob("**/*~").each{|swap|FileUtils.rm(swap, :force => true)}
end
namespace :gem do
task :version do
require 'lib/google_ajax_feed_api'
@version = Google::Ajax::Feed::Version
end
task :build => :spec do
load __DIR__ + "google_ajax_feed_api.gemspec"
Gem::Builder.new(@google_ajax_feed_api_gemspec).build
end
task :install => :build do
cmd = "gem install google_ajax_feed_api -l"
system cmd unless system "sudo #{cmd}"
FileUtils.rm(__DIR__ + "google_ajax_feed_api-#{@version}.gem")
end
task :spec => :version do
file = File.new(__DIR__ + "google_ajax_feed_api.gemspec", 'w+')
FileUtils.chmod 0755, __DIR__ + "google_ajax_feed_api.gemspec"
spec = %{
Gem::Specification.new do |s|
s.name = "google_ajax_feed_api"
s.version = "#{@version}"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.has_rdoc = true
s.summary = "Light wrapper for Google Ajax Feed API"
s.authors = ["Collin Miller"]
s.email = "[email protected]"
s.homepage = "http://github.com/collin/fold"
s.files = %w{#{(%w(README Rakefile.rb) + Dir.glob("{lib,spec}/**/*")).reject{|path| path.match /~$/ }.join(' ')}}
s.add_dependency "rake"
s.add_dependency "rspec"
s.add_dependency "json"
s.add_dependency "extlib"
end
}
@google_ajax_feed_api_gemspec = eval(spec)
file.write(spec)
end
end