forked from weppos/tabs_on_rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
98 lines (77 loc) · 3 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
87
88
89
90
91
92
93
94
95
96
97
98
require 'rubygems'
require 'rubygems/package_task'
require 'bundler'
require 'rake/testtask'
require 'rdoc/task'
$:.unshift(File.dirname(__FILE__) + '/lib')
require 'tabs_on_rails/version'
PKG_NAME = ENV['PKG_NAME'] || "tabs_on_rails"
PKG_VERSION = ENV['PKG_VERSION'] || TabsOnRails::VERSION
if ENV['SNAPSHOT'].to_i == 1
PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
end
# Run test by default.
task :default => :test
# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
# http://rubygems.org/read/chapter/20
#
spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.summary = "A simple Ruby on Rails plugin for creating tabs and navigation menus."
s.description = "TabsOnRails is a simple Rails plugin for creating tabs and navigation menus."
s.author = "Simone Carletti"
s.email = "[email protected]"
s.homepage = "http://www.simonecarletti.com/code/tabs_on_rails"
# You should probably have a README of some kind. Change the filename
# as appropriate
s.extra_rdoc_files = Dir.glob("*.rdoc")
s.rdoc_options = %w(--main README.rdoc)
# Add any extra files to include in the gem (like your README)
s.files = %w( Rakefile LICENSE init.rb .gemtest ) + Dir.glob("*.{rdoc,gemspec}") + Dir.glob("{lib,test,rails}/**/*")
s.require_paths = %w( lib )
s.add_development_dependency("bundler")
s.add_development_dependency("hanna-nouveau")
s.add_development_dependency("rails", "~> 3.0.6")
s.add_development_dependency("mocha", "~> 0.9.10")
end
# This task actually builds the gem. We also regenerate a static
# .gemspec file, which is useful if something (i.e. GitHub) will
# be automatically building a gem for this project. If you're not
# using GitHub, edit as appropriate.
Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Build the gemspec file #{spec.name}.gemspec"
task :gemspec do
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
File.open(file, "w") {|f| f << spec.to_ruby }
end
desc "Remove any temporary products, including gemspec"
task :clean => [:clobber] do
rm "#{spec.name}.gemspec"
end
desc "Remove any generated file"
task :clobber => [:clobber_rdoc, :clobber_rcov, :clobber_package]
desc "Package the library and generates the gemspec"
task :package => [:gemspec]
# Run all the tests in the /test folder
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
end
# Generate documentation
RDoc::Task.new do |rdoc|
rdoc.main = "README.rdoc"
rdoc.rdoc_files.include("*.rdoc", "lib/**/*.rb")
rdoc.rdoc_dir = "rdoc"
rdoc.generator = 'hanna'
end
desc "Publish documentation to the site"
task :publish_rdoc => [:clobber_rdoc, :rdoc] do
ENV["username"] || raise(ArgumentError, "Missing ssh username")
sh "rsync -avz --delete rdoc/ #{ENV["username"]}@code:/var/www/apps/code/#{PKG_NAME}/api"
end