Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularize into separate gems #813

Merged
merged 26 commits into from
Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3083f45
Separate Gcloud to a new gem package
blowmage Jul 26, 2016
fc33f88
Create new google-cloud-core gem package
blowmage Jul 26, 2016
ff7d9ba
Create new google-cloud-bigquery gem package
blowmage Jul 26, 2016
2d49298
Create new google-cloud-storage gem package
blowmage Jul 27, 2016
d2dd248
Create new google-cloud-datastore gem package
blowmage Jul 27, 2016
e6b3043
Create new google-cloud-dns gem package
blowmage Jul 28, 2016
2ac11d9
Create new google-cloud-logging gem package
blowmage Jul 28, 2016
62545e7
Create new google-cloud-pubsub gem package
blowmage Jul 28, 2016
95bba19
Create new google-cloud-resource_manager gem package
blowmage Jul 28, 2016
333c697
Create new google-cloud-translate gem package
blowmage Jul 28, 2016
b981ff5
Create new google-cloud-vision gem package
blowmage Jul 28, 2016
08cb498
Add console task to individual gems
blowmage Jul 28, 2016
c189832
Revise top-level test and travis tasks
blowmage Jul 28, 2016
608b047
Remove unneeded generated protobuf files
blowmage Jul 29, 2016
e4a204b
Add top-level acceptance and rubocop tasks
blowmage Jul 29, 2016
fbfd502
Add README and CHANGELOG to gems
blowmage Jul 29, 2016
52e7d0e
Add acceptance:coverage task
blowmage Jul 29, 2016
5e5862b
Add jsondoc tasks
blowmage Aug 1, 2016
bc6d0dd
Add each task to run rubocop, jsondoc, and tests
blowmage Aug 1, 2016
7ffaf3c
Add top-level console task
blowmage Aug 2, 2016
39714cc
Speed up tasks run across individual gems
blowmage Aug 2, 2016
2c7ddd8
Add coverage to service factory methods
blowmage Aug 2, 2016
99da253
Remove Vision implicit conversion methods
blowmage Aug 2, 2016
8e4fc9b
Add additional Logging test coverage
blowmage Aug 2, 2016
6bd18fb
Refactor error handling in GAPI service classes
blowmage Aug 2, 2016
861ae4f
Fix Resource Manager factory test
blowmage Aug 3, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@ rvm:
- 2.0.0-p648
script:
- bundle exec rake travis
after_success:
- bundle exec rake travis:pages
matrix:
include:
- rvm: 2.3.1
env: GCLOUD_BUILD_DOCS=true
deploy:
provider: rubygems
api_key:
secure: CTbGzuCCZt4Zf3QrUjc3USK8ac205pfc81oZlTEiNnIWVexKxUuCk8JJZnTBhDFylLgKD+hoIbBii4iq1El1quUqk3VAwohUotUFKAVgle4IGSmO71beUj63x2GyY39SGK0r9ZGHVE6WC0oVu3i5wSklgxhMsREAYt872m0xDNE=
gem: gcloud
on:
tags: true
repo: GoogleCloudPlatform/gcloud-ruby
notifications:
slack:
secure: Ksji5MDNOWnuzuyu9Hblbxse6kGLdH4kXyYkF98C+wawIGLSONWWkuA65wpdqSLtBN/79RCLMWoBzKAGX4xy9BL6Rxb3rLjAMT+FVur6II2yaApzyJ0dmTVeTXnkchPcrO27FK5taPb0Ghr86DUiG3OViY/q1N0AVALDYce5tfE=
20 changes: 0 additions & 20 deletions .yardopts

This file was deleted.

35 changes: 22 additions & 13 deletions Gemfile
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"
213 changes: 207 additions & 6 deletions Rakefile
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
1 change: 1 addition & 0 deletions acceptance/data/data
44 changes: 0 additions & 44 deletions gcloud.gemspec

This file was deleted.

File renamed without changes.
16 changes: 16 additions & 0 deletions gcloud/.gitignore
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/*
Loading