-
Notifications
You must be signed in to change notification settings - Fork 555
/
Copy pathRakefile
57 lines (45 loc) · 1.22 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 "rubocop/rake_task"
RuboCop::RakeTask.new
task :test do
$LOAD_PATH.unshift "lib", "test"
Dir.glob("test/**/*_test.rb").each { |file| require_relative file }
end
namespace :test do
desc "Runs tests with coverage."
task :coverage do
require "simplecov"
SimpleCov.start do
command_name "google-cloud"
track_files "lib/**/*.rb"
add_filter "test/"
end
Rake::Task["test"].invoke
end
end
desc "Start an interactive shell."
task :console do
require "irb"
require "irb/completion"
require "pp"
$LOAD_PATH.unshift "lib"
require "google/cloud"
Bundler.require # load all the gems defined in the Gemfile
def gcloud; @gcloud ||= Google::Cloud.new; end
ARGV.clear
IRB.start
end
require "yard"
require "yard/rake/yardoc_task"
YARD::Rake::YardocTask.new
desc "Generates JSON output from google-cloud .yardoc"
task :jsondoc => :yard do
require "rubygems"
require "gcloud/jsondoc"
registry = YARD::Registry.load! ".yardoc"
generator = Gcloud::Jsondoc::Generator.new registry, "google-cloud"
generator.write_to "jsondoc"
cp ["docs/authentication.md", "docs/toc.json"], "jsondoc", verbose: true
end
task :default => :test