jruby-win32ole 0.8.3 → 0.8.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.8.4
data/bin/sample CHANGED
File without changes
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
+ s.has_rdoc = true
21
22
  end
@@ -1,5 +1,5 @@
1
1
  module JRuby
2
2
  module WIN32OLE
3
- VERSION = "0.8.3"
3
+ VERSION = "0.8.4"
4
4
  end
5
5
  end
@@ -1,6 +1,11 @@
1
1
  class WIN32OLE_EVENT
2
2
  java_import org.racob.com.DispatchEvents
3
-
3
+
4
+ # Returns OLE event object. The first argument specifies WIN32OLE object. The second argument specifies OLE event name.
5
+ #
6
+ # ie = WIN32OLE.new('InternetExplorer.Application')
7
+ # ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
8
+ #
4
9
  def initialize(ole, event_name=nil)
5
10
  @event_handlers = {}
6
11
 
@@ -14,6 +19,13 @@ class WIN32OLE_EVENT
14
19
  DispatchEvents.new dispatch, RubyInvocationProxy.new(self), dispatch.program_id
15
20
  end
16
21
 
22
+ # Defines the callback event. If argument is omitted, this method defines the callback of all events.
23
+ #
24
+ # ie = WIN32OLE.new('InternetExplorer.Application')
25
+ # ev = WIN32OLE_EVENT.new(ie)
26
+ # ev.on_event("NavigateComplete") {|url| puts url}
27
+ # ev.on_event() {|ev, *args| puts "#{ev} fired"}
28
+ #
17
29
  def on_event(name=nil, &block)
18
30
  if name
19
31
  @event_handlers[name.to_s] = block
@@ -21,6 +33,30 @@ class WIN32OLE_EVENT
21
33
  @default_handler = block
22
34
  end
23
35
  end
36
+
37
+ # removes the callback of event.
38
+ #
39
+ # ie = WIN32OLE.new('InternetExplorer.Application')
40
+ # ev = WIN32OLE_EVENT.new(ie)
41
+ # ev.on_event('BeforeNavigate2') {|*args|
42
+ # args.last[6] = true
43
+ # }
44
+ # ...
45
+ # ev.off_event('BeforeNavigate2')
46
+ # ...
47
+ #
48
+ def off_event(name=nil)
49
+ if name.nil?
50
+ @event_handlers.clear
51
+ @default_handler = nil
52
+ elsif name.kind_of?(String) || name.kind_of?(Symbol)
53
+ @event_handlers.delete(name.to_s)
54
+ else
55
+ raise TypeError.new("wrong argument type (expected String or Symbol)")
56
+ end
57
+
58
+ nil
59
+ end
24
60
 
25
61
  def method_missing(name, *args)
26
62
  name = name.to_s
@@ -32,6 +68,8 @@ class WIN32OLE_EVENT
32
68
  end
33
69
  end
34
70
 
71
+ # Translates and dispatches Windows message.
72
+ #
35
73
  # Almost noop this. We don't because it get CPU hot when people put this
36
74
  # in a hot loop!
37
75
  def self.message_loop
@@ -1,8 +1,8 @@
1
1
  compile.on.save=true
2
2
  do.depend=false
3
3
  do.jar=true
4
- file.reference.jrwin32ole-lib=C:\\opt\\jruby-win32ole\\lib
5
- file.reference.jrwin32ole-src=C:\\opt\\jruby-win32ole\\src
4
+ file.reference.jrwin32ole-lib=lib
5
+ file.reference.jrwin32ole-src=src
6
6
  javac.debug=true
7
7
  javadoc.preview=true
8
- user.properties.file=C:\\Documents and Settings\\Fuebo\\.netbeans\\6.8\\build.properties
8
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-win32ole
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
5
- prerelease: false
4
+ hash: 55
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thomas E. Enebo
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-27 00:00:00 -06:00
18
+ date: 2011-07-06 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements: []
107
107
 
108
108
  rubyforge_project: jruby-win32ole
109
- rubygems_version: 1.3.7
109
+ rubygems_version: 1.6.2
110
110
  signing_key:
111
111
  specification_version: 3
112
112
  summary: A Gem for win32ole support on JRuby