-
Notifications
You must be signed in to change notification settings - Fork 10
/
Rakefile
86 lines (76 loc) · 1.98 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# vim: fileencoding=utf-8
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rubygems/package_task'
require 'rake/task'
require 'rake/contrib/rubyforgepublisher'
require 'rake/contrib/sshpublisher'
require 'fileutils'
require './lib/jsonschema'
include FileUtils
$version = JSON::Schema::VERSION
$readme = 'README.rdoc'
$rdoc_opts = %W(--main #{$readme} --charset utf-8 --line-numbers --inline-source)
$name = 'jsonschema'
$github_name = 'ruby-jsonschema'
$summary = 'json schema library ruby porting from http://code.google.com/p/jsonschema/'
$author = 'Constellation'
$email = 'utatane.tea@gmail.com'
$page = 'http://github.com/Constellation/ruby-jsonchema/tree/master'
#$exec = %W(jsonschema)
$rubyforge_project = 'jsonschema'
task :default => [:test]
task :package => [:clean]
Rake::TestTask.new("test") do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = true
end
spec = Gem::Specification.new do |s|
s.name = $name
s.version = $version
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = [$readme]
s.rdoc_options += $rdoc_opts
s.summary = $summary
s.description = $summary
s.author = $author
s.email = $email
s.homepage = $page
s.executables = $exec
s.rubyforge_project = $rubyforge_project
# s.bindir = 'bin'
s.require_path = 'lib'
s.test_files = Dir["test/*_test.rb"]
# {
# }.each do |dep, ver|
# s.add_dependency(dep, ver)
# end
s.files = %w(README.rdoc Rakefile) + Dir["{bin,test,lib}/**/*"]
end
Gem::PackageTask.new(spec) do |p|
p.need_tar = true
p.gem_spec = spec
end
desc "gem spec"
task :gemspec do
File.open("#{$github_name}.gemspec", "wb") do |f|
f << spec.to_ruby
end
end
desc "gem build"
task :build => [:gemspec] do
sh "gem build #{$github_name}.gemspec"
end
desc "gem install"
task :install => [:build] do
sh "sudo gem install #{$name}-#{$version}.gem --local"
end
desc "gem uninstall"
task :uninstall do
sh "sudo gem uninstall #{$name}"
end
# vim: syntax=ruby