[DRE-commits] [ruby-rspec-instafail] 85/126: lock it down

Hideki Yamane henrich at moszumanska.debian.org
Sun Nov 15 19:15:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository ruby-rspec-instafail.

commit 6cccfb062617a7ad1548f6f4d54e7a485d3e4a73
Author: grosser <grosser.michael at gmail.com>
Date:   Tue Apr 9 07:41:01 2013 -0700

    lock it down
---
 Gemfile                 |  6 ++++++
 Gemfile.lock            | 28 ++++++++++++++++++++++++++++
 Rakefile                | 26 +++++---------------------
 rspec-instafail.gemspec |  1 +
 spec/instafail_spec.rb  |  8 ++++++--
 5 files changed, 46 insertions(+), 23 deletions(-)

diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..4be058e
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,6 @@
+source "https://rubygems.org"
+
+gemspec
+
+gem "bump"
+gem "rake"
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..b231a74
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,28 @@
+PATH
+  remote: .
+  specs:
+    rspec-instafail (0.2.4)
+      rspec
+
+GEM
+  remote: https://rubygems.org/
+  specs:
+    bump (0.4.0)
+    diff-lcs (1.2.2)
+    rake (10.0.3)
+    rspec (2.13.0)
+      rspec-core (~> 2.13.0)
+      rspec-expectations (~> 2.13.0)
+      rspec-mocks (~> 2.13.0)
+    rspec-core (2.13.1)
+    rspec-expectations (2.13.0)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.13.1)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  bump
+  rake
+  rspec-instafail!
diff --git a/Rakefile b/Rakefile
index f321e31..fcdc4ef 100755
--- a/Rakefile
+++ b/Rakefile
@@ -1,25 +1,9 @@
-require "bundler"
-Bundler::GemHelper.install_tasks
+require "bundler/setup"
+require "bundler/gem_tasks"
+require "bump/tasks"
 
 task :default do
-  sh "cd spec/rspec_1 && (bundle || bundle install) > /dev/null"
-  sh "cd spec/rspec_2 && (bundle || bundle install) > /dev/null"
+  sh "cd spec/rspec_1 && (bundle check || bundle) > /dev/null"
+  sh "cd spec/rspec_2 && (bundle check || bundle) > /dev/null"
   sh "rspec spec/"
 end
-
-rule /^version:bump:.*/ do |t|
-  file = 'lib/rspec/instafail/version.rb'
-
-  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
-  index = ['major', 'minor','patch'].index(t.name.split(':').last)
-
-  version_file = File.read(file)
-  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
-  version_parts[index] = version_parts[index].to_i + 1
-  version_parts[2] = 0 if index < 2
-  version_parts[1] = 0 if index < 1
-  new_version = version_parts * '.'
-  File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
-
-  sh "git add #{file} && git commit -m 'bump version to #{new_version}'"
-end
diff --git a/rspec-instafail.gemspec b/rspec-instafail.gemspec
index d02b261..882ca52 100755
--- a/rspec-instafail.gemspec
+++ b/rspec-instafail.gemspec
@@ -9,4 +9,5 @@ Gem::Specification.new name, RSpec::Instafail::VERSION do |s|
   s.homepage = "http://github.com/grosser/#{name}"
   s.files = `git ls-files`.split("\n")
   s.license = "MIT"
+  s.add_runtime_dependency "rspec"
 end
diff --git a/spec/instafail_spec.rb b/spec/instafail_spec.rb
index bd3c7d9..772049a 100755
--- a/spec/instafail_spec.rb
+++ b/spec/instafail_spec.rb
@@ -1,7 +1,9 @@
 describe 'RSpec::Instafail' do
   context "RSpec 1.x" do
     before :all do
-      @rspec_result = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
+      Bundler.with_clean_env do
+        @rspec_result = `cd spec/rspec_1 && bundle exec spec a_test.rb --format RSpec::Instafail`
+      end
     end
 
     before do
@@ -23,7 +25,9 @@ describe 'RSpec::Instafail' do
 
   context 'Rspec 2.x' do
     before :all do
-      @rspec_result = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
+      Bundler.with_clean_env do
+        @rspec_result = `cd spec/rspec_2 && bundle exec rspec a_test.rb --require ../../lib/rspec/instafail --format RSpec::Instafail --no-color`
+      end
     end
 
     before do

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rspec-instafail.git



More information about the Pkg-ruby-extras-commits mailing list