pageify 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pageify.rb +7 -8
- data/lib/pageify/element.rb +15 -3
- metadata +3 -5
- data/lib/pageify/base_element.rb +0 -17
- data/lib/pageify/page.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04c826e3f638dcf675f720de0ca8ec814d1a51a3
|
4
|
+
data.tar.gz: e749db72bae8985eb21026aa29768645f0c093e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3772d459e9de5dc24c9c7c5693aceae7e5d53347b3609ffae2ac7282ce0e24f30d4ec78253a2383ef8bc5755d8b604622356b6816456866946b3da5a8387ff9d
|
7
|
+
data.tar.gz: e18d086537adb9d955f95b46373a5d9eac76800bb3f0ee7bd639967726fbc42b65ff6af7a94d68fcb3dda22bb831b191924e868ca47c67e4cbdc817178b89302
|
data/lib/pageify.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module Pageify
|
2
|
-
require "pageify/page"
|
3
2
|
require "pageify/string"
|
4
|
-
require "pageify/page"
|
5
3
|
require "pageify/element"
|
6
4
|
|
7
5
|
def pageify(base_dir)
|
@@ -14,19 +12,20 @@ module Pageify
|
|
14
12
|
end
|
15
13
|
end
|
16
14
|
|
17
|
-
def
|
18
|
-
|
19
|
-
define_method(name) do
|
15
|
+
def createElement(name,selector)
|
16
|
+
element = Element.new(name,selector,nil)
|
17
|
+
define_method("_#{name}") do
|
20
18
|
$selector = ""
|
21
|
-
|
19
|
+
element
|
22
20
|
end
|
23
|
-
|
21
|
+
element
|
24
22
|
end
|
25
23
|
|
26
24
|
def to_page_objects(file)
|
27
25
|
rawArray = IO.read(file).split("\n").map{|x| x.rstrip}
|
28
26
|
rawArray -= [""]
|
29
|
-
|
27
|
+
parentElement = rawArray.shift
|
28
|
+
page = createElement(parentElement.name,parentElement.selector)
|
30
29
|
parent = [page]
|
31
30
|
until rawArray.empty? do
|
32
31
|
thisElement = rawArray.first
|
data/lib/pageify/element.rb
CHANGED
@@ -1,11 +1,23 @@
|
|
1
|
-
|
1
|
+
class Element
|
2
|
+
attr_accessor :name,:parent,:selector
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def createChild (name,selector)
|
5
|
+
child = Element.new(name,selector,self)
|
6
|
+
define_singleton_method(name) do |*arguments|
|
7
|
+
$selector += selector % arguments
|
8
|
+
child
|
9
|
+
end
|
10
|
+
return child
|
11
|
+
end
|
12
|
+
|
13
|
+
def p
|
14
|
+
$selector.gsub("\"","").strip
|
15
|
+
end
|
5
16
|
|
6
17
|
def initialize (name,selector,parent)
|
7
18
|
@name = name
|
8
19
|
@selector = selector
|
9
20
|
@parent = parent
|
10
21
|
end
|
22
|
+
|
11
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deepak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Simplify page object definition for UI tests
|
14
14
|
email: anandhadeepak@gmail.com
|
@@ -16,8 +16,6 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
-
- lib/pageify/page.rb
|
20
|
-
- lib/pageify/base_element.rb
|
21
19
|
- lib/pageify/element.rb
|
22
20
|
- lib/pageify/string.rb
|
23
21
|
- lib/pageify.rb
|
@@ -44,5 +42,5 @@ rubyforge_project:
|
|
44
42
|
rubygems_version: 2.0.3
|
45
43
|
signing_key:
|
46
44
|
specification_version: 4
|
47
|
-
summary:
|
45
|
+
summary: removed pages and ablity to add arguments
|
48
46
|
test_files: []
|
data/lib/pageify/base_element.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
$selector
|
2
|
-
class BaseElement
|
3
|
-
attr_accessor :name,:parent
|
4
|
-
def createChild (name,selector)
|
5
|
-
child = Element.new(name,selector,self)
|
6
|
-
define_singleton_method(name) do
|
7
|
-
$selector += selector
|
8
|
-
child
|
9
|
-
end
|
10
|
-
return child
|
11
|
-
end
|
12
|
-
|
13
|
-
def build
|
14
|
-
$selector.gsub("\"","")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|