Skip to content

Commit

Permalink
Merge pull request #43 from rightscale/CM-2080_fix_broken_specs_etc
Browse files Browse the repository at this point in the history
CM-2080_fix_broken_specs_etc
  • Loading branch information
smessier committed Mar 9, 2016
2 parents b68291f + e1de1f4 commit 1a3a330
Show file tree
Hide file tree
Showing 22 changed files with 256 additions and 175 deletions.
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
.bundle
.idea
pkg
tags
.emacs-project
config/environment.rb
fulllib
TAGS
doc
.rvmrc
.bundle/
vendor/
pkg/
measurement/
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.3-p448
2.1.8
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: ruby
rvm:
- 2.1.8
cache: bundler
branches:
only:
- master
env:
global:
- RACK_ENV=integration
install:
- bundle check --path=vendor/bundle || (rm -rf vendor && bundle package --all && bundle install --local --jobs=8 --retry=8 --without debugger --path=vendor/bundle)
script:
- bundle exec rake spec
cache:
directories:
- vendor
22 changes: 10 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
source 'http://s3.amazonaws.com/rightscale_rightlink_gems_dev'
source 'https://rubygems.org'

gemspec

gem 'right_git'
gem 'right_popen', '~> 2.0'

gem 'rake', '0.8.7'
gem 'right_support', '2.7'
gem 'right_popen'
gem 'right_support', '~> 2.8'

group :development do
# Omit these from gemspec since many RubyGems versions are silly and install development
# dependencies even when dong 'gem install'
# Omit these from gemspec since many RubyGems versions are silly and install
# development dependencies even when doing 'gem install'
gem 'rake'
gem 'rspec', '~> 2.0'
gem 'flexmock', '~> 0.9'
gem 'rtags', '~> 0.97'
gem 'right_develop'
end

# not friendly on daemon server due to lack of installed libs.
gem 'ruby-debug', :platform => :ruby_18
gem 'ruby-debug19', :platform => :ruby_19
gem 'rdoc', '~> 2.4'
group :debugger do
gem 'pry'
gem 'pry-byebug'
end
99 changes: 48 additions & 51 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,73 +1,70 @@
PATH
remote: .
specs:
right_scraper (4.0.5)
json (~> 1.4)
right_scraper (5.0.1)
right_aws (>= 2.0)
right_git
right_popen (~> 2.0)
right_support (~> 2.6)
right_popen
right_support (~> 2.8)

GEM
remote: http://s3.amazonaws.com/rightscale_rightlink_gems_dev/
remote: https://rubygems.org/
specs:
archive-tar-minitar (0.5.2)
columnize (0.3.6)
diff-lcs (1.1.3)
builder (3.2.2)
byebug (8.2.2)
coderay (1.1.1)
diff-lcs (1.2.5)
flexmock (0.9.0)
json (1.8.1)
linecache (0.46)
rbx-require-relative (> 0.0.4)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
rake (0.8.7)
rbx-require-relative (0.0.9)
rdoc (2.5.11)
method_source (0.8.2)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-byebug (3.3.0)
byebug (~> 8.0)
pry (~> 0.10)
rack (1.6.4)
rake (10.5.0)
right_aws (3.1.0)
right_http_connection (>= 1.2.5)
right_git (0.0.3)
right_http_connection (1.4.0)
right_popen (2.0.0)
right_support (2.7.0)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.2)
rtags (0.97)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
right_develop (3.1.12)
builder (~> 3.0)
rack
right_aws (>= 2.1.0)
right_git (>= 1.0)
right_support (>= 2.8.31, < 3.0.0)
trollop (>= 1.0, < 3.0)
right_git (1.1.2)
right_support (>= 2.8.10)
right_http_connection (1.5.0)
right_popen (3.0.1)
right_support (2.9.3)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.4)
slop (3.6.0)
trollop (2.1.2)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
flexmock (~> 0.9)
rake (= 0.8.7)
rdoc (~> 2.4)
pry
pry-byebug
rake
right_develop
right_git
right_popen (~> 2.0)
right_popen
right_scraper!
right_support (= 2.7)
right_support (~> 2.8)
rspec (~> 2.0)
rtags (~> 0.97)
ruby-debug
ruby-debug19

BUNDLED WITH
1.11.2
62 changes: 3 additions & 59 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#-- -*-ruby-*-
# Copyright: Copyright (c) 2010-2011 RightScale, Inc.
# Copyright: Copyright (c) 2010-2016 RightScale, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand All @@ -22,68 +22,12 @@
#++

require 'rubygems'
require 'rubygems/package_task'
require 'bundler/setup'

require 'fileutils'
require 'rake'
require 'rspec/core/rake_task'
require 'rdoc/task'
require 'rake/clean'

task :default => 'spec'
::Dir['tasks/**/*.rake'].each { |path| load path }

# == Gem packaging == #

desc "Build right_scraper gem"
Gem::PackageTask.new(Gem::Specification.load("right_scraper.gemspec")) do |package|
package.need_zip = true
package.need_tar = true
end

CLEAN.include('pkg')

# == Unit Tests == #

task :specs => :spec

# == Unit Tests == #

desc 'Run unit tests'
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = ["--color", "--format", "nested"]
end

namespace :spec do
desc "Run unit tests with RCov"
RSpec::Core::RakeTask.new(:rcov) do |t|
t.pattern = '*/spec/**/*_spec.rb'
t.rcov = true
t.rcov_opts = %q[--exclude "spec"]
end

desc "Print Specdoc for unit tests"
RSpec::Core::RakeTask.new(:doc) do |t|
t.pattern = '*/spec/**/*_spec.rb'
t.rspec_opts = ["--format", "documentation"]
end
end

# == Documentation == #

desc "Generate API documentation to doc/rdocs/index.html"
RDoc::Task.new do |rd|
rd.rdoc_dir = 'doc/rdocs'
rd.main = 'README.rdoc'
rd.rdoc_files.include 'README.rdoc', 'lib/**/*.rb'

rd.options << '--all'
rd.options << '--diagram'
end

# == Emacs integration == #
desc "Rebuild TAGS file"
task :tags do
sh "rtags -R */{lib,spec}"
end
task :default => :spec
2 changes: 1 addition & 1 deletion lib/right_scraper/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

module RightScraper
# for gemspec, etc.
GEM_VERSION = '4.0.5'
GEM_VERSION = '5.0.1'

# (Fixnum) protocol versioning scheme; prepended to hashes to
# prevent collisions.
Expand Down
17 changes: 8 additions & 9 deletions right_scraper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,27 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'rubygems'
require ::File.expand_path(::File.join(::File.dirname(__FILE__), 'lib/right_scraper/version'))
require ::File.expand_path('../lib/right_scraper/version', __FILE__)

Gem::Specification.new do |spec|
::Gem::Specification.new do |spec|
spec.name = 'right_scraper'
spec.version = ::RightScraper::GEM_VERSION
spec.authors = ['Raphael Simon', 'Tony Spataro', 'Scott Messier']
spec.email = 'support@rightscale.com'
spec.homepage = 'https://github.com/rightscale/right_scraper'
spec.platform = Gem::Platform::RUBY
spec.platform = ::Gem::Platform::RUBY
spec.summary = 'Download and update remote repositories'
spec.has_rdoc = true
spec.rdoc_options = ["--main", "README.rdoc", "--title", "RightScraper"]
spec.extra_rdoc_files = ["README.rdoc"]
spec.required_ruby_version = '>= 1.8.7'
spec.required_ruby_version = '>= 2.1'
spec.rubyforge_project = %q{right_scraper}
spec.require_path = 'lib'

spec.add_dependency('json', '~> 1.4')
spec.add_dependency('right_aws', '>= 2.0')
spec.add_dependency('right_git')
spec.add_dependency('right_popen', '~> 2.0')
spec.add_dependency('right_support', '~> 2.6')
spec.add_dependency('right_popen')
spec.add_dependency('right_support', '~> 2.8')

spec.requirements << 'curl command line client'
spec.requirements << 'git command line client'
Expand All @@ -59,7 +58,7 @@ will analyze the repository content and instantiate "resources" as a result. Cur
supported resources are Chef cookbooks and RightScale workflow definitions.
EOF

candidates = Dir.glob("{lib,spec}/**/*") +
["LICENSE", "README.rdoc", "Rakefile", "right_scraper.gemspec", "Gemfile", "right_scraper.rconf"]
candidates = ::Dir.glob("lib/**/*") +
%w(LICENSE README.rdoc right_scraper.gemspec)
spec.files = candidates.sort
end
12 changes: 0 additions & 12 deletions right_scraper.rconf

This file was deleted.

6 changes: 3 additions & 3 deletions spec/cookbook_s3_upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def delete_download_repo
end

before(:each) do
pending "Not run unless AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set" unless
ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY']
pending "Not run unless [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, S3_BUCKET] set" unless
ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['S3_BUCKET']
end

context "given a bucket that doesn't exist" do
Expand Down Expand Up @@ -111,7 +111,7 @@ def delete_download_repo
@repo = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
:repo_type => :download,
:url => "file:///#{@download_file}")
bucket_name = 'com.rightscale.test.20100823'
bucket_name = ::ENV['S3_BUCKET']
@scraper = @scraperclass.new(:repository => @repo,
:logger => scraper_logger,
:repo_dir => @download_repo_path,
Expand Down
10 changes: 5 additions & 5 deletions spec/download/download_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#--
# Copyright: Copyright (c) 2010-2013 RightScale, Inc.
# Copyright: Copyright (c) 2010-2016 RightScale, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -46,7 +46,7 @@
before(:each) do
@repository = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
:repo_type => :download,
:url => "http://a.site/foo/bar/baz",
:url => "http://#{::RightScraper::SpecHelpers::BAD_HOSTNAME}/foo/bar/baz",
:first_credential => "user",
:second_credential => "password")
end
Expand Down Expand Up @@ -74,7 +74,7 @@
before(:each) do
@repository = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
:repo_type => :download,
:url => "http://a.site:23/foo/bar/baz",
:url => "http://#{::RightScraper::SpecHelpers::BAD_HOSTNAME}:23/foo/bar/baz",
:first_credential => "user",
:second_credential => "password")
end
Expand All @@ -86,7 +86,7 @@
before(:each) do
@repository = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
:repo_type => :download,
:url => "http://a.site/foo/bar/baz",
:url => "http://#{::RightScraper::SpecHelpers::BAD_HOSTNAME}/foo/bar/baz",
:first_credential => "user")
end

Expand All @@ -97,7 +97,7 @@
before(:each) do
@repository = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
:repo_type => :download,
:url => "urn:a.site:stuff")
:url => "urn:#{::RightScraper::SpecHelpers::BAD_HOSTNAME}:stuff")
end

it_should_behave_like 'a download repository'
Expand Down
Loading

0 comments on commit 1a3a330

Please sign in to comment.