husc 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -2
  3. data/lib/husc.rb +8 -0
  4. data/lib/husc/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6016132d3b6742b94c4ce4d0681c25e4c0778f9b9698e130b35f7e70f1067543
4
- data.tar.gz: 4bc72e0f0fbbfbcbfa324ddb7c4eb883eb691e7f7a830e1a3f1c819f80db1b45
3
+ metadata.gz: 288319d18b53995f517d2a64a92a99bd8496c0d8e5a9dbbed81a44ad9eb8f2a4
4
+ data.tar.gz: 4024ce1408fdcd950db1c87c93cd72c61530dc499a3f60dc86b07d6d3487aab6
5
5
  SHA512:
6
- metadata.gz: eee1302c94f82342127a4e1d8c3e95b7828dd7b4db3ed0204585a3361a6d7edd6149b6a95ef3f76d11ec3f229ad18c6024b767bf198eed0a43eb45d9a26dc72b
7
- data.tar.gz: ea04929e81b055e85c4b7547d3f30b73dbce54791490f3434ad73634dc6024ca783d27f0750abc4a7298ab7d2b0c057832a7206cca028153967160193d4a5f18
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:True) # check
85
- doc.send(id:'id attribute', check:False) # uncheck
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
@@ -1,3 +1,3 @@
1
1
  class Husc
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2020-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize