grape-apiary 0.2.0 → 1.0.0

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
- SHA1:
3
- metadata.gz: d2c1b3556b4fefbfcfbb7ea54fee65c68b37f64e
4
- data.tar.gz: 1707ad4ad0b7bab8b79b702e934744a697033459
2
+ SHA256:
3
+ metadata.gz: f15baf2f928e704b22c5d37d1c41463341194e2edf5a7f36290f4936c14a6ebe
4
+ data.tar.gz: 5b1e793a02d2bd82f1600f674d09c4080fe17aed951abbbf2fe3bbce508be198
5
5
  SHA512:
6
- metadata.gz: c2681493022439dd8bddacaa3ac6e5cd7528fa8022eae5edbc91d1a25f54006037713fc9c71eeb38053fd4adbe4581318dc1122d5d53bc71d612d6f72972c8ad
7
- data.tar.gz: 5a34bc8a197ff3a124bf4ec4623a19e796928548cc304e1ff2f5e238edf3a4f6fa3ce0e719f35d02faddc144434ec96d9fa153ad505174585cce347e035537f8
6
+ metadata.gz: a821e36bcb47f1c2257a59c47282eebc5b50f4686aa12fd4b77cf2f986fce4cd4b5c056aa1e5da19e39890615d26961a62568ada5b8ccea5e6e19c1046613975
7
+ data.tar.gz: 97adf592beda9ef045d0fc3224d39acef628b415b8ce76345c6eac120e132e6fffddabfeb6bdd46eea33a01d612ad798199882851aec5ee957c24a50081c8a36
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.4
2
3
  Excludes:
3
4
  - Rakefile
4
5
  - vendor/**/*
@@ -22,7 +23,7 @@ AlignParameters:
22
23
  # )
23
24
  EnforcedStyle: with_fixed_indentation
24
25
 
25
- Style/AlignParameters:
26
+ Layout/AlignParameters:
26
27
  # allow for end of if to be aligned with a variable.
27
28
  # for example:
28
29
  #
@@ -33,7 +34,7 @@ Style/AlignParameters:
33
34
  # end
34
35
  EnforcedStyle: with_fixed_indentation
35
36
 
36
- Style/ElseAlignment:
37
+ Layout/ElseAlignment:
37
38
  Enabled: false
38
39
 
39
40
  Lint/EndAlignment:
@@ -41,7 +42,7 @@ Lint/EndAlignment:
41
42
 
42
43
  ClassAndModuleChildren:
43
44
  # ok to use compact style when modules are predefined.
44
- # for example the following is fine so long as we're sure that
45
+ # for example the following is fine so long as we're sure that
45
46
  # module MDB has already been required/defined.
46
47
  #
47
48
  # class Foo::Bar; end
@@ -52,3 +53,12 @@ Metrics/BlockLength:
52
53
  Exclude:
53
54
  - 'grape-apiary.gemspec'
54
55
  - 'spec/**/*'
56
+
57
+ Style/FrozenStringLiteralComment:
58
+ Enabled: false
59
+
60
+ Style/PercentLiteralDelimiters:
61
+ PreferredDelimiters:
62
+ default: ()
63
+ "%i": ()
64
+ "%w": ()
@@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## Recent updates
6
6
 
7
+ ## 1.0.0 (2017-12-20)
8
+
9
+ #### Maintenance
10
+
11
+ - [PR #16](https://github.com/technekes/grape-apiary/pull/16) - Upgrade to latest version of RuboCop [@jallen3d](https://github.com/johnallen3d).
12
+ - [PR #15](https://github.com/technekes/grape-apiary/pull/15) - Update for grape 1.0 [@travisp](https://github.com/travisp).
13
+
7
14
  ## 0.2.0 (2017-02-21)
8
15
 
9
16
  #### Maintenance
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'grape-apiary/version'
@@ -25,16 +24,16 @@ Gem::Specification.new do |spec|
25
24
  docuementation that is created by your Grape API
26
25
  DESCRIPTION
27
26
 
28
- spec.add_runtime_dependency 'grape', '>= 0.16.0', '<= 0.19.1'
29
27
  spec.add_runtime_dependency 'activesupport'
28
+ spec.add_runtime_dependency 'grape', '>= 0.16.0', '<= 1.0.1'
30
29
 
31
- spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
32
- spec.add_development_dependency 'rspec', '~> 2.14'
33
30
  spec.add_development_dependency 'bundler', '~> 1.5'
34
- spec.add_development_dependency 'rake', '~> 10.0'
35
- spec.add_development_dependency 'rubocop', '>= 0.37', '< 1.0'
36
- spec.add_development_dependency 'pry', '~> 0.9'
31
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
37
32
  spec.add_development_dependency 'guard', '~> 2.4'
38
- spec.add_development_dependency 'guard-rspec', '~> 4.2'
39
33
  spec.add_development_dependency 'guard-bundler', '~> 2.0'
34
+ spec.add_development_dependency 'guard-rspec', '~> 4.2'
35
+ spec.add_development_dependency 'pry', '~> 0.9'
36
+ spec.add_development_dependency 'rake', '~> 10.0'
37
+ spec.add_development_dependency 'rspec', '~> 2.14'
38
+ spec.add_development_dependency 'rubocop', '>= 0.37', '< 1.0'
40
39
  end
@@ -1,15 +1,15 @@
1
1
  module GrapeApiary
2
2
  class Config
3
- SETTINGS = [
4
- :host,
5
- :name,
6
- :description,
7
- :request_headers,
8
- :response_headers,
9
- :example_id_type,
10
- :resource_exclusion,
11
- :include_root
12
- ].freeze
3
+ SETTINGS = %i(
4
+ host
5
+ name
6
+ description
7
+ request_headers
8
+ response_headers
9
+ example_id_type
10
+ resource_exclusion
11
+ include_root
12
+ ).freeze
13
13
 
14
14
  class << self
15
15
  attr_accessor(*SETTINGS)
@@ -31,7 +31,7 @@ module GrapeApiary
31
31
  end
32
32
 
33
33
  def supported_id_types
34
- [:integer, :uuid, :bson]
34
+ %i(integer uuid bson)
35
35
  end
36
36
 
37
37
  def example_id_type=(value)
@@ -3,8 +3,6 @@ module GrapeApiary
3
3
  attr_reader :route, :full_name, :name, :settings
4
4
 
5
5
  delegate :route_model, :namespace, to: :route
6
- delegate :requirement, :type, :documentation, :desc, to: :settings
7
- delegate :example, to: :documentation, allow_nil: true
8
6
 
9
7
  def initialize(route, name, options)
10
8
  @full_name = name
@@ -14,6 +12,26 @@ module GrapeApiary
14
12
  @settings = parse_options(options)
15
13
  end
16
14
 
15
+ def requirement
16
+ settings[:requirement]
17
+ end
18
+
19
+ def type
20
+ settings[:type]
21
+ end
22
+
23
+ def desc
24
+ settings[:desc]
25
+ end
26
+
27
+ def documentation
28
+ settings[:documentation]
29
+ end
30
+
31
+ def example
32
+ documentation ? documentation[:example] : nil
33
+ end
34
+
17
35
  def description
18
36
  "#{name} (#{requirement}, #{type}, `#{example}`) ... #{desc}"
19
37
  end
@@ -25,7 +43,7 @@ module GrapeApiary
25
43
 
26
44
  options[:requirement] = options[:required] ? 'required' : 'optional'
27
45
 
28
- Hashie::Mash.new(options)
46
+ options
29
47
  end
30
48
 
31
49
  def default_options
@@ -1,5 +1,6 @@
1
1
  # Needed until support for v2.3+ https://goo.gl/DyKn74
2
2
  # frozen_string_literal: true
3
+
3
4
  module GrapeApiary
4
- VERSION = '0.2.0'.freeze
5
+ VERSION = '1.0.0'
5
6
  end
@@ -36,7 +36,7 @@ describe GrapeApiary::Config do
36
36
  end
37
37
 
38
38
  context 'headers' do
39
- [:request_headers, :response_headers].each do |type|
39
+ %i(request_headers response_headers).each do |type|
40
40
  context type do
41
41
  it 'is an array' do
42
42
  expect(subject.send(type)).to be_a(Array)
@@ -2,7 +2,7 @@ shared_context 'configuration' do
2
2
  let(:host) { 'http://grape-apiary.apiary.io' }
3
3
  let(:name) { 'some api v1' }
4
4
  let(:description) { 'some blueprint description' }
5
- let(:resource_exclusion) { [:admin, :swagger_docs] }
5
+ let(:resource_exclusion) { %i(admin swagger_docs) }
6
6
 
7
7
  let(:request_headers) do
8
8
  [{ 'Accept-Charset' => 'utf-8' }]
metadata CHANGED
@@ -1,125 +1,119 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-apiary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Allen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-21 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: grape
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
20
- - - "<="
21
- - !ruby/object:Gem::Version
22
- version: 0.19.1
19
+ version: '0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 0.16.0
30
- - - "<="
31
- - !ruby/object:Gem::Version
32
- version: 0.19.1
26
+ version: '0'
33
27
  - !ruby/object:Gem::Dependency
34
- name: activesupport
28
+ name: grape
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: '0'
33
+ version: 0.16.0
34
+ - - "<="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.0.1
40
37
  type: :runtime
41
38
  prerelease: false
42
39
  version_requirements: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - ">="
45
42
  - !ruby/object:Gem::Version
46
- version: '0'
43
+ version: 0.16.0
44
+ - - "<="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.1
47
47
  - !ruby/object:Gem::Dependency
48
- name: codeclimate-test-reporter
48
+ name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.4'
53
+ version: '1.5'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.4'
60
+ version: '1.5'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rspec
62
+ name: codeclimate-test-reporter
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '2.14'
67
+ version: '0.4'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '2.14'
74
+ version: '0.4'
75
75
  - !ruby/object:Gem::Dependency
76
- name: bundler
76
+ name: guard
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.5'
81
+ version: '2.4'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.5'
88
+ version: '2.4'
89
89
  - !ruby/object:Gem::Dependency
90
- name: rake
90
+ name: guard-bundler
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '10.0'
95
+ version: '2.0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '10.0'
102
+ version: '2.0'
103
103
  - !ruby/object:Gem::Dependency
104
- name: rubocop
104
+ name: guard-rspec
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0.37'
110
- - - "<"
107
+ - - "~>"
111
108
  - !ruby/object:Gem::Version
112
- version: '1.0'
109
+ version: '4.2'
113
110
  type: :development
114
111
  prerelease: false
115
112
  version_requirements: !ruby/object:Gem::Requirement
116
113
  requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: '0.37'
120
- - - "<"
114
+ - - "~>"
121
115
  - !ruby/object:Gem::Version
122
- version: '1.0'
116
+ version: '4.2'
123
117
  - !ruby/object:Gem::Dependency
124
118
  name: pry
125
119
  requirement: !ruby/object:Gem::Requirement
@@ -135,47 +129,53 @@ dependencies:
135
129
  - !ruby/object:Gem::Version
136
130
  version: '0.9'
137
131
  - !ruby/object:Gem::Dependency
138
- name: guard
132
+ name: rake
139
133
  requirement: !ruby/object:Gem::Requirement
140
134
  requirements:
141
135
  - - "~>"
142
136
  - !ruby/object:Gem::Version
143
- version: '2.4'
137
+ version: '10.0'
144
138
  type: :development
145
139
  prerelease: false
146
140
  version_requirements: !ruby/object:Gem::Requirement
147
141
  requirements:
148
142
  - - "~>"
149
143
  - !ruby/object:Gem::Version
150
- version: '2.4'
144
+ version: '10.0'
151
145
  - !ruby/object:Gem::Dependency
152
- name: guard-rspec
146
+ name: rspec
153
147
  requirement: !ruby/object:Gem::Requirement
154
148
  requirements:
155
149
  - - "~>"
156
150
  - !ruby/object:Gem::Version
157
- version: '4.2'
151
+ version: '2.14'
158
152
  type: :development
159
153
  prerelease: false
160
154
  version_requirements: !ruby/object:Gem::Requirement
161
155
  requirements:
162
156
  - - "~>"
163
157
  - !ruby/object:Gem::Version
164
- version: '4.2'
158
+ version: '2.14'
165
159
  - !ruby/object:Gem::Dependency
166
- name: guard-bundler
160
+ name: rubocop
167
161
  requirement: !ruby/object:Gem::Requirement
168
162
  requirements:
169
- - - "~>"
163
+ - - ">="
170
164
  - !ruby/object:Gem::Version
171
- version: '2.0'
165
+ version: '0.37'
166
+ - - "<"
167
+ - !ruby/object:Gem::Version
168
+ version: '1.0'
172
169
  type: :development
173
170
  prerelease: false
174
171
  version_requirements: !ruby/object:Gem::Requirement
175
172
  requirements:
176
- - - "~>"
173
+ - - ">="
177
174
  - !ruby/object:Gem::Version
178
- version: '2.0'
175
+ version: '0.37'
176
+ - - "<"
177
+ - !ruby/object:Gem::Version
178
+ version: '1.0'
179
179
  description: |2
180
180
  Auto generates an Apiary (http://apiary.io) Blueprint from the
181
181
  docuementation that is created by your Grape API
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.8
241
+ rubygems_version: 2.7.2
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Allows for generating an Apiary Blueprint for you Grape API