gogo_driver 0.0.3 → 0.0.4

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: cfe9866b65fe31b6bb8bdef7c9b97a10ee6981fc
4
- data.tar.gz: f355b459518a41ef416903207a507dea99114177
3
+ metadata.gz: 8defa8b4eaafff3763c5bf5c787453838f8cf828
4
+ data.tar.gz: ff100b70b680ba7e3f4478f383166f088459e634
5
5
  SHA512:
6
- metadata.gz: d2ea597ea795642ce72add956113154ec81d183608db52f5318f97ae490eec463512976b4c49b351e3ad7c849658089c98f52ff8b710b56ffe41fd10f714cf3e
7
- data.tar.gz: 507b45b22f04a7d0953d349da141824abf9141f6af5a1454deb2d5c7181418e75a33469550c332e4aec3b777c5b0d878491458bf297e3961a9d8a8c12452139d
6
+ metadata.gz: ef83cdf892398b03c8df7102225cb2dc51df9731c950aa0c0fb6e2c5672a963809c70d5e3cc25835998ca3ff22610d72811150076a2cd88aba3fe831ddccf685
7
+ data.tar.gz: 84ca1a708f3950a2ef76ecca799f4b5506c47e788ff7eb998d45e9b4c90663898c8d81bf5d16e0850f44c5ab9ecdf718f13e89022fdc17130b1db32f070cb30f
data/README.md CHANGED
@@ -19,15 +19,11 @@ Let me show how to login Facebook.
19
19
 
20
20
  ```
21
21
  require 'gogo_driver'
22
- include GogoDriver
23
22
 
24
- go('https://www.facebook.com/')
25
-
26
- find('input#email').fill('mail@gogotanaka.com')
27
-
28
- find('input#pass').fill('password')
29
-
30
- submit
23
+ driver = GogoDriver.new('https://www.facebook.com/')
24
+ driver.find('input#email').fill('mail@gogotanaka.com')
25
+ driver.find('input#pass').fill('password')
26
+ driver.submit
31
27
 
32
28
  if driver.has_text?('メールアドレスが正しくありません')
33
29
  # ログインエラー後の処理
@@ -1,5 +1,6 @@
1
1
  require 'selenium-webdriver'
2
- module GogoDriver
2
+
3
+ class GogoDriver
3
4
  class Entity
4
5
  attr_reader :driver
5
6
 
@@ -1,3 +1,3 @@
1
- module GogoDriver
2
- VERSION = "0.0.3"
1
+ class GogoDriver
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/gogo_driver.rb CHANGED
@@ -1,18 +1,17 @@
1
1
  require "gogo_driver/version"
2
2
  require "gogo_driver/entity"
3
3
 
4
- module GogoDriver
5
- def go(url='https://www.google.com')
6
- @entity = Entity.new unless @entity
4
+ class GogoDriver
5
+ def initialize(url='https://www.google.com')
6
+ @entity = Entity.new
7
7
  @entity.go(url)
8
8
  @last_url = url
9
9
  end
10
- module_function :go
11
10
 
12
11
  def method_missing(method, *args, &block)
13
12
  @entity.respond_to?(method) ? @entity.send(method, *args, &block) : super
14
13
  rescue Errno::ECONNREFUSED
15
- go(@last_url)
14
+ initialize(@last_url)
16
15
  @entity.send(method, *args, &block)
17
16
  end
18
17
  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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - gogotanaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-12 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver