bond 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gemspec CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
15
15
  s.has_rdoc = 'yard'
16
16
  s.rdoc_options = ['--title', "Bond #{Bond::VERSION} Documentation"]
17
17
  s.add_development_dependency 'bacon', '>= 1.1.0'
18
- s.add_development_dependency 'mocha', '>= 0.9.8'
19
- s.add_development_dependency 'mocha-on-bacon'
18
+ s.add_development_dependency 'mocha', '~> 0.12.1'
19
+ s.add_development_dependency 'mocha-on-bacon', '~> 0.2.1'
20
20
  s.add_development_dependency 'bacon-bits'
21
21
  s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} **/deps.rip]) + %w{Rakefile .gemspec .travis.yml}
22
22
  if ENV['GEM_PLATFORM'] != 'java'
@@ -4,5 +4,6 @@ rvm:
4
4
  - 1.8.7
5
5
  - 1.9.2
6
6
  - 1.9.3
7
+ - 2.0.0
7
8
  - rbx
8
9
  - jruby
@@ -1,3 +1,8 @@
1
+ == 0.4.3
2
+ * Fix to support ruby 2.0
3
+ * Fix to support objects with invalid .class
4
+ * Fix mocha dev ependency issue
5
+
1
6
  == 0.4.2
2
7
  * Start also releasing java version of gem
3
8
  * Put tests on travis
@@ -221,7 +221,8 @@ has good instructions for reinstalling ruby with the official Readline.
221
221
  * Takao Kouji for {commiting}[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/readline/readline.c?view=diff&r1=24018&r2=24019] this Readline enhancement to ruby 1.9.2.
222
222
  * pd for compatibility with emacs' inf-ruby mode.
223
223
  * timcharper for improving extconf.rb.
224
- * headius for jruby support
224
+ * headius and rking for jruby help
225
+ * ConradIrwin for 2.0 and other fixes
225
226
  * tobias for a java version of the gem
226
227
 
227
228
  == Bugs/Issues
@@ -53,8 +53,8 @@ module Bond
53
53
  attr_reader :on
54
54
  # Takes same options as {Bond#complete}.
55
55
  def initialize(options)
56
- raise InvalidMissionError, ":action" unless (options[:action] || respond_to?(:default_action))
57
- raise InvalidMissionError, ":on" unless (options[:on] && options[:on].is_a?(Regexp)) || respond_to?(:default_on)
56
+ raise InvalidMissionError, ":action" unless (options[:action] || respond_to?(:default_action, true))
57
+ raise InvalidMissionError, ":on" unless (options[:on] && options[:on].is_a?(Regexp)) || respond_to?(:default_on, true)
58
58
  @action, @on = options[:action], options[:on]
59
59
  @place = options[:place] if options[:place]
60
60
  @name = options[:name] if options[:name]
@@ -28,8 +28,7 @@ class Bond::ObjectMission < Bond::Mission
28
28
  end
29
29
 
30
30
  def do_match(input)
31
- super && eval_object(@matched[1]) && @evaled_object.class.respond_to?(:ancestors) &&
32
- @evaled_object.class.ancestors.any? {|e| e.to_s =~ @object_condition }
31
+ super && eval_object(@matched[1]) && klass(@evaled_object).ancestors.any? {|e| e.to_s =~ @object_condition }
33
32
  end
34
33
 
35
34
  def after_match(input)
@@ -39,6 +38,12 @@ class Bond::ObjectMission < Bond::Mission
39
38
  end
40
39
 
41
40
  def default_action(obj)
42
- obj.methods.map {|e| e.to_s} - OPERATORS
41
+ klass(obj).instance_methods.map {|e| e.to_s} - OPERATORS
42
+ end
43
+
44
+ def klass(obj)
45
+ (class << obj; self; end)
46
+ rescue TypeError # can't define singleton
47
+ obj.class
43
48
  end
44
49
  end
@@ -1,3 +1,3 @@
1
1
  module Bond
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
@@ -125,6 +125,11 @@ describe "Completion" do
125
125
  tab("%s[man oh].t").should be_methods_from(Symbol, 'oh].', :man)
126
126
  tab("%[man oh].t").should be_methods_from(String, 'oh].')
127
127
  end
128
+
129
+ it "with overridden class method" do
130
+ complete :on=>/(.*)./, :object=>'Object'
131
+ tab("obj = Object.new; def obj.class; end; obj.").should be_methods_from(Object, 'obj.')
132
+ end
128
133
  end
129
134
 
130
135
  describe "for" do
@@ -43,13 +43,6 @@ describe "ObjectMission" do
43
43
  tab("blah.upt").should == []
44
44
  end
45
45
 
46
- it "ignores object that doesn't have a valid class" do
47
- complete :on=>/(.*)./, :object=>'Object'
48
- capture_stdout {
49
- tab("obj = Object.new; def obj.class; end; obj.").should == []
50
- }.should == ''
51
- end
52
-
53
46
  # needed to ensure Bond works in irbrc
54
47
  it "doesn't evaluate irb binding on definition" do
55
48
  Object.expects(:const_defined?).never
@@ -1,6 +1,5 @@
1
1
  require 'bacon'
2
2
  require 'bacon/bits'
3
- require 'mocha'
4
3
  require 'mocha-on-bacon'
5
4
  require 'bond'
6
5
  require 'rbconfig'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bond
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-04 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bacon
@@ -32,33 +32,33 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 0.9.8
37
+ version: 0.12.1
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 0.9.8
45
+ version: 0.12.1
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: mocha-on-bacon
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 0.2.1
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.2.1
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: bacon-bits
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -145,7 +145,7 @@ licenses:
145
145
  post_install_message:
146
146
  rdoc_options:
147
147
  - --title
148
- - Bond 0.4.2 Documentation
148
+ - Bond 0.4.3 Documentation
149
149
  require_paths:
150
150
  - lib
151
151
  required_ruby_version: !ruby/object:Gem::Requirement