Skip to content

Commit

Permalink
add releaseops goodness
Browse files Browse the repository at this point in the history
  • Loading branch information
slyphon committed May 5, 2012
1 parent 861aa2f commit 61e9d18
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ Gemfile.*
tmp/
.rvmrc
.zkserver
coverage
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "releaseops"]
path = releaseops
url = git://github.com/slyphon/releaseops.git
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -3,15 +3,20 @@ notifications:
email:
- slyphon@gmail.com

# pull in releaseops submodule
before_install:
- git submodule update --init --recursive

env:
- SPAWN_ZOOKEEPER='true'

rvm:
- 1.9.3
- 1.9.2
- 1.8.7
- ree
- jruby-18mode
- jruby-19mode

bundler_args: --without development docs
bundler_args: --without development docs coverage

4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -4,6 +4,10 @@ gemspec

gem 'rake', '~> 0.9.0'

platform :mri_19 do
gem 'simplecov', :group => :coverage, :require => false
end

group :test do
gem "rspec", "~> 2.8.0"
gem 'flexmock', '~> 0.8.11'
Expand Down
43 changes: 22 additions & 21 deletions Rakefile
Expand Up @@ -33,12 +33,31 @@ namespace :mb do
end
end

release_ops_path = File.expand_path('../releaseops/lib', __FILE__)

require File.expand_path('../lib/zookeeper/rake_tasks', __FILE__)
# if the special submodule is availabe, use it
# we use a submodule because it doesn't depend on anything else (*cough* bundler)
# and can be shared across projects
#
if File.exists?(release_ops_path)
require File.join(release_ops_path, 'releaseops')

RUBY_NAMES = %w[1.8.7 1.9.2 jruby rbx 1.9.3]
# sets up the multi-ruby zk:test_all rake tasks
ReleaseOps::TestTasks.define_for(*%w[1.8.7 1.9.2 jruby rbx ree 1.9.3])

Zookeeper::RakeTasks.define_test_tasks_for(*RUBY_NAMES)
# sets up the task :default => 'spec:run' and defines a simple
# "run the specs with the current rvm profile" task
ReleaseOps::TestTasks.define_simple_default_for_travis

# Define a task to run code coverage tests
ReleaseOps::TestTasks.define_simplecov_tasks

# set up yard:server, yard:gems, and yard:clean tasks
# for doing documentation stuff
ReleaseOps::YardTasks.define

task :clean => 'yard:clean'
end

task :clobber do
rm_rf 'tmp'
Expand Down Expand Up @@ -71,23 +90,5 @@ task :build do
end
end

namespace :spec do
task :define do
require 'rubygems'
require 'bundler/setup'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new('spec:runner') do |t|
# t.rspec_opts = '-f d'
end
end

task :run => :define do
Rake::Task['spec:runner'].invoke
end
end


task 'spec:run' => 'build:clean' unless defined?(::JRUBY_VERSION)
task :default => 'spec:run'

1 change: 1 addition & 0 deletions releaseops
Submodule releaseops added at ce5a10
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -4,6 +4,13 @@

require 'rubygems'

release_ops_path = File.expand_path('../../releaseops/lib', __FILE__)

if File.exists?(release_ops_path)
require File.join(release_ops_path, 'releaseops')
ReleaseOps::SimpleCov.maybe_start
end

gem 'flexmock', '~> 0.8.11'

require 'flexmock'
Expand Down

0 comments on commit 61e9d18

Please sign in to comment.