husc 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/husc.rb +8 -0
- data/lib/husc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 288319d18b53995f517d2a64a92a99bd8496c0d8e5a9dbbed81a44ad9eb8f2a4
|
4
|
+
data.tar.gz: 4024ce1408fdcd950db1c87c93cd72c61530dc499a3f60dc86b07d6d3487aab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d2980b00653212995ee9b9f9112593667c71c0f9aed5ad224e421b690ccd624d74b8d66878d893dd416c1f53c56ccbe8817a476c6e5177527e0b2babf183c50
|
7
|
+
data.tar.gz: c3bab2dd63d055977380dc607dd502e47643d27fd3be7f438c77d15ddd0af4a4f46ec31d9d000aa28eeefe0b3589448bc18861a28c5a8ec5fc5972061eac13c0
|
data/README.md
CHANGED
@@ -81,8 +81,13 @@ doc.submit(id:'id attribute') # submit
|
|
81
81
|
doc.send(id:'id attribute', file_name:'target file name')
|
82
82
|
|
83
83
|
# checkbox
|
84
|
-
doc.send(id:'id attribute', check:
|
85
|
-
doc.send(id:'id attribute', check:
|
84
|
+
doc.send(id:'id attribute', check:true) # check
|
85
|
+
doc.send(id:'id attribute', check:false) # uncheck
|
86
|
+
|
87
|
+
# button click
|
88
|
+
doc.send(id:'id attribute', button:true) # click
|
89
|
+
doc.send(id:'id attribute', button:false) # unclick
|
90
|
+
|
86
91
|
|
87
92
|
# example of specify other attribute
|
88
93
|
doc.send(name:'name attribute', value:'hello')
|
data/lib/husc.rb
CHANGED
@@ -79,6 +79,7 @@ class Husc
|
|
79
79
|
# テキスト,数値など => value(String)を指定
|
80
80
|
# チェックボックス => check(Bool)を指定
|
81
81
|
# ファイルアップロード => file(String)を指定
|
82
|
+
# ボタンクリック => button(Bool)を指定
|
82
83
|
@params << {}
|
83
84
|
opts.each {|key, value| @params[-1][key.to_sym] = value}
|
84
85
|
end
|
@@ -119,6 +120,13 @@ class Husc
|
|
119
120
|
next if file.nil? || !File.exist?(file)
|
120
121
|
form.file_upload_with(**param).file_name = file unless form.file_upload_with(**param).nil?
|
121
122
|
end
|
123
|
+
|
124
|
+
# ボタンクリック
|
125
|
+
if param.include?(:button)
|
126
|
+
button = param.delete(:button)
|
127
|
+
next unless button
|
128
|
+
form.button_with(**param) unless form.button_with(**param).nil?
|
129
|
+
end
|
122
130
|
end
|
123
131
|
|
124
132
|
form = form.submit
|
data/lib/husc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: husc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Abe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|