fitting 2.0.0 → 2.0.1

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: 06aa35a9c436cb26d67b98c6e0b5f0a895154837
4
- data.tar.gz: b00ac2fe2a7a6decec12900aac058b9ef289ee7e
3
+ metadata.gz: af6b4603c9d55c009611245b88a4e62fcdeea5d9
4
+ data.tar.gz: b8cb478938399c88bd1f04901a9e6331ffac1725
5
5
  SHA512:
6
- metadata.gz: bff39029299d63108358a8ba66809da543af39f08fd73647ca74e8d0dc396aa61cfc2c7033ab3f93166b5a57495c2afaf204da52ed1e505504522d2373c623a0
7
- data.tar.gz: 94f4ab0036598e52ed418600c4a30ef04bbfa47ddb8de772073731217fbda75af0408793b3db0fd75da336f2fa791a02a4d868a3b00d12507ac02b74d936bb43
6
+ metadata.gz: eec87fbdf37cf782b5a08dfaa5503cf1c5e967d307f4f21d2f6dc900011bb3952fe8958d1124c84e3b4e064d7f115189dbcb240e0d5642085cda17ce5de6c3a3
7
+ data.tar.gz: a13432f64d9b36f68398270b26950309d275236e7637c5d3783514a70f4e70631b0bb5f1988ce6ca00f29885b7c503717bab22902dc82e23942c42fe85a5f21a
@@ -20,9 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_runtime_dependency 'json-schema', '~> 2.6', '>= 2.6.2'
23
- spec.add_runtime_dependency 'tomogram_routing', '~> 0.1', '>= 0.1.0'
24
23
  spec.add_runtime_dependency 'multi_json'
25
- spec.add_runtime_dependency 'tomograph', '~> 0.4', '>= 0.4.0'
24
+ spec.add_runtime_dependency 'tomograph', '~> 1.0', '>= 1.0.0'
26
25
  spec.add_development_dependency 'bundler', '~> 1.12'
27
26
  spec.add_development_dependency 'rake', '~> 10.0'
28
27
  spec.add_development_dependency 'byebug', '~> 8.2', '>= 8.2.1'
@@ -30,7 +30,7 @@ module Fitting
30
30
  end
31
31
 
32
32
  def all
33
- @all ||= @tomogram.inject([]) do |routes, request|
33
+ @all ||= @tomogram.to_hash.inject([]) do |routes, request|
34
34
  request['responses'].inject({}) do |responses, response|
35
35
  responses[response['status']] ||= 0
36
36
  responses[response['status']] += 1
@@ -7,14 +7,14 @@ module Fitting
7
7
  @path = env_request.env['PATH_INFO'] || env_request.fullpath
8
8
  @body = env_request.env['action_dispatch.request.request_parameters']
9
9
  @schema = tomogram.find_request(method: @method, path: @path)
10
- @fully_validate = JSON::Validator.fully_validate(@schema['request'], @body) if @schema
10
+ @fully_validate = JSON::Validator.fully_validate(@schema.request, @body) if @schema
11
11
  @valid = false
12
12
  @valid = true if @fully_validate == []
13
13
  self
14
14
  end
15
15
 
16
16
  def route
17
- "#{@schema['method']}\t#{@schema['path']}"
17
+ "#{@schema.method}\t#{@schema.path}"
18
18
  end
19
19
 
20
20
  def real_method_with_path
@@ -1,4 +1,3 @@
1
- require 'tomogram_routing'
2
1
  require 'fitting/configuration'
3
2
  require 'tomograph'
4
3
 
@@ -11,19 +10,11 @@ module Fitting
11
10
  end
12
11
 
13
12
  def craft
14
- if Fitting.configuration.apib_path
15
- @yaml ||= `drafter #{Fitting.configuration.apib_path}`
16
- Tomograph.configure do |config|
17
- config.drafter_yaml = @yaml
18
- config.prefix = Fitting.configuration.prefix
19
- end
20
- else
21
- Tomograph.configure do |config|
22
- config.documentation = Fitting.configuration.drafter_yaml_path
23
- config.prefix = Fitting.configuration.prefix
24
- end
25
- end
26
- TomogramRouting::Tomogram.craft(Tomograph::Tomogram.json)
13
+ Tomograph::Tomogram.new(
14
+ prefix: Fitting.configuration.prefix,
15
+ apib_path: Fitting.configuration.apib_path,
16
+ drafter_yaml_path: Fitting.configuration.drafter_yaml_path,
17
+ )
27
18
  end
28
19
  end
29
20
  end
@@ -1,3 +1,3 @@
1
1
  module Fitting
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitting
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
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-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -30,26 +30,6 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.6.2
33
- - !ruby/object:Gem::Dependency
34
- name: tomogram_routing
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '0.1'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.1.0
43
- type: :runtime
44
- prerelease: false
45
- version_requirements: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '0.1'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.1.0
53
33
  - !ruby/object:Gem::Dependency
54
34
  name: multi_json
55
35
  requirement: !ruby/object:Gem::Requirement
@@ -70,20 +50,20 @@ dependencies:
70
50
  requirements:
71
51
  - - "~>"
72
52
  - !ruby/object:Gem::Version
73
- version: '0.4'
53
+ version: '1.0'
74
54
  - - ">="
75
55
  - !ruby/object:Gem::Version
76
- version: 0.4.0
56
+ version: 1.0.0
77
57
  type: :runtime
78
58
  prerelease: false
79
59
  version_requirements: !ruby/object:Gem::Requirement
80
60
  requirements:
81
61
  - - "~>"
82
62
  - !ruby/object:Gem::Version
83
- version: '0.4'
63
+ version: '1.0'
84
64
  - - ">="
85
65
  - !ruby/object:Gem::Version
86
- version: 0.4.0
66
+ version: 1.0.0
87
67
  - !ruby/object:Gem::Dependency
88
68
  name: bundler
89
69
  requirement: !ruby/object:Gem::Requirement