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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01029823284f8df21714f295f3f8c6a6258e82c7
4
- data.tar.gz: 861604e0197d12d1eeff2c438c100a24f0d97efc
3
+ metadata.gz: cfe9866b65fe31b6bb8bdef7c9b97a10ee6981fc
4
+ data.tar.gz: f355b459518a41ef416903207a507dea99114177
5
5
  SHA512:
6
- metadata.gz: 0af08fd4e5bc15b501325381f0e0a75dde82944c5eb23caaa72dad51f98df88c76a037d53b5cdeb03c7140cac2322029e6ca3b70b324e1cc2bb07200d01837ad
7
- data.tar.gz: 4beb205c4dc22a54cf02697d6eea01d982392cfbba658c5057a7a62719f33a36e5b223987e4773231b43b0efac643602fb0d8bf876506c2a2bcc7c52110811ce
6
+ metadata.gz: d2ea597ea795642ce72add956113154ec81d183608db52f5318f97ae490eec463512976b4c49b351e3ad7c849658089c98f52ff8b710b56ffe41fd10f714cf3e
7
+ data.tar.gz: 507b45b22f04a7d0953d349da141824abf9141f6af5a1454deb2d5c7181418e75a33469550c332e4aec3b777c5b0d878491458bf297e3961a9d8a8c12452139d
data/README.md CHANGED
@@ -1,31 +1,37 @@
1
1
  # GogoDriver
2
2
 
3
- TODO: Write a gem description
3
+ Super simple web driver.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ 1. Install gem as you like.
8
8
 
9
- ```ruby
10
- gem 'gogo_driver'
11
- ```
9
+ $ gem install gogo_driver
10
+
11
+ 2. Install chromedriver. Below is the MacOS example.
12
12
 
13
- And then execute:
13
+ $ brew install chromedriver
14
14
 
15
- $ bundle
16
15
 
17
- Or install it yourself as:
16
+ ## Demo
18
17
 
19
- $ gem install gogo_driver
18
+ Let me show how to login Facebook.
20
19
 
21
- ## Usage
20
+ ```
21
+ require 'gogo_driver'
22
+ include GogoDriver
22
23
 
23
- TODO: Write usage instructions here
24
+ go('https://www.facebook.com/')
24
25
 
25
- ## Contributing
26
+ find('input#email').fill('mail@gogotanaka.com')
26
27
 
27
- 1. Fork it ( https://github.com/[my-github-username]/gogo_driver/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
28
+ find('input#pass').fill('password')
29
+
30
+ submit
31
+
32
+ if driver.has_text?('メールアドレスが正しくありません')
33
+ # ログインエラー後の処理
34
+ else
35
+ # ログイン成功時の処理
36
+ end
37
+ ```
@@ -1,3 +1,3 @@
1
1
  module GogoDriver
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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 init
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
- @entity = Entity.new
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.2
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-10-01 00:00:00.000000000 Z
11
+ date: 2014-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver