webaccount 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: 4cce96c2044c13d2c9aeb074b70b18e1d3eaf2fa6e02541680b29b09a68232f4
4
- data.tar.gz: 063622745d43653265bd7ccd39d5fda4ec33fc9ca429164bd4fca4b3aad81dce
3
+ metadata.gz: f2ca939518ce138699dd157ad553ac523dfd860e6fa2677fa752e3efbdc5d0a1
4
+ data.tar.gz: 84018b777815434298373801a532f3c88d2e970ed4da0b762de13874e6fccda7
5
5
  SHA512:
6
- metadata.gz: 341e908a3c1fba2c276b38f3b82de622e7389d1f42e8eb563ac152b5819183ccd6e28e2c883282fa909dd23516a786a9527bba2894bb605e945671683051977c
7
- data.tar.gz: 33061d6aa6d5d7f84f23243761b653ea546d523ad8b3066317f1d916e80da987cf510fc8cedc1253fddc19c1ff0862f7554fd2b62aeb55ab1ca4870758fb924f
6
+ metadata.gz: e0891afe41232589ba9d5bcadc419ae69b998ffc4f2c5d852c94884d7e02ee2757fd8253f51dddda253d98173f77964eacf865d2c57a8dee8cbbc59df1df8e35
7
+ data.tar.gz: a6578bc7d5ea85cd75415e41da0bb09c28e2fe40ea30bb34a1c94d5bf63d5bbee5e656a78514b862a87ef4bc8d1c8195ecd39294e3aba5abe138a0b5af3901c1
@@ -0,0 +1,28 @@
1
+ # Thoran/Array/AllButFirst/all_but_first.rb
2
+ # Thoran::Array::AllButFirst#all_but_first
3
+
4
+ # 20141223
5
+ # 0.1.0
6
+
7
+ # Description: This returns a copy of the receiving array with the first element removed.
8
+
9
+ # Changes:
10
+ # 1. + Thoran namespace.
11
+
12
+ require 'Thoran/Array/FirstX/firstX'
13
+
14
+ module Thoran
15
+ module Array
16
+ module AllButFirst
17
+
18
+ def all_but_first
19
+ d = self.dup
20
+ d.first!
21
+ d
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+
28
+ Array.send(:include, Thoran::Array::AllButFirst)
@@ -0,0 +1,21 @@
1
+ # Thoran/Array/FirstX/firstX.rb
2
+ # Thoran::Array::FirstX#first!
3
+
4
+ # 20141223
5
+ # 0.1.0
6
+
7
+ # Description: Sometimes it makes more sense to treat arrays this way.
8
+
9
+ module Thoran
10
+ module Array
11
+ module FirstX
12
+
13
+ def first!
14
+ shift
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+
21
+ Array.send(:include, Thoran::Array::FirstX)
@@ -1,8 +1,8 @@
1
1
  # Thoran/Selenium/WebDriver/Attempt/attempt.rb
2
2
  # Thoran::Selenium::WebDriver::Attempt.attempt
3
3
 
4
- # 20200418
5
- # 0.0.0
4
+ # 20200419
5
+ # 0.0.1
6
6
 
7
7
  # Examples:
8
8
  # 1. driver.attempt do |driver|
@@ -27,7 +27,7 @@ module Thoran
27
27
  begin
28
28
  yield
29
29
  break
30
- rescue Timeout::Error, Selenium::WebDriver::Error::UnknownError, Selenium::WebDriver::Error::NoSuchElementError => e
30
+ rescue Timeout::Error, ::Selenium::WebDriver::Error::UnknownError, ::Selenium::WebDriver::Error::NoSuchElementError => e
31
31
  attempts += 1
32
32
  if attempts >= max_attempts
33
33
  @driver.quit
@@ -1,8 +1,8 @@
1
1
  # Thoran/Selenium/WebDriver/Setup/setup.rb
2
2
  # Thoran::Selenium::WebDriver.setup
3
3
 
4
- # 20200418
5
- # 0.0.0
4
+ # 20200419
5
+ # 0.0.1
6
6
 
7
7
  # Usage:
8
8
  # 1. Binary is in the path:
@@ -24,16 +24,14 @@ module Thoran
24
24
  module WebDriver
25
25
  module Setup
26
26
 
27
- module_function
28
-
29
27
  def setup(path_or_browser)
30
28
  if File.exist?(File.expand_path(path_or_browser.to_s))
31
29
  path = path_or_browser
32
- Selenium::WebDriver.at(path)
33
- Selenium::WebDriver.for(selenium_browser(path))
30
+ at(path)
31
+ ::Selenium::WebDriver.for(selenium_browser(path))
34
32
  else
35
33
  browser = path_or_browser.to_sym.downcase
36
- Selenium::WebDriver.for(browser)
34
+ ::Selenium::WebDriver.for(browser)
37
35
  end
38
36
  end
39
37
 
@@ -63,6 +61,6 @@ end
63
61
 
64
62
  module Selenium
65
63
  module WebDriver
66
- include Thoran::Selenium::WebDriver::Setup
64
+ extend Thoran::Selenium::WebDriver::Setup
67
65
  end
68
66
  end
@@ -0,0 +1,47 @@
1
+ # Thoran/String/ToConst/to_const.rb
2
+ # Thoran::String::ToConst#to_const
3
+
4
+ # 20141223
5
+ # 0.2.0
6
+
7
+ # Description: This takes a string and returns a constant, with unlimited namespacing.
8
+
9
+ # History: Derived from Object#to_const 0.3.0, and superceding Object#to_const.
10
+
11
+ # Changes:
12
+ # 1. + Thoran namespace.
13
+
14
+ # Todo:
15
+ # 1. This only works for two levels of constants. Three and you're stuffed. So, this needs to be recursive...
16
+ # Done iteratively as of 0.1.0.
17
+ # 2. Make this work for symbols. However, this will only work if there's no namespacing. ie. :A is OK, but :A::B is not.
18
+
19
+ # Discussion:
20
+ # 1. Should this go separately into classes for which ::const_get will work and be removed from Object? Done as of 0.1.0.
21
+
22
+ require 'Thoran/Array/AllButFirst/all_but_first'
23
+
24
+ module Thoran
25
+ module String
26
+ module ToConst
27
+
28
+ def to_const
29
+ if self =~ /::/
30
+ constants = self.split('::')
31
+ constant = Object.const_get(constants.first)
32
+ constants = constants.all_but_first
33
+ until constants.empty? do
34
+ constant = constant.const_get(constants.shift)
35
+ end
36
+ else
37
+ constant = Object.const_get(self)
38
+ end
39
+ constant
40
+ end
41
+ alias_method :to_constant, :to_const
42
+
43
+ end
44
+ end
45
+ end
46
+
47
+ String.send(:include, Thoran::String::ToConst)
@@ -1,5 +1,5 @@
1
1
  class WebAccount
2
2
 
3
- VERSION = '0.2.4'
3
+ VERSION = '0.2.5'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webaccount
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -31,12 +31,15 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - lib/Thoran/Array/AllButFirst/all_but_first.rb
35
+ - lib/Thoran/Array/FirstX/firstX.rb
34
36
  - lib/Thoran/Selenium.rb
35
37
  - lib/Thoran/Selenium/WebDriver/Driver/Attempt/attempt.rb
36
38
  - lib/Thoran/Selenium/WebDriver/Remote/W3C/Bridge/ConvertLocators/convert_locators.rb
37
39
  - lib/Thoran/Selenium/WebDriver/SearchContext/ElementPresentQ/element_presentQ.rb
38
40
  - lib/Thoran/Selenium/WebDriver/SearchContext/ElementsPresentQ/elements_presentQ.rb
39
41
  - lib/Thoran/Selenium/WebDriver/Setup/setup.rb
42
+ - lib/Thoran/String/ToConst/to_const.rb
40
43
  - lib/WebAccount.rb
41
44
  - lib/WebAccount/VERSION.rb
42
45
  - lib/web_account.rb