esplanade 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0fb54b1b4a7d2189bc3a7aaf773e8da13f480e8
4
- data.tar.gz: 6e3813cd02d74da271545f342438111c84d6887d
3
+ metadata.gz: 5d2e8924853da49cab100e7652334a7852d5780d
4
+ data.tar.gz: 07cf632061f623d79d277fdd1108c59a6a16f4d4
5
5
  SHA512:
6
- metadata.gz: dbb379c57687c884db8812f37229d492d2fd8cd8cfe9776af705f0e940e88aa0217ab069fbd9958d6e0e8b557956dfbabc79ac7a736ade498b6b7f1878f1541a
7
- data.tar.gz: 5a5b32ea4d365ebe4e304ac588633a40ef973950028dbc958d4769688a9c4662aa5e26e03a4e84e710cca68d7e71e5dd36e21115330cbc2724ae75f224029dd6
6
+ metadata.gz: 001fb1b997ca410b358f943e49d6dc47c12d55251ffea0a967b00e393e12156857b4828aa096d2f4ee3f41d458ad582eb31f512824621461d294876af728dff8
7
+ data.tar.gz: 33bb8fb3b67569d6a037a0f4658355a432ec3e31b14d0dec53cdff71cc6e6d31e5f6d8d69b9b0bc3cdbafb650dfd3fbc87e890ffb4b6e7b84a7d2515b50342df
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ### 1.1.0 - 2017-10-18
4
+
5
+ * features
6
+ * add an error Esplanade::Request::PrefixNotMatch
7
+
3
8
  ### 1.0.1 - 2017-10-09
4
9
 
5
10
  * bug fixes
data/README.md CHANGED
@@ -70,7 +70,11 @@ From him the `Esplanade::Request::Error` and `Esplanade::Response::Error` are in
70
70
 
71
71
  ### Esplanade::Request::Error
72
72
 
73
- From him the `Esplanade::Request::NotDocumented`, `Esplanade::Request::BodyIsNotJson` and `Esplanade::Request::Invalid` are inherited.
73
+ From him the `Esplanade::Request::PrefixNotMatch`, `Esplanade::Request::NotDocumented`, `Esplanade::Request::BodyIsNotJson` and `Esplanade::Request::Invalid` are inherited.
74
+
75
+ #### Esplanade::Request::PrefixNotMatch
76
+
77
+ Error message: `{:method=>"method", :path=>"path"}`.
74
78
 
75
79
  #### Esplanade::Request::NotDocumented
76
80
 
data/esplanade.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency 'multi_json', '~> 1.11', '>= 1.11.1'
22
22
  spec.add_runtime_dependency 'json-schema', '~> 2.6', '>= 2.6.2'
23
- spec.add_runtime_dependency 'tomograph', '~> 1.1', '>= 1.1.0'
23
+ spec.add_runtime_dependency 'tomograph', '~> 1.2', '>= 1.2.0'
24
24
  spec.add_development_dependency 'bundler', '~> 1.12'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'byebug', '~> 8.2', '>= 8.2.1'
@@ -7,7 +7,8 @@ module Esplanade
7
7
  end
8
8
 
9
9
  def tomogram
10
- @tomogram ||= @main_documentation.find_request(method: @raw.method, path: @raw.path)
10
+ raise PrefixNotMatch, message unless @main_documentation.prefix_match?(@raw.path)
11
+ @tomogram = @main_documentation.find_request(method: @raw.method, path: @raw.path)
11
12
  raise NotDocumented, message if @tomogram.nil?
12
13
  @tomogram
13
14
  end
@@ -5,9 +5,10 @@ require 'esplanade/request/validation'
5
5
  module Esplanade
6
6
  class Request
7
7
  class Error < Esplanade::Error; end
8
- class NotDocumented < Error; end
9
- class BodyIsNotJson < Error; end
10
- class Invalid < Error; end
8
+ class PrefixNotMatch < Error; end
9
+ class NotDocumented < Error; end
10
+ class BodyIsNotJson < Error; end
11
+ class Invalid < Error; end
11
12
 
12
13
  def initialize(documentation, env)
13
14
  @documentation = documentation
@@ -1,3 +1,3 @@
1
1
  module Esplanade
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esplanade
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.efimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -56,20 +56,20 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '1.1'
59
+ version: '1.2'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.1.0
62
+ version: 1.2.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.1'
69
+ version: '1.2'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 1.1.0
72
+ version: 1.2.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: bundler
75
75
  requirement: !ruby/object:Gem::Requirement