-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
70 lines (61 loc) · 1.78 KB
/
Rakefile
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
$:.unshift File.dirname(__FILE__) + '/lib'
require 'rubygems'
require 'twitpic'
require 'spec/rake/spectask'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'
name = 'twitpic'
version = TwitPic::VERSION
spec = Gem::Specification.new do |s|
s.name = name
s.version = version
s.summary = "Library for TwitPic API."
s.description = "Library for TwitPic API."
s.files = %w(Rakefile README.rdoc History.txt) + Dir.glob("{bin,lib,spec}/**/*")
s.add_dependency("mime-types", ">= 1.15")
s.add_dependency("highline", ">= 1.5.1")
s.add_dependency("rubytter", ">= 0.8.0")
s.executables = ["twitpic"]
s.authors = %w(jugyo)
s.email = '[email protected]'
s.homepage = 'http://github.com/jugyo/twitpic'
s.rubyforge_project = 'twitpic'
s.has_rdoc = true
s.rdoc_options = ["--main", "README.rdoc", "--exclude", "spec"]
s.extra_rdoc_files = ["README.rdoc", "History.txt"]
end
Rake::GemPackageTask.new(spec) do |p|
p.need_tar = true
end
task :gemspec do
filename = "#{name}.gemspec"
open(filename, 'w') do |f|
f.write spec.to_ruby
end
puts <<-EOS
Successfully generated gemspec
Name: #{name}
Version: #{version}
File: #{filename}
EOS
end
task :install => [ :package ] do
sh %{sudo gem install pkg/#{name}-#{version}.gem}
end
task :uninstall => [ :clean ] do
sh %{sudo gem uninstall #{name}}
end
desc 'run all specs'
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['-c']
end
Rake::RDocTask.new do |t|
t.rdoc_dir = 'rdoc'
t.title = "rest-client, fetch RESTful resources effortlessly"
t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
t.options << '--charset' << 'utf-8'
t.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
end
CLEAN.include [ 'pkg', 'rdoc' ]