mailcatcher/Rakefile

52 lines
1.3 KiB
Ruby
Raw Normal View History

require 'rubygems'
2013-03-11 19:19:40 -04:00
require 'rubygems/package'
require File.expand_path('../lib/mail_catcher/version', __FILE__)
2011-05-28 02:21:11 -04:00
spec_file = File.expand_path __FILE__ + '/../mailcatcher.gemspec'
spec = Gem::Specification.load spec_file
2011-05-28 02:21:11 -04:00
require 'rdoc/task'
2012-07-25 00:05:01 -04:00
RDoc::Task.new :rdoc => "doc",
:clobber_rdoc => "doc:clean",
:rerdoc => "doc:force" do |rdoc|
rdoc.title = "MailCatcher #{MailCatcher::VERSION}"
2012-07-25 00:05:01 -04:00
rdoc.rdoc_dir = 'doc'
2011-05-28 02:21:11 -04:00
rdoc.main = 'README.md'
rdoc.rdoc_files.include 'lib/**/*.rb'
end
desc "Compile SASS/SCSS files into SCSS"
task "build:sass" do
Dir["public/stylesheets/**/*.sass"].each do |file|
css_file = file.sub /\.sass$/, ".css"
system "sass", "--no-cache", "--compass", file, css_file
2011-05-28 02:21:11 -04:00
end
end
2011-05-29 00:41:02 -04:00
desc "Compile CoffeeScript files into JavaScript"
task "build:coffee" do
require 'coffee-script'
Dir["public/javascripts/**/*.coffee"].each do |file|
js_file = file.sub /\.coffee$/, ".js"
File.new(js_file, "w").write CoffeeScript.compile File.read file
end
end
2011-10-09 04:50:36 -04:00
multitask "build" => ["build:sass", "build:coffee"]
2011-05-28 02:21:11 -04:00
desc "Package as Gem"
task "package:gem" do
2013-03-11 19:19:40 -04:00
Gem::Package.build spec
2011-05-28 02:21:11 -04:00
end
task "package" => ["build", "package:gem"]
desc "Release Gem to RubyGems"
task "release:gem" do
%x[gem push mailcatcher-#{MailCatcher::VERSION}.gem]
2011-05-28 02:21:11 -04:00
end
task "release" => ["package", "release:gem"]
task "default" => "build"