gogo_driver 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -17
- data/lib/gogo_driver/version.rb +1 -1
- data/lib/gogo_driver.rb +7 -3
- 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: cfe9866b65fe31b6bb8bdef7c9b97a10ee6981fc
|
4
|
+
data.tar.gz: f355b459518a41ef416903207a507dea99114177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ea597ea795642ce72add956113154ec81d183608db52f5318f97ae490eec463512976b4c49b351e3ad7c849658089c98f52ff8b710b56ffe41fd10f714cf3e
|
7
|
+
data.tar.gz: 507b45b22f04a7d0953d349da141824abf9141f6af5a1454deb2d5c7181418e75a33469550c332e4aec3b777c5b0d878491458bf297e3961a9d8a8c12452139d
|
data/README.md
CHANGED
@@ -1,31 +1,37 @@
|
|
1
1
|
# GogoDriver
|
2
2
|
|
3
|
-
|
3
|
+
Super simple web driver.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
1. Install gem as you like.
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
$ gem install gogo_driver
|
10
|
+
|
11
|
+
2. Install chromedriver. Below is the MacOS example.
|
12
12
|
|
13
|
-
|
13
|
+
$ brew install chromedriver
|
14
14
|
|
15
|
-
$ bundle
|
16
15
|
|
17
|
-
|
16
|
+
## Demo
|
18
17
|
|
19
|
-
|
18
|
+
Let me show how to login Facebook.
|
20
19
|
|
21
|
-
|
20
|
+
```
|
21
|
+
require 'gogo_driver'
|
22
|
+
include GogoDriver
|
22
23
|
|
23
|
-
|
24
|
+
go('https://www.facebook.com/')
|
24
25
|
|
25
|
-
|
26
|
+
find('input#email').fill('mail@gogotanaka.com')
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
find('input#pass').fill('password')
|
29
|
+
|
30
|
+
submit
|
31
|
+
|
32
|
+
if driver.has_text?('メールアドレスが正しくありません')
|
33
|
+
# ログインエラー後の処理
|
34
|
+
else
|
35
|
+
# ログイン成功時の処理
|
36
|
+
end
|
37
|
+
```
|
data/lib/gogo_driver/version.rb
CHANGED
data/lib/gogo_driver.rb
CHANGED
@@ -2,13 +2,17 @@ require "gogo_driver/version"
|
|
2
2
|
require "gogo_driver/entity"
|
3
3
|
|
4
4
|
module GogoDriver
|
5
|
-
def
|
6
|
-
@entity = Entity.new
|
5
|
+
def go(url='https://www.google.com')
|
6
|
+
@entity = Entity.new unless @entity
|
7
|
+
@entity.go(url)
|
8
|
+
@last_url = url
|
7
9
|
end
|
10
|
+
module_function :go
|
8
11
|
|
9
12
|
def method_missing(method, *args, &block)
|
10
13
|
@entity.respond_to?(method) ? @entity.send(method, *args, &block) : super
|
11
14
|
rescue Errno::ECONNREFUSED
|
12
|
-
@
|
15
|
+
go(@last_url)
|
16
|
+
@entity.send(method, *args, &block)
|
13
17
|
end
|
14
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gogo_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gogotanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|