-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #813 from blowmage/individual-packages
Modularize into separate gems [closes #341]
- Loading branch information
Showing
532 changed files
with
8,193 additions
and
5,772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
source "http://rubygems.org" | ||
|
||
gemspec | ||
gem "rake" | ||
gem "minitest", "~> 5.9" | ||
gem "minitest-autotest", "~> 1.0" | ||
gem "minitest-focus", "~> 1.1" | ||
gem "minitest-rg", "~> 5.2" | ||
gem "autotest-suffix", "~> 1.1" | ||
gem "rubocop", "<= 0.35.1" | ||
gem "simplecov", "~> 0.9" | ||
gem "coveralls", "~> 0.7" | ||
gem "yard", "~> 0.9" | ||
|
||
# TODO: unpin rake after YARD (and other tasks) no longer depend on last_comment | ||
gem "rake", "~> 10.0" | ||
|
||
gem "gcloud-rdoc", | ||
git: "https://github.com/GoogleCloudPlatform/gcloud-ruby.git", | ||
branch: "gcloud-rdoc" | ||
gem "yard-gcloud", | ||
git: "https://github.com/GoogleCloudPlatform/gcloud-ruby.git", | ||
branch: "yard-gcloud" | ||
gem "gcloud-jsondoc", | ||
git: "https://github.com/GoogleCloudPlatform/gcloud-ruby.git", | ||
branch: "gcloud-jsondoc" | ||
gem "google-cloud-core", path: "google-cloud-core" | ||
gem "google-cloud-bigquery", path: "google-cloud-bigquery" | ||
gem "google-cloud-datastore", path: "google-cloud-datastore" | ||
gem "google-cloud-dns", path: "google-cloud-dns" | ||
gem "google-cloud-logging", path: "google-cloud-logging" | ||
gem "google-cloud-pubsub", path: "google-cloud-pubsub" | ||
gem "google-cloud-resource_manager", path: "google-cloud-resource_manager" | ||
gem "google-cloud-storage", path: "google-cloud-storage" | ||
gem "google-cloud-translate", path: "google-cloud-translate" | ||
gem "google-cloud-vision", path: "google-cloud-vision" | ||
gem "google-cloud", path: "google-cloud" | ||
gem "gcloud", path: "gcloud" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,211 @@ | ||
require "bundler/gem_tasks" | ||
require "bundler/setup" | ||
|
||
require "rake/testtask" | ||
Rake::TestTask.new(:test) do |test| | ||
test.warning = true | ||
test.libs << "test" | ||
test.pattern = "test/**/*_test.rb" | ||
task :bundleupdate do | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "BUNDLE UPDATE FOR #{gem}" | ||
sh "bundle update" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs rubocop, jsodoc, and tests for all gems individually." | ||
task :each, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "RUBOCOP, JSONDOC, TESTS FOR #{gem}" | ||
sh "bundle exec rake rubocop" | ||
sh "bundle exec rake jsondoc" | ||
sh "bundle exec rake test" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs tests for all gems." | ||
task :test do | ||
gems.each do |gem| | ||
$LOAD_PATH.unshift "#{gem}/lib", "#{gem}/test" | ||
Dir.glob("#{gem}/test/**/*_test.rb").each { |file| require_relative file } | ||
$LOAD_PATH.delete "#{gem}/lib" | ||
$LOAD_PATH.delete "#{gem}/test" | ||
end | ||
end | ||
|
||
namespace :test do | ||
desc "Runs tests for all gems individually." | ||
task :each, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "RUNNING TESTS FOR #{gem}" | ||
sh "bundle exec rake test" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs tests with coverage for all gems." | ||
task :coverage do | ||
FileUtils.remove_dir "coverage", force: true | ||
FileUtils.mkdir "coverage" | ||
|
||
require "simplecov" | ||
SimpleCov.start do | ||
command_name :coverage | ||
track_files "lib/**/*.rb" | ||
add_filter "test/" | ||
gems.each { |gem| add_group gem, "#{gem}/lib" } | ||
end | ||
|
||
header "Running tests and coverage report" | ||
Rake::Task["test"].invoke | ||
end | ||
|
||
desc "Runs coveralls report for all gems." | ||
task :coveralls do | ||
require "simplecov" | ||
require "coveralls" | ||
SimpleCov.formatter = Coveralls::SimpleCov::Formatter | ||
|
||
Rake::Task["test:coverage"].invoke | ||
end | ||
end | ||
|
||
desc "Runs acceptance tests for all gems." | ||
task :acceptance do | ||
gems.each do |gem| | ||
$LOAD_PATH.unshift "#{gem}/lib", "#{gem}/acceptance" | ||
Dir.glob("#{gem}/acceptance/**/*_test.rb").each { |file| require_relative file } | ||
$LOAD_PATH.delete "#{gem}/lib" | ||
$LOAD_PATH.delete "#{gem}/acceptance" | ||
end | ||
end | ||
|
||
namespace :acceptance do | ||
desc "Runs acceptance tests for all gems individually." | ||
task :each, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "ACCEPTANCE TESTS FOR #{gem}" | ||
sh "bundle exec rake acceptance" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs acceptance tests with coverage for all gems." | ||
task :coverage do | ||
FileUtils.remove_dir "coverage", force: true | ||
FileUtils.mkdir "coverage" | ||
|
||
require "simplecov" | ||
SimpleCov.start do | ||
command_name :coverage | ||
track_files "lib/**/*.rb" | ||
add_filter "acceptance/" | ||
gems.each { |gem| add_group gem, "#{gem}/lib" } | ||
end | ||
|
||
header "Running acceptance tests and coverage report" | ||
Rake::Task["acceptance"].invoke | ||
end | ||
|
||
desc "Runs acceptance:cleanup for all gems." | ||
task :cleanup, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
gems.each do |gem| | ||
cd gem do | ||
Bundler.with_clean_env do | ||
sh "bundle exec rake acceptance:cleanup" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs rubocop report for all gems individually." | ||
task :rubocop, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
header "Running rubocop reports" | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "RUBOCOP REPORT FOR #{gem}" | ||
sh "bundle exec rake rubocop" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Runs jsondoc report for all gems individually." | ||
task :jsondoc, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Rake::Task["bundleupdate"].invoke if bundleupdate | ||
header "Running jsondoc reports" | ||
gems.each do |gem| | ||
Dir.chdir gem do | ||
Bundler.with_clean_env do | ||
header "JSONDOC FOR #{gem}" | ||
sh "bundle exec rake jsondoc" | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "Start an interactive shell." | ||
task :console, :bundleupdate do |t, args| | ||
bundleupdate = args[:bundleupdate] | ||
Dir.chdir "google-cloud" do | ||
Bundler.with_clean_env do | ||
sh "bundle update" if bundleupdate | ||
sh "bundle exec rake console" | ||
end | ||
end | ||
end | ||
|
||
desc "Runs tests and reports for CI." | ||
task :travis do | ||
Rake::Task["bundleupdate"].invoke | ||
Rake::Task["rubocop"].invoke | ||
Rake::Task["jsondoc"].invoke | ||
Rake::Task["test:coveralls"].invoke | ||
|
||
if ENV["TRAVIS_BRANCH"] == "master" && | ||
ENV["TRAVIS_PULL_REQUEST"] == "false" | ||
header "Preparing to run acceptance tests" | ||
# Decrypt the keyfile | ||
`openssl aes-256-cbc -K $encrypted_629ec55f39b2_key -iv $encrypted_629ec55f39b2_iv -in keyfile.json.enc -out keyfile.json -d` | ||
|
||
Rake::Task["acceptance"].invoke | ||
else | ||
header "Skipping acceptance tests" | ||
end | ||
end | ||
|
||
def gems | ||
`git ls-files -- */*.gemspec`.split("\n").map { |gem| gem.split("/").first }.sort | ||
end | ||
|
||
def header str | ||
line_length = str.length + 8 | ||
puts "" | ||
puts "#" * line_length | ||
puts "### #{str} ###" | ||
puts "#" * line_length | ||
puts "" | ||
end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
google-cloud-storage/acceptance/data |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Gemfile.lock | ||
keyfile.json | ||
coverage/* | ||
doc/* | ||
pkg/* | ||
html/* | ||
jsondoc/* | ||
|
||
# Ignore vagrant directory | ||
.vagrant | ||
|
||
# Ignore YARD stuffs | ||
.yardoc | ||
|
||
# directories left by gh-pages | ||
_site/* |
Oops, something went wrong.