forked from jmhodges/rack-oauth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
67 lines (59 loc) · 1.93 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
require 'rake'
require 'rubygems'
require 'rake/rdoctask'
require 'spec/rake/spectask'
puts "\nGem: rack-oauth\n\n"
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = 'rack-oauth'
s.summary = 'Rack Middleware for OAuth Authorization'
s.email = 'remi@remitaylor.com'
s.homepage = 'http://github.com/remi/rack-oauth'
s.description = 'Rack Middleware for OAuth Authorization'
s.authors = %w( remi )
s.files = FileList['[A-Z]*', '{lib,spec,bin,examples}/**/*']
s.add_dependency 'oauth'
s.add_dependency 'rack'
s.extra_rdoc_files = %w( README.rdoc )
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
end
desc "Run all examples with RCov"
Spec::Rake::SpecTask.new('rcov') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
end
# require 'hanna'
# require 'darkfish-rdoc'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'rack-oauth'
rdoc.options << '--line-numbers' << '--inline-source'
# rdoc.options += ["--template=#{`allison --path`}"] # sudo gem install allison
# rdoc.options += %w( -f darkfish ) # sudo gem install darkfish-rdoc
# rdoc.options += %w( -T hanna ) # sudo gem install mislav-hanna
rdoc.options += %w( -m README.rdoc ) # the initial page displayed
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc 'Confirm that gemspec is $SAFE'
task :safe do
require 'yaml'
require 'rubygems/specification'
data = File.read('rack-oauth.gemspec')
spec = nil
if data !~ %r{!ruby/object:Gem::Specification}
Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
else
spec = YAML.load(data)
end
spec.validate
puts spec
puts "OK"
end
task :default => :spec