aitch 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
2
  SHA1:
3
- metadata.gz: 1608bb2a19cd498230af4c13ff13f5470c038b8c
4
- data.tar.gz: 1dd7c3cde77b473060edfccb1865eed448de4cda
3
+ metadata.gz: 12767d163caa4e9cc79b97ff3f8e2cea1c48a494
4
+ data.tar.gz: 38ef91d2cb1d478d890ee7215317e8b6205b2c47
5
5
  SHA512:
6
- metadata.gz: 00029220787908d61ed6b1d64a8dcbe9e0dffdc3f450c3ce67d56b836d9967919fc12a1f18298919876478c5ef916146d529992d1008752b33eff1e36622573c
7
- data.tar.gz: ff9e4b489b83f083d172e035a5440bd4db7ef36404c8f6fe728c408124a8a86927069e18183eea312038b7fb581668fe7e729d39a5e90bd4131811f46c0ee618
6
+ metadata.gz: 5f61de59c13b8716f6deb85fdeb9b9aaa281afc98a9a27dac34c3dc8dd71f5a8390ac7d9c43e11ded32433b25e1f1a50e5ddef36d6588cb088c7ccd2f1233cf7
7
+ data.tar.gz: dfb08e263ebca21387c417d52bcaabb2316bc15dfc29b64fd94401e8c47bee8496e811b7384e01c1812283b1350f71af24bc0398b946aee01983c30e173343e5
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec
3
3
 
4
- gem "pry-meta", platforms: [:ruby_20, :ruby_21, :ruby_22]
4
+ gem "pry-meta", platforms: [:ruby_20, :ruby_21, :ruby_22, :ruby_23]
@@ -19,6 +19,7 @@ require "aitch/namespace"
19
19
  require "aitch/location"
20
20
  require "aitch/configuration"
21
21
  require "aitch/errors"
22
+ require "aitch/engines/json"
22
23
  require "aitch/request"
23
24
  require "aitch/redirect"
24
25
  require "aitch/response/errors"
@@ -0,0 +1,13 @@
1
+ module Aitch
2
+ module Engines
3
+ module JSON
4
+ def self.load(data)
5
+ data && ::JSON.parse(data)
6
+ end
7
+
8
+ def self.dump(data)
9
+ ::JSON.dump(data)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -6,7 +6,7 @@ module Aitch
6
6
  attr_accessor :engine
7
7
  end
8
8
 
9
- self.engine = ::JSON
9
+ self.engine = Engines::JSON
10
10
 
11
11
  def self.type
12
12
  :json
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Aitch
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
@@ -132,7 +132,6 @@ class RequestTest < Minitest::Test
132
132
  assert_equal :post, last_request.method
133
133
  assert_equal "a=1&b=2", last_request.body
134
134
  assert_equal "0.1", last_request.headers["Rendering"]
135
- assert_equal "user", last_request.uri.user
136
- assert_equal "pass", last_request.uri.password
135
+ assert_equal "user:pass", Base64.decode64(last_request.headers["Authorization"].split(" ").last)
137
136
  end
138
137
  end
@@ -3,7 +3,7 @@ require "test_helper"
3
3
 
4
4
  class JsonParserTest < Minitest::Test
5
5
  test "loads JSON" do
6
- JSON.expects(:load).with(%[{"a":1}])
6
+ JSON.expects(:parse).with(%[{"a":1}])
7
7
  Aitch::ResponseParser::JSONParser.load(%[{"a":1}])
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aitch
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
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-03 00:00:00.000000000 Z
11
+ date: 2016-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -126,6 +126,7 @@ files:
126
126
  - lib/aitch.rb
127
127
  - lib/aitch/configuration.rb
128
128
  - lib/aitch/dsl.rb
129
+ - lib/aitch/engines/json.rb
129
130
  - lib/aitch/errors.rb
130
131
  - lib/aitch/ext/to_query.rb
131
132
  - lib/aitch/location.rb