fluent 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efc9320b50a769998f510a4de15c2085c5b07749
4
- data.tar.gz: 734f69efd530e24aab3655d31ce298fb18f7fec9
3
+ metadata.gz: c79d7d2f797b81cc077bf208424734358ae32312
4
+ data.tar.gz: 68eaac53b4e08133dcaf1eb46afd5064d065765c
5
5
  SHA512:
6
- metadata.gz: d144f54060f678b79b12cfcfb5060a8bda85bac9ab82ce0551ada1dcb5149e22f3c478f5a58ec9e6aaf6c4ce86d88f763ac0d29078cc7610e6a259fb7d1b4fbb
7
- data.tar.gz: 38e00c369bdc2c9844c753e0d27addc90ed8cf220038e5d70d52577b7df709a3184c44b560fa05ab52536df331d79140deda35a02ea4510aebb0d7ff24e1f261
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
- Do note that pull requests are very welcome and are considered better than bug reports. Please create a topic branch for every separate change that you make. When you make commits, do not change the rakefile, version or history information.
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.
@@ -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
@@ -21,6 +21,7 @@ module Fluent
21
21
  return cookie[:value]
22
22
  end
23
23
  end
24
+ nil
24
25
  end
25
26
 
26
27
  def url
@@ -34,7 +34,7 @@ module Fluent
34
34
  #
35
35
  # @return [Object] Fluent::WebElements::Option
36
36
  def [](index)
37
- ::Fluent::WebElements::Option.new(options[index], :platform => :watir_webdriver)
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
- elements = []
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
@@ -1,3 +1,3 @@
1
1
  module Fluent
2
- VERSION = '0.7.2'
2
+ VERSION = '0.7.3'
3
3
  end
@@ -7,10 +7,6 @@ module Fluent
7
7
  include_platform_specifics_for platform
8
8
  end
9
9
 
10
- def option_xpath
11
- './/child::option'
12
- end
13
-
14
10
  def include_platform_specifics_for(platform)
15
11
  super
16
12
  if platform[:platform] == :watir_webdriver
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.2
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-12 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler