fluent 0.7.2 → 0.7.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.
- checksums.yaml +4 -4
- data/HISTORY.md +11 -0
- data/README.md +5 -1
- data/lib/fluent/factory.rb +25 -1
- data/lib/fluent/platform_mechanize/platform_object.rb +3 -1
- data/lib/fluent/platform_watir/platform_object.rb +1 -0
- data/lib/fluent/platform_watir/platform_web_elements/select_list.rb +2 -7
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/web_elements/select_list.rb +0 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c79d7d2f797b81cc077bf208424734358ae32312
|
4
|
+
data.tar.gz: 68eaac53b4e08133dcaf1eb46afd5064d065765c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a46811e408cf068b8147d2106301b2d5dad61d343adf4e425d63201b35e3a6e4f1309222bb858c62266fb8dcfeb053f4c48fc705058505e37e61ed445a85cc1
|
7
|
+
data.tar.gz: 51d97e5c42f6eed673a7557c7fc33c3b53c03d57e8c6fe90736724ef6b16fa1f87555dc96e0bff28ec8561de68c4455580b780c4ac698553440bd16ba7392c71
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
Change Log and History
|
2
2
|
======================
|
3
3
|
|
4
|
+
Version 0.7.3 / 2013-12-18
|
5
|
+
--------------------------
|
6
|
+
|
7
|
+
A few small changes and one big change. As for the small changes:
|
8
|
+
|
9
|
+
* Select lists or any elements that have selectable items no longer rely on xpath, but instead on native option objects.
|
10
|
+
|
11
|
+
* The get_cookie_value platform method now returns nil for both Mechanize and Watir. This means that if you look for a key name in a cookie and that key name is not found, a nil is returned.
|
12
|
+
|
13
|
+
The larger change involves adding a new context factory method called on_set(). This new factory method allows you to set the context of a given definition so that it can be reused even if other definitions have already been used. A call to the on_new() factory method will always clear out the context.
|
14
|
+
|
4
15
|
Version 0.7.2 / 2013-12-12
|
5
16
|
--------------------------
|
6
17
|
|
data/README.md
CHANGED
@@ -37,4 +37,8 @@ Contributing
|
|
37
37
|
6. Push to the branch.
|
38
38
|
7. Create a new [pull request](https://help.github.com/articles/using-pull-requests).
|
39
39
|
|
40
|
-
|
40
|
+
A few notes:
|
41
|
+
|
42
|
+
* Pull requests are very welcome and are considered better than bug reports. Please create a feature branch for every separate change that you make. When you make commits, do not change the rakefile, version or history information.
|
43
|
+
|
44
|
+
* If you are contributing changes, make sure you do so on the `develop` branch. So if you fork, make sure you also check out the `develop' branch and make your feature branches off of that.
|
data/lib/fluent/factory.rb
CHANGED
@@ -19,6 +19,11 @@ module Fluent
|
|
19
19
|
return @active
|
20
20
|
end
|
21
21
|
|
22
|
+
if @context.kind_of?(definition)
|
23
|
+
block.call @context if block
|
24
|
+
return @context
|
25
|
+
end
|
26
|
+
|
22
27
|
@active = definition.new(@driver, visit)
|
23
28
|
block.call @active if block
|
24
29
|
|
@@ -38,7 +43,11 @@ module Fluent
|
|
38
43
|
# @return [Object] instance of the definition
|
39
44
|
def on_new(definition, visit=false, &block)
|
40
45
|
definition = get_object_for(definition) if definition.is_a? String
|
41
|
-
|
46
|
+
|
47
|
+
if @context.kind_of?(definition)
|
48
|
+
@context = nil
|
49
|
+
end
|
50
|
+
|
42
51
|
@active = definition.new(@driver, visit)
|
43
52
|
block.call @active if block
|
44
53
|
|
@@ -56,6 +65,21 @@ module Fluent
|
|
56
65
|
|
57
66
|
alias_method :on_visit, :on_view
|
58
67
|
|
68
|
+
# Creates a definition context for actions. If an existing context
|
69
|
+
# exists, that context will be re-used. This also sets a context that
|
70
|
+
# will be used for that definition even if the active definition
|
71
|
+
# changes.
|
72
|
+
#
|
73
|
+
# @param definition [Class] the name of a definition class
|
74
|
+
# @param visit [Boolean] true if the context needs to be called into view
|
75
|
+
# @param block [Proc] logic to execute within the context of the definition
|
76
|
+
# @return [Object] instance of the definition
|
77
|
+
def on_set(definition, visit=false, &block)
|
78
|
+
on(definition, visit, &block)
|
79
|
+
@context = @active
|
80
|
+
@active
|
81
|
+
end
|
82
|
+
|
59
83
|
def get_object_for(definition)
|
60
84
|
definition.split('::').inject(Object) do |obj, name|
|
61
85
|
obj.const_get(name)
|
@@ -20,12 +20,14 @@ module Fluent
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def get_cookie_value(name)
|
23
|
-
for cookie in driver.cookie_jar.cookies
|
23
|
+
for cookie in driver.cookie_jar.cookies
|
24
24
|
if cookie.name == name
|
25
25
|
return cookie.value
|
26
26
|
end
|
27
27
|
end
|
28
|
+
nil
|
28
29
|
end
|
30
|
+
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -34,7 +34,7 @@ module Fluent
|
|
34
34
|
#
|
35
35
|
# @return [Object] Fluent::WebElements::Option
|
36
36
|
def [](index)
|
37
|
-
|
37
|
+
options[index]
|
38
38
|
end
|
39
39
|
|
40
40
|
# Provides an array of Option objects that are contained within
|
@@ -42,12 +42,7 @@ module Fluent
|
|
42
42
|
#
|
43
43
|
# @return [Array] Fluent::WebElements::Option objects
|
44
44
|
def options
|
45
|
-
|
46
|
-
options = web_element.wd.find_elements(:xpath, option_xpath)
|
47
|
-
options.each do |option|
|
48
|
-
elements << ::Fluent::WebElements::Option.new(option, :platform => :watir_webdriver)
|
49
|
-
end
|
50
|
-
elements
|
45
|
+
web_element.options.map { |option| ::Fluent::WebElements::Option.new(option, :platform => :watir_webdriver) }
|
51
46
|
end
|
52
47
|
|
53
48
|
end
|
data/lib/fluent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Nyman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|