iegrip 0.0.9 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e91fd4dcf3f4cf53da481257929fb1321eee53cc
4
- data.tar.gz: 8803be8bcd4a6851797b656044847c17c4ca6176
3
+ metadata.gz: 6a78290a723f60f0929a7e1d8b6e7d97b2bb566b
4
+ data.tar.gz: b30e5c693a66a4ad3fb61db39fc91de3d2df02a9
5
5
  SHA512:
6
- metadata.gz: 1fb8fe242cb7830c5b3cb59d6d5ade187152bebcf51a9c0e2a4e92430275bb836fb575a67321e6d6717fb3019bb1a534f133430347415236d1dac56de4fc9f9f
7
- data.tar.gz: 359e4dcd2c17b93afa419da88ed3189c1ebb9eb712526c3de6379eeca95121d3e5e1a40f7dc674be5433bdf8323b5ee4e942b94de20ee2b410f7f4457026c223
6
+ metadata.gz: 1c8952c817e112b7bb4bb795927f738063c424a9ca3dc06180e4ac2adcfa38649584a089e3e9d1594d6a6d0c66d640533e1091d0fe8ad11bfcb1c345d34d4387
7
+ data.tar.gz: a11a97cd49eee04f2c31591ab3321bf53d15cad44707b7692b7e6aee1ad6ced7bf50950aa4333c53fc717050840f5da6762ad0c12ba9870ac8a96e245d05efc7
data/iegrip-0.0.9.gem ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  module IEgrip
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/iegrip.rb CHANGED
@@ -21,9 +21,9 @@ module IEgrip
21
21
  ver = fs.GetFileVersion(@raw_object.FullName)
22
22
  @majorVersion = ver.split(/\./)[0].to_i
23
23
  @urlDownloadToFile = Win32API.new('urlmon', 'URLDownloadToFileA', %w(l p p l l), 'l')
24
- @event = WIN32OLE_EVENT.new(@raw_object,"DWebBrowserEvents2")
25
- @downloading = nil
26
- setup_event()
24
+ #@event = WIN32OLE_EVENT.new(@raw_object,"DWebBrowserEvents2")
25
+ @downloading = 0
26
+ #setup_event()
27
27
  end
28
28
 
29
29
  def version
@@ -42,13 +42,15 @@ module IEgrip
42
42
 
43
43
  COMPLETE_STATE = 4
44
44
  def wait_stable()
45
+ stable_counter = 0
45
46
  loop do
46
- break if (@raw_object.Busy != true) and (@raw_object.ReadyState == COMPLETE_STATE)
47
- WIN32OLE_EVENT.message_loop
48
- end
49
- loop do
50
- break unless @downloading
51
- WIN32OLE_EVENT.message_loop
47
+ break if stable_counter >= 3
48
+ if (@raw_object.Busy != true) and (@raw_object.ReadyState == COMPLETE_STATE)
49
+ stable_counter += 1
50
+ else
51
+ sleep 0.5
52
+ stable_counter = 0
53
+ end
52
54
  end
53
55
  end
54
56
 
@@ -60,8 +62,8 @@ module IEgrip
60
62
 
61
63
  def setup_event()
62
64
  @event.on_event("BeforeNavigate2") {
63
- #puts " BeforeNavigate2"
64
- @downloading = true
65
+ @downloading += 1
66
+ #puts " BeforeNavigate2. @downloading=#{@downloading}"
65
67
  }
66
68
  #@event.on_event("CommandStateChange") {
67
69
  # puts " CommandStateChange"
@@ -69,10 +71,11 @@ module IEgrip
69
71
  @event.on_event("DocumentComplete") {|param|
70
72
  # a document is completely loaded and initialized.
71
73
  if param.LocationURL == @raw_object.LocationURL
72
- #puts " DocumentComplete. LocationURL match! : #{param.LocationURL}"
73
- @downloading = false
74
+ @downloading = 0
75
+ #puts " DocumentComplete. LocationURL match! : #{param.LocationURL} @downloading=#{@downloading}"
74
76
  else
75
- #puts " DocumentComplete. "
77
+ @downloading -= 1 if @downloading > 0
78
+ #puts " DocumentComplete. #{param.LocationURL} @downloading=#{@downloading}"
76
79
  end
77
80
  }
78
81
  #@event.on_event("DownloadBegin") {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iegrip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yac4423
@@ -51,6 +51,7 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - iegrip-0.0.2.gem
54
+ - iegrip-0.0.9.gem
54
55
  - iegrip.gemspec
55
56
  - lib/iegrip.rb
56
57
  - lib/iegrip/GripWrapper.rb