Skip to content

Commit

Permalink
Load gcloud-rdoc in Gemfile
Browse files Browse the repository at this point in the history
Travis is having a hard time loading gcloud-rdoc, so let's try using bundler.
  • Loading branch information
blowmage committed Jun 10, 2015
1 parent 85e819b commit 0417e0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Gemfile.lock
coverage
doc
keyfile.json
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source "http://rubygems.org"

gemspec

gem "gcloud-rdoc", git: "https://github.com/GoogleCloudPlatform/gcloud-ruby.git", branch: "gcloud-rdoc"
25 changes: 5 additions & 20 deletions rakelib/gh-pages.rake
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,12 @@ namespace :pages do
end
end

desc "Installs the latest gcloud-rdoc gem"
task :install_gcloud_rdoc do
tmp = Pathname.new(Dir.home) + "tmp"
rdocgem = tmp + "gcloud-rdoc"
FileUtils.remove_dir rdocgem if Dir.exists? rdocgem
FileUtils.mkdir_p rdocgem

git_repo = "git@github.com:GoogleCloudPlatform/gcloud-ruby.git"
if ENV["GH_OAUTH_TOKEN"]
git_repo = "https://#{ENV["GH_OAUTH_TOKEN"]}@github.com/#{ENV["GH_OWNER"]}/#{ENV["GH_PROJECT_NAME"]}"
end

puts `git clone --quiet --branch=gcloud-rdoc #{git_repo} #{rdocgem} > /dev/null`
Dir.chdir rdocgem do
puts `rake gem`
puts `gem install pkg/gcloud-rdoc-*.gem`
end
end

RDoc::Task.new do |rdoc|
begin; require "gcloud-rdoc"; rescue LoadError; end
begin
require "gcloud-rdoc"
rescue LoadError
puts "Cannot load gcloud-rdoc"
end

require "rubygems"
spec = Gem::Specification::load("gcloud.gemspec")
Expand Down
1 change: 0 additions & 1 deletion rakelib/travis.rake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ namespace :travis do
if ENV["TRAVIS_BRANCH"] == "master" &&
ENV["TRAVIS_PULL_REQUEST"] == "false" &&
ENV["GCLOUD_BUILD_DOCS"] == "true"
Rake::Task["pages:install_gcloud_rdoc"].invoke
Rake::Task["pages:master"].invoke
end
end
Expand Down

0 comments on commit 0417e0e

Please sign in to comment.