wikk_webbrowser 0.9.3 → 0.9.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
  SHA256:
3
- metadata.gz: 05a48726ff79f3b3ab04673f97b788115e0e9ea4e8197ffd92253c91fb5c5e87
4
- data.tar.gz: cc459cd74d50280f8e342ce0f826daab71b319a35217827ace6dd1e5a5c6d806
3
+ metadata.gz: c7f11b6872c731db1b23dc25aa9cb950754e9fdb69ff8e352253e85b7fd6a5d6
4
+ data.tar.gz: 60f96f8e01f8c173a2f4fe52566adebabfebe636007301c0b6613345552f75fd
5
5
  SHA512:
6
- metadata.gz: b5719442e0b6b3c4092ff44080042656c51e7ca565f62903e58ab683e8bf0e06878bc788131e96b689fa0825e5d6e24a20d927577794ff312e359cdcd86455e9
7
- data.tar.gz: fdd07d1eb9c5e05a7f800da7449fbc3e1523455b84ac56e62fb6373d9cd4ba18954913896805ff2765cb4372b97ca77ab9d9d09bd4cff9a6140d1c5e9059d0e3
6
+ metadata.gz: 74c83b1796c949e551f9a272810e76b983b8aac11969aade43d9f395321ed6328ce20d55783fb5b26d49b44c1206bcf45987746332e2d28ed480875f69292ae6
7
+ data.tar.gz: a5f1622f436b9c8cd414afe974a4d8a080e52b3485eae6ee5ecc1632b7daf48da101945708726966c1ad1615831ad8e3c7186f81c13bd742651875c40b6b606e
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ robertburrowes Wed Apr 21 18:54:00 2021 +1200
2
+ Bug Fix: content_type was fixed, ignoring param
3
+ robertburrowes Sun Nov 8 18:59:06 2020 +1300
4
+ doc upload issue
5
+ robertburrowes Fri Oct 30 14:52:36 2020 +1300
6
+ #{PROJECT} release 0.9.3
1
7
  robertburrowes Fri Oct 30 14:46:17 2020 +1300
2
8
  rename header() to header_value
3
9
  robertburrowes Fri Oct 30 13:16:07 2020 +1300
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ Hoe.spec "#{PROJECT}" do
14
14
  self.yard_options = ['--markup', 'markdown', '--protected']
15
15
 
16
16
  self.dependency "nokogiri", ['~> 1.0', '>= 1.0.0']
17
+ self.dependency "wikk_json", ['~> 1.0', '>= 1.0.0']
17
18
  self.dependency 'hoe-yard', ['~> 0.1', '>= 0.1.3'], type=:dev
18
19
  end
19
20
 
@@ -5,6 +5,7 @@ module WIKK
5
5
  require 'cgi'
6
6
  require 'nokogiri'
7
7
  require 'base64'
8
+ require 'wikk_json'
8
9
 
9
10
  # WIKK WebBrowser class under MIT Lic. https://github.com/wikarekare.
10
11
  # Wrapper around ruby's http classes
@@ -13,7 +14,7 @@ module WIKK
13
14
  # end
14
15
 
15
16
  class WebBrowser
16
- VERSION = '0.9.3'
17
+ VERSION = '0.9.4'
17
18
 
18
19
  class Error < RuntimeError
19
20
  attr_accessor :web_return_code
@@ -226,8 +227,7 @@ module WIKK
226
227
  header['Accept-Language'] = 'en-US,en;q=0.5'
227
228
  header['Connection'] = 'keep-alive'
228
229
  header['User-Agent'] = 'Mozilla/5.0'
229
- #header['Content-Type'] = data.class == Hash ? 'application/x-www-form-urlencoded' : "text/json"
230
- header['Content-Type'] = 'application/x-www-form-urlencoded'
230
+ header['Content-Type'] = content_type
231
231
  add_cookies(extra_cookies)
232
232
  header['Cookie'] = cookies_to_s if @cookies.length > 0
233
233
  header['DNT'] = "1"
@@ -240,7 +240,11 @@ module WIKK
240
240
 
241
241
  if data != nil
242
242
  if data.class == Hash
243
- req.set_form_data(data, '&')
243
+ if content_type =~ /application\/octet-stream/
244
+ req.set_form_data(data, '&')
245
+ else
246
+ req.set_form_data.to_j
247
+ end
244
248
  else
245
249
  req.body = data #If json as a string or raw string
246
250
  end
@@ -268,7 +272,6 @@ module WIKK
268
272
  # send a DELETE query to the server and return the response.
269
273
  # @param query [String] URL, less the 'http://host/' part
270
274
  # @param authorization [String] If present, add Authorization header, using this string
271
- # @param content_type [String] Posted content type
272
275
  # @param extra_headers [Hash] Add these to standard headers
273
276
  # @param extra_cookies [Hash] Add these to standard cookies
274
277
  # @return [String] The Net::HTTPResponse.body text response from the web server
@@ -318,8 +321,7 @@ module WIKK
318
321
  header['Accept-Language'] = 'en-US,en;q=0.5'
319
322
  header['Connection'] = 'keep-alive'
320
323
  header['User-Agent'] = 'Mozilla/5.0'
321
- #header['Content-Type'] = data.class == Hash ? 'application/x-www-form-urlencoded' : "text/json"
322
- header['Content-Type'] = 'application/x-www-form-urlencoded'
324
+ header['Content-Type'] = content_type
323
325
  add_cookies(extra_cookies)
324
326
  header['Cookie'] = cookies_to_s if @cookies.length > 0
325
327
  header['DNT'] = "1"
@@ -332,7 +334,11 @@ module WIKK
332
334
 
333
335
  if data != nil
334
336
  if data.class == Hash
335
- req.set_form_data(data, '&')
337
+ if content_type =~ /application\/octet-stream/
338
+ req.set_form_data(data, '&')
339
+ else
340
+ req.set_form_data.to_j
341
+ end
336
342
  else
337
343
  req.body = data #If json as a string or raw string
338
344
  end
data/version CHANGED
@@ -1,2 +1,2 @@
1
1
  PROJECT="wikk_webbrowser"
2
- VERSION="0.9.3"
2
+ VERSION="0.9.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikk_webbrowser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Burrowes
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-30 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -30,6 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: wikk_json
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.0.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.0.0
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: hoe-yard
35
55
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +101,7 @@ homepage: https://wikarekare.github.io/wikk_webbrowser/
81
101
  licenses:
82
102
  - MIT
83
103
  metadata: {}
84
- post_install_message:
104
+ post_install_message:
85
105
  rdoc_options:
86
106
  - "--markup"
87
107
  - markdown
@@ -102,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
122
  - !ruby/object:Gem::Version
103
123
  version: '0'
104
124
  requirements: []
105
- rubygems_version: 3.1.2
106
- signing_key:
125
+ rubygems_version: 3.1.4
126
+ signing_key:
107
127
  specification_version: 4
108
128
  summary: Wrapper around ruby http and https libraries
109
129
  test_files: []