mini-apivore 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
  SHA1:
3
- metadata.gz: ed2c095249dbb5ed92842caaa12837588ad08626
4
- data.tar.gz: a87d80459bd3c25b1c3f3db3c7ca4184648b371c
3
+ metadata.gz: d85e7dd24101374365786adc9d1ce7a9469f363d
4
+ data.tar.gz: f8bcddf844b25c03a5ee142b456be5c4e7547bbe
5
5
  SHA512:
6
- metadata.gz: 003ae52945a90ce823f542b6fe9da873689e85fda85b0410f019c27674962692a3069f3515cbcfad2634c65cd056616daaff2757f3502773ba55f1457447885e
7
- data.tar.gz: 4dc5d98010663a5d1f06061bb43bdc22ac9d08ea700fd95af4bcbd96adb988a76592097e4fa25e533a013488446844037ca83b84583422c255af4f1d4e29c0d4
6
+ metadata.gz: 18f366be86dce400f03e53cef246c58e3a65df998e2c72ca8b3fb603cdf01dcf8ff64a8f6e90db3567a1b76ed3e8c783b98bf6c247a7c05f72e2e8b1bcf212f3
7
+ data.tar.gz: 6ce510195a00e5337cdda680983a0372d9cc11260ba7fac39fd2f1711149b1b8d8db82ff7e835a126a3993643b9da81a77713af2184e81e51409bd38bb032812
@@ -34,8 +34,8 @@ module MiniApivore
34
34
  #---- class methods -----------
35
35
  module ClassMethods
36
36
 
37
- def init_swagger( swagger_path )
38
- SWAGGER_CHECKERS[self] ||= MiniApivore::SwaggerChecker.instance_for(swagger_path)
37
+ def init_swagger( swagger_path, schema= '' )
38
+ SWAGGER_CHECKERS[self] ||= MiniApivore::SwaggerChecker.instance_for(swagger_path, schema)
39
39
  end
40
40
 
41
41
  def runnable_methods
@@ -4,8 +4,8 @@ module MiniApivore
4
4
  class SwaggerChecker
5
5
  PATH_TO_CHECKER_MAP = {}
6
6
 
7
- def self.instance_for(path)
8
- PATH_TO_CHECKER_MAP[path] ||= new(path)
7
+ def self.instance_for(path, schema = '' )
8
+ PATH_TO_CHECKER_MAP[path] ||= new(path, schema)
9
9
  end
10
10
 
11
11
  def has_path?(path)
@@ -64,8 +64,9 @@ module MiniApivore
64
64
 
65
65
  attr_reader :mappings
66
66
 
67
- def initialize(swagger_path)
67
+ def initialize(swagger_path, schema )
68
68
  @swagger_path = swagger_path
69
+ @schema = schema
69
70
  load_swagger_doc!
70
71
  validate_swagger!
71
72
  setup_mappings!
@@ -77,6 +78,8 @@ module MiniApivore
77
78
  end
78
79
 
79
80
  def fetch_swagger!
81
+ return @schema unless @schema.empty?
82
+
80
83
  if File.exist?( swagger_path )
81
84
  JSON.parse( File.read(swagger_path) )
82
85
  else
@@ -1,5 +1,5 @@
1
1
  module Mini
2
2
  module Apivore
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini-apivore
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
  - alekseyl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -80,8 +80,8 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.3'
83
- description: " Provides a tool for testing your application api against your swagger
84
- schema "
83
+ description: " Minitest adaptation of apivore gem,\n Provides
84
+ a tool for testing your application api against your swagger schema "
85
85
  email:
86
86
  - leshchuk@gmail.com
87
87
  executables: []