bond 0.4.2-java → 0.4.3-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gemspec +2 -2
- data/.travis.yml +1 -0
- data/CHANGELOG.rdoc +5 -0
- data/README.rdoc +2 -1
- data/lib/bond/mission.rb +2 -2
- data/lib/bond/missions/object_mission.rb +8 -3
- data/lib/bond/version.rb +1 -1
- data/test/completion_test.rb +5 -0
- data/test/object_mission_test.rb +0 -7
- data/test/test_helper.rb +0 -1
- metadata +11 -11
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', '
|
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'
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -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
|
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
|
data/lib/bond/mission.rb
CHANGED
@@ -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.
|
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.
|
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
|
data/lib/bond/version.rb
CHANGED
data/test/completion_test.rb
CHANGED
@@ -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
|
data/test/object_mission_test.rb
CHANGED
@@ -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
|
data/test/test_helper.rb
CHANGED
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.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: java
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
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.
|
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.
|
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:
|
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:
|
61
|
+
version: 0.2.1
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: bacon-bits
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,7 +142,7 @@ licenses:
|
|
142
142
|
post_install_message:
|
143
143
|
rdoc_options:
|
144
144
|
- --title
|
145
|
-
- Bond 0.4.
|
145
|
+
- Bond 0.4.3 Documentation
|
146
146
|
require_paths:
|
147
147
|
- lib
|
148
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|