owrb 0.0.2 → 0.0.3

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/owrb.rb +19 -1
  3. data/lib/owrb/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d67bab37927965094442b60f27a1ca95e9b2500c
4
- data.tar.gz: c11a4b99e2f92c5180877811a577842a03caee94
3
+ metadata.gz: 87ef90e379f05340df4f5e0bb581496cb040e377
4
+ data.tar.gz: 5b2c2318d241c9517a7b6dafe96f774d2aad7903
5
5
  SHA512:
6
- metadata.gz: 94ab2833bb81f1907c195c0879ee7083597336224729fde80c3d184ac774ec1bd532c22f48d67a3a621502f02df9878ddfb20aedb7d317771f15eab6a269cca1
7
- data.tar.gz: 46ccab00d3ebfee5ac84c9022d3cdc51b1cf80a9dac9bd4616c654e14573de822121e6aeb41cd0dd3b0a825807817ffe6fa41fe833d0fffb2e30cc0efcfded38
6
+ metadata.gz: cbf2c75fa072c9a65f053973942b14b1ff4052532b384140cba382a802ee7f4f1a0ffc2436e58be13a29c5892fe7edb7c4b69f25bbc5d4e49e297bf5c7c5b9db
7
+ data.tar.gz: 47f3ccf1a0081e2182b5f0ac30b48ba38704482dfee5e88119787503b7a101e400e7bd1da520eced4c3c7ceb6838be6846e9c8da3863e1d73d2d972796d1da4f
@@ -24,18 +24,30 @@ module Owrb
24
24
 
25
25
  module HTML
26
26
  class Element
27
- attr_reader :name, :attributes
27
+ attr_reader :element, :name, :attributes, :inner_html
28
28
 
29
29
  def initialize( element )
30
+ @element = element
30
31
  @name = element.name
31
32
  @attributes = {}
32
33
  element.attributes.each{|name, attribute|
33
34
  @attributes[ attribute.name ] = attribute.value
34
35
  }
36
+ @inner_html = element.inner_html
37
+ end
38
+
39
+ def to_h
40
+ {
41
+ :name => @name,
42
+ :attributes => @attributes,
43
+ :inner_html => @inner_html,
44
+ }
35
45
  end
36
46
  end
37
47
 
38
48
  class Document
49
+ attr_reader :document
50
+
39
51
  def initialize( document )
40
52
  @document = document
41
53
  end
@@ -55,6 +67,8 @@ module Owrb
55
67
  end
56
68
 
57
69
  class Browser
70
+ attr_reader :browser
71
+
58
72
  def initialize( type = :phantomjs )
59
73
  @browser = Watir::Browser.new( type )
60
74
  end
@@ -74,6 +88,10 @@ module Owrb
74
88
  def quit
75
89
  @browser.quit
76
90
  end
91
+
92
+ def document
93
+ HTML.parse( @browser.html )
94
+ end
77
95
  end
78
96
 
79
97
  =begin
@@ -1,3 +1,3 @@
1
1
  module Owrb
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - liveralmask