forked from jejacks0n/apitome
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
83 lines (67 loc) · 2.38 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
#!/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"
begin
Bundler::GemHelper.install_tasks
rescue RuntimeError
Bundler::GemHelper.install_tasks name: "teaspoon"
end
# CODECLIMATE_REPO_TOKEN=5b15ecf8b9008ee8c4718712fd7b27f2fe9e7a758605ac86b56e04925c5cb511
# RSpec
# -----------------------------------------------------------------------------
load "rspec/rails/tasks/rspec.rake"
namespace :spec do
desc "Run the unit code examples"
RSpec::Core::RakeTask.new(:unit) do |t|
file_list = FileList["spec/**/*_spec.rb"]
%w(features).each do |exclude|
file_list = file_list.exclude("spec/#{exclude}/**/*_spec.rb")
end
t.pattern = file_list
end
desc "Run the code examples in teaspoon-jasmine/spec"
RSpec::Core::RakeTask.new(:jasmine) do |t|
t.pattern = "../teaspoon-jasmine/spec/**/*_spec.rb"
end
desc "Run the code examples in teaspoon-mocha/spec"
RSpec::Core::RakeTask.new(:mocha) do |t|
t.pattern = "../teaspoon-mocha/spec/**/*_spec.rb"
end
desc "Run the code examples in teaspoon-qunit/spec"
RSpec::Core::RakeTask.new(:qunit) do |t|
t.pattern = "../teaspoon-qunit/spec/**/*_spec.rb"
end
end
# Apitome
# -----------------------------------------------------------------------------
namespace :apitome do
task build: ["build:javascripts", "build:stylesheets"]
desc "Combine and bundle javascripts"
task javascripts: :environment do
env = Rails.application.assets
root = Apitome::Engine.root.join("app/assets")
puts "Building javascripts..."
asset = env.find_asset("apitome/application.js")
asset.write_to(root.join("javascripts/apitome", "bundle.js"))
end
task stylesheets: :environment do
env = Rails.application.assets
root = Apitome::Engine.root.join("app/assets")
puts "Building stylesheets..."
asset = env.find_asset("apitome/application.css")
asset.write_to(root.join("stylesheets/apitome", "bundle.css"))
end
end
# Default
# -----------------------------------------------------------------------------
Rake::Task["default"].prerequisites.clear
Rake::Task["default"].clear
task default: [:spec]