ie_handler 0.0.1
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/History.txt +4 -0
- data/Manifest.txt +11 -0
- data/PostInstall.txt +5 -0
- data/README.rdoc +103 -0
- data/Rakefile +26 -0
- data/lib/ie_handler.rb +6 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_helper.rb +6 -0
- data/test/test_ie_handler.rb +11 -0
- metadata +101 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
= ie_handler
|
2
|
+
|
3
|
+
* https://github.com/honkimi/IE_Handler
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
IE Handler enable you to handle IE using Ruby.
|
8
|
+
It has simple syntax and strong methods.
|
9
|
+
Currently we support only IE, but we plan to extend other MS products in the
|
10
|
+
future.
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
require this file and create ie object.
|
15
|
+
<pre>
|
16
|
+
require './lib/IEPage'
|
17
|
+
ie = IEPage.new("http://google.com")
|
18
|
+
</pre>
|
19
|
+
|
20
|
+
You can access document like DOM.
|
21
|
+
Make sure that you need to call "find" method at the first.
|
22
|
+
The method initialize the current dom object.
|
23
|
+
<pre>
|
24
|
+
ie.find.name('Text',0) #=> getElementsByName("Text").item(0)
|
25
|
+
ie.find.id("container") #=> getElementById("container")
|
26
|
+
ie.find.tag("table",2) #=> getElementsByTagName("table").itemn(2)
|
27
|
+
</pre>
|
28
|
+
|
29
|
+
We support "Saved Access" which hold the current dom object.
|
30
|
+
<pre>
|
31
|
+
tr = ie.find.tag('table',12).tag('tr',1)
|
32
|
+
tr.sa.tag('td',1)
|
33
|
+
tr.sa.tag('td',2)
|
34
|
+
...
|
35
|
+
</pre>
|
36
|
+
|
37
|
+
Other convinient methods.
|
38
|
+
<pre>
|
39
|
+
ie.wait
|
40
|
+
ie.close
|
41
|
+
ie.back
|
42
|
+
ie.go(url)
|
43
|
+
ie.tag('tr').each....
|
44
|
+
ie.id('hoge').html
|
45
|
+
ie.id('sbmt_btn').click
|
46
|
+
</pre>
|
47
|
+
|
48
|
+
You can also add some elements.
|
49
|
+
<pre>
|
50
|
+
div = IEPage.make_elemn(ie, "div")
|
51
|
+
div.value = "test"
|
52
|
+
div.attr("id", "item")
|
53
|
+
ie.id('list').add(div)
|
54
|
+
</pre>
|
55
|
+
|
56
|
+
For debugging.
|
57
|
+
methods method output the all of the Win32OLE methods.
|
58
|
+
<pre>
|
59
|
+
ie.methods
|
60
|
+
ie.methods(/^on/)
|
61
|
+
ie.method("Click")
|
62
|
+
</pre>
|
63
|
+
|
64
|
+
You can use origin Win32OLE method.
|
65
|
+
<pre>
|
66
|
+
ie.getElementById(...)
|
67
|
+
</pre>
|
68
|
+
You can search the methods by using "methods, method" method.
|
69
|
+
|
70
|
+
|
71
|
+
== REQUIREMENTS:
|
72
|
+
|
73
|
+
* Windows Machine
|
74
|
+
* Over Ruby 1.8
|
75
|
+
|
76
|
+
== INSTALL:
|
77
|
+
|
78
|
+
* sudo gem install
|
79
|
+
|
80
|
+
== LICENSE:
|
81
|
+
|
82
|
+
(The MIT License)
|
83
|
+
|
84
|
+
Copyright (c) 2012 FIXME full name
|
85
|
+
|
86
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
87
|
+
a copy of this software and associated documentation files (the
|
88
|
+
'Software'), to deal in the Software without restriction, including
|
89
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
90
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
91
|
+
permit persons to whom the Software is furnished to do so, subject to
|
92
|
+
the following conditions:
|
93
|
+
|
94
|
+
The above copyright notice and this permission notice shall be
|
95
|
+
included in all copies or substantial portions of the Software.
|
96
|
+
|
97
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
98
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
99
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
100
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
101
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
102
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
103
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/ie_handler'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'ie_handler' do
|
14
|
+
self.developer 'kiminari.homma', 'u533u778@gmail.com'
|
15
|
+
self.post_install_message = 'PostInstall.txt'
|
16
|
+
self.rubyforge_name = self.name
|
17
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'newgem/tasks'
|
22
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
23
|
+
|
24
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
25
|
+
# remove_task :default
|
26
|
+
# task :default => [:spec, :features]
|
data/lib/ie_handler.rb
ADDED
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/ie_handler.rb'}"
|
9
|
+
puts "Loading ie_handler gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ie_handler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- kiminari.homma
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rdoc
|
16
|
+
requirement: &80212680 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.10'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *80212680
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: newgem
|
27
|
+
requirement: &80211900 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.5.3
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *80211900
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: hoe
|
38
|
+
requirement: &80211350 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *80211350
|
47
|
+
description: ! 'IE Handler enable you to handle IE using Ruby.
|
48
|
+
|
49
|
+
It has simple syntax and strong methods.
|
50
|
+
|
51
|
+
Currently we support only IE, but we plan to extend other MS products in the
|
52
|
+
|
53
|
+
future.'
|
54
|
+
email:
|
55
|
+
- u533u778@gmail.com
|
56
|
+
executables: []
|
57
|
+
extensions: []
|
58
|
+
extra_rdoc_files:
|
59
|
+
- History.txt
|
60
|
+
- Manifest.txt
|
61
|
+
- PostInstall.txt
|
62
|
+
- README.rdoc
|
63
|
+
files:
|
64
|
+
- History.txt
|
65
|
+
- Manifest.txt
|
66
|
+
- PostInstall.txt
|
67
|
+
- README.rdoc
|
68
|
+
- Rakefile
|
69
|
+
- lib/ie_handler.rb
|
70
|
+
- script/console
|
71
|
+
- script/destroy
|
72
|
+
- script/generate
|
73
|
+
- test/test_helper.rb
|
74
|
+
- test/test_ie_handler.rb
|
75
|
+
homepage: https://github.com/honkimi/IE_Handler
|
76
|
+
licenses: []
|
77
|
+
post_install_message: PostInstall.txt
|
78
|
+
rdoc_options:
|
79
|
+
- --main
|
80
|
+
- README.rdoc
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project: ie_handler
|
97
|
+
rubygems_version: 1.8.10
|
98
|
+
signing_key:
|
99
|
+
specification_version: 3
|
100
|
+
summary: IE Handler enable you to handle IE using Ruby
|
101
|
+
test_files: []
|