grape-apiary 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 +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/grape-apiary.gemspec +2 -2
- data/lib/grape-apiary/blueprint.rb +1 -1
- data/lib/grape-apiary/config.rb +2 -2
- data/lib/grape-apiary/route.rb +4 -2
- data/lib/grape-apiary/tasks/grape-apiary.rake +1 -1
- data/lib/grape-apiary/version.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/support/sample_api.rb +5 -5
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7392f7859d48b22a26462122e44732faafd1394
|
4
|
+
data.tar.gz: 4ce08e233fe165f7d3d3099d65595f57031897e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96a8b45ddc939908fae953560905bb18964e57aed7d5bf32f30d889061f521c5d346c25343063aaba64c281f9e17bcaf43e69d26c75096d8cd14b2477e926d74
|
7
|
+
data.tar.gz: 179fb681a38be1b2b56f5710bccfecfcb98da13e00ea47dabc2fb125ed71f1a544598020c1775978f0f4229c53bb2835ec08b2083de270cb915df0361d5285b3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## 0.1.1 (2016-01-25)
|
6
|
+
#### Fixes
|
7
|
+
- [PR #8](https://github.com/technekes/grape-apiary/pull/8) - Handle mixed keys (symbol/string) in params [@jallen3d](https://github.com/johnallen3d).
|
8
|
+
|
5
9
|
## 0.1.0 (2016-01-25)
|
6
10
|
#### Features
|
7
11
|
- [PR #5](https://github.com/technekes/grape-apiary/pull/5) - Rake task persists docs to disk from [@bigfleet](https://github.com/bigfleet).
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# GrapeApiary
|
2
2
|
|
3
|
-
[![Code Climate](https://codeclimate.com/github/technekes/grape-apiary.
|
4
|
-
[![Build Status](https://travis-ci.org/technekes/grape-apiary.
|
5
|
-
[![Coverage
|
3
|
+
[![Code Climate](https://codeclimate.com/github/technekes/grape-apiary/badges/gpa.svg)](https://codeclimate.com/github/technekes/grape-apiary)
|
4
|
+
[![Build Status](https://travis-ci.org/technekes/grape-apiary.svg?branch=master)](https://travis-ci.org/technekes/grape-apiary)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/technekes/grape-apiary/badges/coverage.svg)](https://codeclimate.com/github/technekes/grape-apiary/coverage)
|
6
6
|
[![Dependency Status](https://gemnasium.com/technekes/grape-apiary.png)](https://gemnasium.com/connexio-labs/grape-apiary)
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/grape-apiary.png)](http://badge.fury.io/rb/grape-apiary)
|
8
8
|
|
data/grape-apiary.gemspec
CHANGED
@@ -28,11 +28,11 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency 'grape', '~> 0.14'
|
29
29
|
spec.add_runtime_dependency 'activesupport'
|
30
30
|
|
31
|
-
spec.add_development_dependency '
|
31
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
32
32
|
spec.add_development_dependency 'rspec', '~> 2.14'
|
33
33
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
34
34
|
spec.add_development_dependency 'rake', '~> 10.0'
|
35
|
-
spec.add_development_dependency 'rubocop', '
|
35
|
+
spec.add_development_dependency 'rubocop', '>= 0.37', '< 1.0'
|
36
36
|
spec.add_development_dependency 'pry', '~> 0.9'
|
37
37
|
spec.add_development_dependency 'guard', '~> 2.4'
|
38
38
|
spec.add_development_dependency 'guard-rspec', '~> 4.2'
|
data/lib/grape-apiary/config.rb
CHANGED
@@ -35,10 +35,10 @@ module GrapeApiary
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def example_id_type=(value)
|
38
|
-
|
38
|
+
raise UnsupportedIDType unless supported_id_types.include?(value)
|
39
39
|
|
40
40
|
if value.to_sym == :bson && !Object.const_defined?('BSON')
|
41
|
-
|
41
|
+
raise BSONNotDefinied
|
42
42
|
end
|
43
43
|
|
44
44
|
@example_id_type = value
|
data/lib/grape-apiary/route.rb
CHANGED
@@ -5,8 +5,10 @@ module GrapeApiary
|
|
5
5
|
delegate :route_namespace, :route_path, :route_method, to: '__getobj__'
|
6
6
|
|
7
7
|
def route_params
|
8
|
-
@route_params ||=
|
9
|
-
|
8
|
+
@route_params ||= begin
|
9
|
+
__getobj__.route_params.stringify_keys.sort.map do |param|
|
10
|
+
Parameter.new(self, *param)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
@@ -2,7 +2,7 @@ namespace :ga do
|
|
2
2
|
desc 'Produce documentation'
|
3
3
|
task docs: :environment do
|
4
4
|
api = ENV['API'] || ARGV[1]
|
5
|
-
|
5
|
+
raise 'You must provide the name of an API to document' if api.nil?
|
6
6
|
begin
|
7
7
|
api_class = Object.const_get(api)
|
8
8
|
api_docs = GrapeApiary::Blueprint.new(api_class).generate
|
data/lib/grape-apiary/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/support/sample_api.rb
CHANGED
@@ -10,12 +10,12 @@ class SampleApi < Grape::API
|
|
10
10
|
|
11
11
|
desc 'create a widget'
|
12
12
|
params do
|
13
|
-
requires
|
14
|
-
type:
|
13
|
+
requires 'name',
|
14
|
+
type: String,
|
15
15
|
desc: 'the widgets name',
|
16
16
|
documentation: { example: 'super widget' }
|
17
17
|
optional :description,
|
18
|
-
type:
|
18
|
+
type: String,
|
19
19
|
desc: 'the widgets name',
|
20
20
|
documentation: { example: 'the best widget ever made' }
|
21
21
|
end
|
@@ -24,8 +24,8 @@ class SampleApi < Grape::API
|
|
24
24
|
|
25
25
|
desc 'update a widget'
|
26
26
|
params do
|
27
|
-
optional :name, type:
|
28
|
-
optional :description, type:
|
27
|
+
optional :name, type: String, desc: 'the widgets name'
|
28
|
+
optional :description, type: String, desc: 'the widgets name'
|
29
29
|
end
|
30
30
|
put ':id' do
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-apiary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: codeclimate-test-reporter
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.4'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,22 @@ dependencies:
|
|
98
98
|
name: rubocop
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.37'
|
104
|
+
- - "<"
|
102
105
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0
|
106
|
+
version: '1.0'
|
104
107
|
type: :development
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
108
|
-
- - "
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0.37'
|
114
|
+
- - "<"
|
109
115
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0
|
116
|
+
version: '1.0'
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
118
|
name: pry
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
232
|
version: '0'
|
227
233
|
requirements: []
|
228
234
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
235
|
+
rubygems_version: 2.6.3
|
230
236
|
signing_key:
|
231
237
|
specification_version: 4
|
232
238
|
summary: Allows for generating an Apiary Blueprint for you Grape API
|