-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (46 loc) · 1.44 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
require 'bundler/setup'
require "bundler/gem_tasks"
require 'rake/testtask'
require 'yard'
require_relative 'yard_ext/all'
require 'guard'
Dir.glob('tasks/*.rake').each { |r| load r}
Rake::TestTask.new do |t|
t.libs << 'test'
t.pattern = "test/*_test.rb"
end
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/skr/concerns/*.rb','lib/**/*.rb','db/schema.rb']
t.options = ["--title=Stockor Core Documentation",
"--markup=markdown",
"--template-path=yard_ext/templates",
"--readme=README.md"]
end
desc "Open an irb session preloaded with skr-core"
task :console do
require 'irb'
require 'irb/completion'
require 'pp'
require 'skr/core'
include Skr
Skr::Core::DB.establish_connection
ActiveRecord::Base.logger = Logger.new STDOUT
ARGV.clear
IRB.start
end
task :doc => 'db:environment' do
#env = ENV['RAILS_ENV'] || 'development'
ENV['SCHEMA'] = 'db/schema.rb'
ENV['DB_STRUCTURE'] = 'db/schema.rb'
Rake::Task["db:schema:dump"].invoke
Rake::Task["yard"].invoke
end
task :guard => [ 'db:migrate', 'db:test:clone_structure' ] do
# NAS: I've never figured out how to run Guard from a rake task
# Guard.setup
# Guard.run_all
# ^ this will work but only runs the task once
# and doesn't listen for changes. Which kinda defeats the purpose
# For now just shell out until I can figure it out
sh "bundle exec guard"
end