forked from jejacks0n/teaspoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
54 lines (44 loc) · 1.55 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
#!/usr/bin/env rake
require "fileutils"
begin
require "bundler/setup"
rescue LoadError
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end
# Dummy App
# -----------------------------------------------------------------------------
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load "rails/tasks/engine.rake"
Bundler::GemHelper.install_tasks
# RSpec
# -----------------------------------------------------------------------------
load "rspec/rails/tasks/rspec.rake"
namespace :spec do
desc "Run the code examples in spec/features"
RSpec::Core::RakeTask.new("features") do |t|
t.pattern = "./spec/features/**/*_spec.rb"
end
end
# Teaspoon
# -----------------------------------------------------------------------------
desc "Run the javascript specs"
task :teaspoon => "app:teaspoon"
namespace :teaspoon do
desc "Builds Teaspoon into the distribution ready bundle"
task :build => "build:javascripts"
namespace :build do
desc "Compile coffeescripts into javacripts"
task :javascripts => :environment do
env = Rails.application.assets
%w(teaspoon/jasmine.js teaspoon/mocha.js teaspoon/qunit.js teaspoon/teaspoon.js).each do |path|
asset = env.find_asset(path)
asset.write_to(Teaspoon::Engine.root.join("app/assets/javascripts/#{path.gsub(/\//, "-")}"))
end
end
end
end
# Default
# -----------------------------------------------------------------------------
Rake::Task["default"].prerequisites.clear
Rake::Task["default"].clear
task :default => [:spec, :teaspoon]