plymouth 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,85 +1,105 @@
1
- $:.unshift 'lib'
2
-
3
- PROJECT_NAME = "plymouth"
4
-
5
- require "#{PROJECT_NAME}/version"
6
-
7
- CLASS_NAME = Plymouth
8
-
9
- require 'rake/clean'
10
- require 'rake/gempackagetask'
11
-
12
- CLOBBER.include("**/*~", "**/*#*", "**/*.log", "**/*.o")
13
- CLEAN.include("ext/**/*.log", "ext/**/*.o",
14
- "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*#*", "**/*#*.*",
15
- "ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake")
16
-
17
- def apply_spec_defaults(s)
18
- s.name = PROJECT_NAME
19
- s.summary = "FIX ME"
20
- s.version = CLASS_NAME::VERSION
21
- s.date = Time.now.strftime '%Y-%m-%d'
22
- s.author = "John Mair (banisterfiend)"
23
- s.email = 'jrmair@gmail.com'
24
- s.description = s.summary
25
- s.require_path = 'lib'
26
- s.add_development_dependency("bacon","~>1.1.0")
27
- s.homepage = "http://github.com/banister/#{PROJECT_NAME}"
28
- s.has_rdoc = 'yard'
29
- s.add_dependency('pry-exception_explorer')
30
- s.files = `git ls-files`.split("\n")
31
- s.test_files = `git ls-files -- test/*`.split("\n")
32
- end
33
-
34
- desc "Run tests"
35
- task :test do
36
- sh "bacon -Itest -rubygems test.rb -q"
37
- end
38
-
39
- desc "generate gemspec"
40
- task :gemspec => "ruby:gemspec"
41
-
42
- namespace :ruby do
43
- spec = Gem::Specification.new do |s|
44
- apply_spec_defaults(s)
45
- s.platform = Gem::Platform::RUBY
46
- end
47
-
48
- Rake::GemPackageTask.new(spec) do |pkg|
49
- pkg.need_zip = false
50
- pkg.need_tar = false
51
- end
52
-
53
- desc "Generate gemspec file"
54
- task :gemspec do
55
- File.open("#{spec.name}.gemspec", "w") do |f|
56
- f << spec.to_ruby
57
- end
58
- end
59
- end
60
-
61
- desc "Show version"
62
- task :version do
63
- puts "Plymouth version: #{Plymouth::VERSION}"
64
- end
65
-
66
- desc "Generate gemspec file"
67
- task :gemspec => "ruby:gemspec"
68
-
69
- desc "build all platform gems at once"
70
- task :gems => [:clean, :rmgems, "ruby:gem"]
71
-
72
- task :gem => [:gems]
73
-
74
- desc "remove all platform gems"
75
- task :rmgems => ["ruby:clobber_package"]
76
-
77
- desc "build and push latest gems"
78
- task :pushgems => :gems do
79
- chdir("./pkg") do
80
- Dir["*.gem"].each do |gemfile|
81
- sh "gem push #{gemfile}"
82
- end
83
- end
84
- end
85
-
1
+ $:.unshift 'lib'
2
+
3
+ dlext = Config::CONFIG['DLEXT']
4
+ direc = File.dirname(__FILE__)
5
+
6
+ PROJECT_NAME = "plymouth"
7
+
8
+ require "#{PROJECT_NAME}/version"
9
+
10
+ CLASS_NAME = Plymouth
11
+
12
+ require 'rake/clean'
13
+ require 'rake/gempackagetask'
14
+
15
+ CLOBBER.include("**/*~", "**/*#*", "**/*.log", "**/*.o")
16
+ CLEAN.include("ext/**/*.log", "ext/**/*.o",
17
+ "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*#*", "**/*#*.*",
18
+ "ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake")
19
+
20
+ def apply_spec_defaults(s)
21
+ s.name = PROJECT_NAME
22
+ s.summary = "Start an interactive session when a test fails"
23
+ s.version = CLASS_NAME::VERSION
24
+ s.date = Time.now.strftime '%Y-%m-%d'
25
+ s.author = "John Mair (banisterfiend)"
26
+ s.email = 'jrmair@gmail.com'
27
+ s.description = s.summary
28
+ s.require_path = 'lib'
29
+ s.homepage = "http://github.com/banister/#{PROJECT_NAME}"
30
+ s.has_rdoc = 'yard'
31
+ s.add_dependency('pry-exception_explorer')
32
+ s.add_development_dependency("bacon","~>1.1.0")
33
+ s.add_development_dependency('rspec')
34
+ s.required_ruby_version = '>= 1.9.2'
35
+ s.files = `git ls-files`.split("\n")
36
+ s.test_files = `git ls-files -- test/*`.split("\n")
37
+ end
38
+
39
+ desc "Run tests"
40
+ task :test do
41
+ sh "bacon -Itest -rubygems test.rb -q"
42
+ end
43
+
44
+ desc "Run bacon example"
45
+ task :example_bacon do
46
+ sh "bacon -I#{direc}/lib/ #{direc}/examples/example_bacon.rb "
47
+ end
48
+
49
+ desc "Run rspec example"
50
+ task :example_rspec do
51
+ sh "rspec -I#{direc}/lib/ #{direc}/examples/example_rspec.rb "
52
+ end
53
+
54
+ desc "Run minitest example"
55
+ task :example_minitest do
56
+ sh "ruby -I#{direc}/lib/ #{direc}/examples/example_minitest.rb "
57
+ end
58
+
59
+ desc "generate gemspec"
60
+ task :gemspec => "ruby:gemspec"
61
+
62
+ namespace :ruby do
63
+ spec = Gem::Specification.new do |s|
64
+ apply_spec_defaults(s)
65
+ s.platform = Gem::Platform::RUBY
66
+ end
67
+
68
+ Rake::GemPackageTask.new(spec) do |pkg|
69
+ pkg.need_zip = false
70
+ pkg.need_tar = false
71
+ end
72
+
73
+ desc "Generate gemspec file"
74
+ task :gemspec do
75
+ File.open("#{spec.name}.gemspec", "w") do |f|
76
+ f << spec.to_ruby
77
+ end
78
+ end
79
+ end
80
+
81
+ desc "Show version"
82
+ task :version do
83
+ puts "Plymouth version: #{Plymouth::VERSION}"
84
+ end
85
+
86
+ desc "Generate gemspec file"
87
+ task :gemspec => "ruby:gemspec"
88
+
89
+ desc "build all platform gems at once"
90
+ task :gems => [:clean, :rmgems, "ruby:gem"]
91
+
92
+ task :gem => [:gems]
93
+
94
+ desc "remove all platform gems"
95
+ task :rmgems => ["ruby:clobber_package"]
96
+
97
+ desc "build and push latest gems"
98
+ task :pushgems => :gems do
99
+ chdir("./pkg") do
100
+ Dir["*.gem"].each do |gemfile|
101
+ sh "gem push #{gemfile}"
102
+ end
103
+ end
104
+ end
105
+
@@ -0,0 +1,15 @@
1
+ unless Object.const_defined? :Plymouth
2
+ $:.unshift File.expand_path '../../lib', __FILE__
3
+ end
4
+
5
+ require 'plymouth'
6
+
7
+ describe Array do
8
+ before do
9
+ @array = [1]
10
+ end
11
+
12
+ it 'should be empty' do
13
+ @array.empty?.should == true
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ unless Object.const_defined? :Plymouth
2
+ $:.unshift File.expand_path '../../lib', __FILE__
3
+ end
4
+
5
+ require 'minitest/autorun'
6
+ require 'minitest/spec'
7
+ require 'plymouth'
8
+
9
+ describe Array do
10
+ before do
11
+ @array = [1]
12
+ end
13
+
14
+ it 'should be empty' do
15
+ @array.empty?.must_equal true
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ unless Object.const_defined? :Plymouth
2
+ $:.unshift File.expand_path '../../lib', __FILE__
3
+ end
4
+
5
+ require 'plymouth'
6
+
7
+ describe Array do
8
+ before do
9
+ @array = [1]
10
+ end
11
+
12
+ it 'should be empty' do
13
+ @array.empty?.should == true
14
+ end
15
+ end
data/lib/plymouth.rb CHANGED
@@ -6,39 +6,54 @@ require 'pry-exception_explorer'
6
6
 
7
7
  EE.enabled = true
8
8
 
9
+ message = nil
10
+
11
+ Pry.config.commands.before_command("whereami") do
12
+ output.puts
13
+ output.puts "#{Pry::Helpers::Text.bold("Test failure:")} #{message}"
14
+ end
15
+
9
16
  if defined?(Bacon)
10
17
 
11
18
  EE.intercept do |frame, ex|
12
- ex.is_a?(Bacon::Error) && frame.method_name != :run_requirement
19
+
20
+ if ex.is_a?(Bacon::Error) && frame.method_name != :run_requirement
21
+ message = ex
22
+ true
23
+ else
24
+ false
25
+ end
13
26
  end.skip_until { |frame| frame.klass == Bacon::Context }
14
27
 
15
28
  elsif defined?(RSpec)
16
29
 
17
30
  EE.intercept do |frame, ex|
18
- ex.class.name =~ /RSpec::Expectations::ExpectationNotMetError/
31
+
32
+ if ex.class.name =~ /RSpec::Expectations::ExpectationNotMetError/
33
+ message = ex
34
+ true
35
+ else
36
+ false
37
+ end
38
+
19
39
  end.skip_until do |frame|
20
40
  frame.klass.name =~ /RSpec::Core::ExampleGroup::Nested/
21
41
  end
22
42
 
23
43
  elsif defined?(MiniTest)
24
44
 
25
- EE.intercept(MiniTest::Assertion).skip_until do |frame|
45
+ EE.intercept do |frame, ex|
46
+
47
+ if ex.is_a?(MiniTest::Assertion)
48
+ message = ex
49
+ true
50
+ else
51
+ false
52
+ end
53
+
54
+ end.skip_until do |frame|
26
55
  frame.method_name =~ /^test_/
27
56
  end
28
-
29
- # elsif defined?(Riot)
30
- # EE.enabled = false
31
- # class Riot::Assertion
32
- # private
33
- # alias_method :oh_my_old_assert, :assert
34
- # def assert(*args, &block)
35
- # result = oh_my_old_assert(*args, &block)
36
- # if result.first == :fail || result.first == :error
37
- # Pry.start binding, :call_stack => binding.callers
38
- # end
39
-
40
- # result
41
- # end
42
- # end
43
57
  end
44
58
 
59
+
@@ -1,3 +1,3 @@
1
1
  module Plymouth
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/plymouth.gemspec CHANGED
@@ -2,32 +2,36 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "plymouth"
5
- s.version = "0.1.1"
5
+ s.version = "0.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Mair (banisterfiend)"]
9
9
  s.date = "2012-02-08"
10
- s.description = "FIX ME"
10
+ s.description = "Start an interactive session when a test fails"
11
11
  s.email = "jrmair@gmail.com"
12
- s.files = [".gemtest", ".gitignore", ".yardopts", "CHANGELOG", "Gemfile", "LICENSE", "README.md", "Rakefile", "lib/plymouth.rb", "lib/plymouth/version.rb", "plymouth.gemspec", "test/test.rb"]
12
+ s.files = [".gemtest", ".gitignore", ".yardopts", "CHANGELOG", "Gemfile", "LICENSE", "README.md", "Rakefile", "examples/example_bacon.rb", "examples/example_minitest.rb", "examples/example_rspec.rb", "lib/plymouth.rb", "lib/plymouth/version.rb", "plymouth.gemspec", "test/test.rb"]
13
13
  s.homepage = "http://github.com/banister/plymouth"
14
14
  s.require_paths = ["lib"]
15
- s.rubygems_version = "1.8.11"
16
- s.summary = "FIX ME"
15
+ s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
16
+ s.rubygems_version = "1.8.15"
17
+ s.summary = "Start an interactive session when a test fails"
17
18
  s.test_files = ["test/test.rb"]
18
19
 
19
20
  if s.respond_to? :specification_version then
20
21
  s.specification_version = 3
21
22
 
22
23
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
23
- s.add_development_dependency(%q<bacon>, ["~> 1.1.0"])
24
24
  s.add_runtime_dependency(%q<pry-exception_explorer>, [">= 0"])
25
+ s.add_development_dependency(%q<bacon>, ["~> 1.1.0"])
26
+ s.add_development_dependency(%q<rspec>, [">= 0"])
25
27
  else
26
- s.add_dependency(%q<bacon>, ["~> 1.1.0"])
27
28
  s.add_dependency(%q<pry-exception_explorer>, [">= 0"])
29
+ s.add_dependency(%q<bacon>, ["~> 1.1.0"])
30
+ s.add_dependency(%q<rspec>, [">= 0"])
28
31
  end
29
32
  else
30
- s.add_dependency(%q<bacon>, ["~> 1.1.0"])
31
33
  s.add_dependency(%q<pry-exception_explorer>, [">= 0"])
34
+ s.add_dependency(%q<bacon>, ["~> 1.1.0"])
35
+ s.add_dependency(%q<rspec>, [">= 0"])
32
36
  end
33
37
  end
metadata CHANGED
@@ -1,48 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: plymouth
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
4
5
  prerelease:
5
- version: 0.1.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - John Mair (banisterfiend)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-02-08 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: bacon
12
+ date: 2012-02-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry-exception_explorer
16
+ requirement: &70323999883060 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
17
23
  prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: *70323999883060
25
+ - !ruby/object:Gem::Dependency
26
+ name: bacon
27
+ requirement: &70323999880480 !ruby/object:Gem::Requirement
19
28
  none: false
20
- requirements:
29
+ requirements:
21
30
  - - ~>
22
- - !ruby/object:Gem::Version
31
+ - !ruby/object:Gem::Version
23
32
  version: 1.1.0
24
33
  type: :development
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: pry-exception_explorer
28
34
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ version_requirements: *70323999880480
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &70323999864420 !ruby/object:Gem::Requirement
30
39
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
35
- type: :runtime
36
- version_requirements: *id002
37
- description: FIX ME
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70323999864420
47
+ description: Start an interactive session when a test fails
38
48
  email: jrmair@gmail.com
39
49
  executables: []
40
-
41
50
  extensions: []
42
-
43
51
  extra_rdoc_files: []
44
-
45
- files:
52
+ files:
46
53
  - .gemtest
47
54
  - .gitignore
48
55
  - .yardopts
@@ -51,36 +58,36 @@ files:
51
58
  - LICENSE
52
59
  - README.md
53
60
  - Rakefile
61
+ - examples/example_bacon.rb
62
+ - examples/example_minitest.rb
63
+ - examples/example_rspec.rb
54
64
  - lib/plymouth.rb
55
65
  - lib/plymouth/version.rb
56
66
  - plymouth.gemspec
57
67
  - test/test.rb
58
68
  homepage: http://github.com/banister/plymouth
59
69
  licenses: []
60
-
61
70
  post_install_message:
62
71
  rdoc_options: []
63
-
64
- require_paths:
72
+ require_paths:
65
73
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
74
+ required_ruby_version: !ruby/object:Gem::Requirement
67
75
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 1.9.2
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
81
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
78
86
  requirements: []
79
-
80
87
  rubyforge_project:
81
- rubygems_version: 1.8.11
88
+ rubygems_version: 1.8.15
82
89
  signing_key:
83
90
  specification_version: 3
84
- summary: FIX ME
85
- test_files:
91
+ summary: Start an interactive session when a test fails
92
+ test_files:
86
93
  - test/test.rb