super_parser 0.1.0 → 0.1.1

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: 96a8d2e66a7bfe201bbeea71c95735a1cc3ba07743146298af615f7c23d9ae12
4
- data.tar.gz: ec1e3dcf883fe8315a1c553465b834064426c5308d1664374ee2c8328ca6c747
3
+ metadata.gz: 176c6ac3b2f40ff38ce140c0039214ea60be539551d4cd660157d0aa66e851aa
4
+ data.tar.gz: 4621470b5e42eb7cfc0f1ac242a6816d3f7f3df6e6a18ac53ea522539ba29bac
5
5
  SHA512:
6
- metadata.gz: 0161adf0fe415fc5a687ddad10e2d753d92038ecdcb90fc9797537969c69e34870300a4a8971ab5e9e96e585f8c8d91da935fffd1b3cfdf420f8b9d13f6a713b
7
- data.tar.gz: 2c7ef0440683534a43213c7f583ae9c61b6bfeff3cbffce5109187ce189e65c2ec225c71fd8485ba3df236372542d0ca9eeafa9f2bdebb13d167dbca3fe221b6
6
+ metadata.gz: f83cf590b3c663f743771909b33b9f0abea5639d77b09e783a6b4049d5ac1eac7134b36feeabfa792d0c6bd97f9328d892fb5daa95e7fcd907bd71539fe30661
7
+ data.tar.gz: f0a04af71ee6edea83bdb1795fa2aa89b109595bbeca695542f8a93cfd0a34c08f62d461c12b645e1eb3742d8707f9ca6083d248b3d230fbcbd45fd521acfa0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- super_parser (0.1.0)
4
+ super_parser (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,25 +5,23 @@ require_relative 'client_error'
5
5
 
6
6
  module SuperParser # :nodoc:
7
7
  class Client
8
- def parse(filepath)
8
+ def parse(file)
9
9
  uri = URI('https://api.superparser.com/parse')
10
10
  request = Net::HTTP::Post.new(uri)
11
11
  request['X-API-KEY'] = SuperParser.api_key
12
12
  request['accept'] = 'application/json'
13
13
 
14
- File.open(filepath) do |file|
15
- form_data = [['file_name', file]]
14
+ form_data = [['file_name', file]]
16
15
 
17
- request.set_form form_data, 'multipart/form-data'
18
- response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
19
- http.request(request)
20
- end
16
+ request.set_form form_data, 'multipart/form-data'
17
+ response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
18
+ http.request(request)
19
+ end
21
20
 
22
- if response.code != 200
23
- SuperParser::ClientError.new response
24
- else
25
- SuperParser::Response.new(response.body)
26
- end
21
+ if response.code != 200
22
+ SuperParser::ClientError.new response
23
+ else
24
+ SuperParser::Response.new(response.body)
27
25
  end
28
26
  end
29
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SuperParser
4
- VERSION = "0.1.0"
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Watling