webpurify 1.0.1 → 1.0.2

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
- SHA1:
3
- metadata.gz: f6d2603e140f48e687cdc9061d3e9a88c397cb2e
4
- data.tar.gz: 8010a3c177497b00b9747d46de2feab1c7c9c4a7
2
+ SHA256:
3
+ metadata.gz: 9b370624873ef7328f427155979aae3633b4fd73f14b3e80ecbbd30c4734313a
4
+ data.tar.gz: e1a266a85bb376893f4b49750abd39c402164e15407279f81b1306636a39edb5
5
5
  SHA512:
6
- metadata.gz: 053de592de9c6018e073846bc3bb19dfa91948c1ad876220b09211452c29dfd513e2be678d2f2a76b69b15a8b80c0fdb8ab99f071e98b994ddb427cd16071bab
7
- data.tar.gz: 721e14189cb76c7bc53ef707fa7c980d016553d3fdc8298ee24ea693575b4e9e7d3f02b3ab6bccfb446ce199699e2140a09aa30bac4efde08227f30b93a4b0a9
6
+ metadata.gz: b5aaace36db41cf9fe29a217b2cccdb4ee414379e261774c9be0e3e9b73e20999a93fea41ed1b44023f8a50a3e24a099bea73841e9ce3a2b922c20307cdaf5ff
7
+ data.tar.gz: 43c7bf433d9cb0b0f89ef4094ba19c81708070dcb3500dc2345d2c2834e189b05df4695299435e5f70df39832cea462e42151e4292ee575f003b7700ef4674b9
@@ -3,23 +3,23 @@ require 'open-uri'
3
3
  require 'json'
4
4
 
5
5
  module WebPurify
6
-
6
+
7
7
  # WebPurify::Request
8
8
  #
9
9
  # WebPurify::Request handles the HTTP/HTTPS queries to the API endpoints,
10
10
  # converting returned JSON into a usable object.
11
11
  module Request
12
-
12
+
13
13
  WRAPPER = :rsp
14
-
14
+
15
15
  class RequestError < StandardError
16
16
  attr_accessor :code, :msg
17
-
17
+
18
18
  def initialize code, msg
19
19
  @code = code
20
20
  @msg = msg
21
21
  end
22
-
22
+
23
23
  def to_s
24
24
  "[#{@code}] #{@msg}"
25
25
  end
@@ -31,11 +31,11 @@ module WebPurify
31
31
  # @param hash [Hash] The hash to be converted
32
32
  # @return [String] The formatted query string
33
33
  def self.to_query(hash)
34
- return URI.encode(hash.map{|k,v| "#{k}=#{v}"}.join("&"))
34
+ return URI.encode_www_form(hash)
35
35
  end
36
-
37
-
38
- # TODO: Request handling can be dramatically simplified using 'open-uri'
36
+
37
+
38
+ # TODO: Request handling can be dramatically simplified using 'open-uri'
39
39
  #
40
40
  # Executes a query to the API endpoint
41
41
  #
@@ -48,7 +48,7 @@ module WebPurify
48
48
  uri_builder = (request_base[:scheme]=='https') ? URI::HTTPS : URI::HTTP
49
49
  uri = uri_builder.build(
50
50
  :host => request_base[:host],
51
- :path => request_base[:path],
51
+ :path => request_base[:path],
52
52
  :query => WebPurify::Request.to_query(q)
53
53
  )
54
54
  res = JSON.parse(WebPurify::Request.get(uri), :symbolize_names => true)[WRAPPER]
@@ -60,7 +60,7 @@ module WebPurify
60
60
  end
61
61
  end
62
62
 
63
-
63
+
64
64
  # Handles making the query according to http or https scheme
65
65
  #
66
66
  # @param uri [String] The uri to be queried
@@ -1,3 +1,3 @@
1
1
  module WebPurify
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/web_purify.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency "json"
17
17
 
18
- s.add_development_dependency "rspec", "~> 3.8.0"
18
+ s.add_development_dependency "rspec", "~> 3.10.0"
19
19
  s.add_development_dependency "vcr"
20
20
  s.add_development_dependency "webmock"
21
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpurify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Zimmerman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.8.0
33
+ version: 3.10.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.8.0
40
+ version: 3.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: vcr
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -93,7 +93,7 @@ files:
93
93
  homepage: https://github.com/mileszim/webpurify-gem
94
94
  licenses: []
95
95
  metadata: {}
96
- post_install_message:
96
+ post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
99
99
  - lib
@@ -108,13 +108,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.5.2.3
113
- signing_key:
111
+ rubygems_version: 3.2.22
112
+ signing_key:
114
113
  specification_version: 4
115
114
  summary: A RubyGem for interfacing with the WebPurify API.
116
115
  test_files:
117
116
  - spec/spec_helper.rb
118
117
  - spec/support/vcr.rb
119
- - spec/web_purify/methods/text_filters_spec.rb
120
118
  - spec/web_purify/methods/image_filters_spec.rb
119
+ - spec/web_purify/methods/text_filters_spec.rb