super_parser 0.1.0 → 0.1.3

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: b5e0636d567f2013c3794af9fff80d0b8a25ad9ca16638b9e771a81527751510
4
+ data.tar.gz: d833ac00a7db001f0758527e3259634022809b6b6978026a1cf8e65d963c1cb5
5
5
  SHA512:
6
- metadata.gz: 0161adf0fe415fc5a687ddad10e2d753d92038ecdcb90fc9797537969c69e34870300a4a8971ab5e9e96e585f8c8d91da935fffd1b3cfdf420f8b9d13f6a713b
7
- data.tar.gz: 2c7ef0440683534a43213c7f583ae9c61b6bfeff3cbffce5109187ce189e65c2ec225c71fd8485ba3df236372542d0ca9eeafa9f2bdebb13d167dbca3fe221b6
6
+ metadata.gz: da120f9282c2879e70c9f6886c59d32263f5e3cde9c1d32d94b001aba6db11e84ee5647d458c5ad7a8ecdb94c697656026bc19b8d27e3a936d610877c5767d49
7
+ data.tar.gz: f9e807599f26e67938f46c899618673a4af0f83815d41740d85612dc57fd64d32f4a01761ab87543dc8baa52a6c4525c7c8451280a1235aa8636f1f49acb89f3
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.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -6,6 +6,8 @@ require_relative 'client_error'
6
6
  module SuperParser # :nodoc:
7
7
  class Client
8
8
  def parse(filepath)
9
+ puts "Parsing #{filepath}..."
10
+
9
11
  uri = URI('https://api.superparser.com/parse')
10
12
  request = Net::HTTP::Post.new(uri)
11
13
  request['X-API-KEY'] = SuperParser.api_key
@@ -19,7 +21,7 @@ module SuperParser # :nodoc:
19
21
  http.request(request)
20
22
  end
21
23
 
22
- if response.code != 200
24
+ if response.code != '200'
23
25
  SuperParser::ClientError.new response
24
26
  else
25
27
  SuperParser::Response.new(response.body)
@@ -2,11 +2,11 @@
2
2
 
3
3
  module SuperParser # :nodoc:
4
4
  class ClientError < StandardError
5
- attr_reader :status
5
+ attr_reader :code
6
6
 
7
7
  def initialize(response)
8
8
  error = JSON.parse response.body
9
- @status = response.status
9
+ @code = response.code
10
10
  super(error['message'])
11
11
  end
12
12
  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.3'
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Watling