dredd-rack 0.8.2 → 0.9.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 +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +11 -5
- data/lib/dredd/rack/configuration.rb +17 -0
- data/lib/dredd/rack/rake_task.rb +1 -2
- data/lib/dredd/rack/runner.rb +1 -1
- data/lib/dredd/rack/version.rb +1 -1
- data/spec/lib/dredd/rack/configuration_spec.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df0339cc24c130ed3b8ddf0a6c6516b3fde9ed2a
|
4
|
+
data.tar.gz: 6f902e77b941e88d0a25d925d6850d2943b678d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f933506885074736e2486d83eb7b4858a73effe7d620119a9e081645f0ed2a5113643986ee190639c95a5e2d75e78e5055740b27a5222b836f4b2576eba29f49
|
7
|
+
data.tar.gz: add209b7be5f6ee8413589c40aa2714ebdef5d1bf1ca0fed3e63466e07b86fd62b3c127e16e4a725ee59298e6eeac46678e641d7290e37934c84b935780da1cd
|
data/CHANGELOG.md
CHANGED
@@ -3,11 +3,18 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.9.0] - 2016-06-15
|
7
|
+
|
8
|
+
### Added
|
9
|
+
|
10
|
+
- Add **dredd_command** option - with help from @gottfrois
|
11
|
+
- Add configuration handler for convenient initializers
|
12
|
+
|
6
13
|
## [0.8.2] - 2016-06-08
|
7
14
|
|
8
15
|
### Fixed
|
9
16
|
|
10
|
-
- Fix inaccurate counting of command arguments for local API
|
17
|
+
- Fix inaccurate counting of command arguments for local API - @rylnd
|
11
18
|
- Minor fix missing documentation for Dredd v1.0.8 options
|
12
19
|
|
13
20
|
## [0.8.1] - 2016-05-07
|
@@ -72,6 +79,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
72
79
|
The original implementation of the Rake task was shared in this [gist][gist].
|
73
80
|
|
74
81
|
[gist]: https://gist.github.com/gonzalo-bulnes/eec3f73cc7d6605add21
|
82
|
+
[0.9.0]: https://github.com/gonzalo-bulnes/dredd-rack/compare/v0.8.2...v0.9.0
|
75
83
|
[0.8.2]: https://github.com/gonzalo-bulnes/dredd-rack/compare/v0.8.1...v0.8.2
|
76
84
|
[0.8.1]: https://github.com/gonzalo-bulnes/dredd-rack/compare/v0.7.1...v0.8.1
|
77
85
|
[0.8.0]: https://github.com/gonzalo-bulnes/dredd-rack/compare/v0.7.1...v0.8.0
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ Add the gem to your `Gemfile`:
|
|
28
28
|
```ruby
|
29
29
|
# Gemfile
|
30
30
|
|
31
|
-
gem 'dredd-rack', '0.
|
31
|
+
gem 'dredd-rack', '0.9.0' # see semver.org
|
32
32
|
```
|
33
33
|
|
34
34
|
Define which application Dredd::Rack must serve automatically:
|
@@ -38,10 +38,16 @@ Define which application Dredd::Rack must serve automatically:
|
|
38
38
|
|
39
39
|
require 'dredd/rack'
|
40
40
|
|
41
|
-
|
42
|
-
#
|
43
|
-
#
|
44
|
-
|
41
|
+
Dredd::Rack.configure do |config|
|
42
|
+
# Allow the automatic setup of a local application server when necessary
|
43
|
+
#
|
44
|
+
# Find the name of your application in its `config.ru` file.
|
45
|
+
config.app = Example::Application # or Rails.application, Sinatra::Application...
|
46
|
+
|
47
|
+
# Optionally, you can define a custom Dredd command:
|
48
|
+
config.dredd_command = 'dredd'
|
49
|
+
end
|
50
|
+
|
45
51
|
```
|
46
52
|
|
47
53
|
Usage
|
@@ -19,9 +19,26 @@ module Dredd
|
|
19
19
|
@@app = object
|
20
20
|
end
|
21
21
|
|
22
|
+
# Return the command to be runned to invoke Dredd
|
23
|
+
def dredd_command
|
24
|
+
@@dredd_command
|
25
|
+
end
|
26
|
+
|
27
|
+
# Set a custom Dredd command
|
28
|
+
#
|
29
|
+
# command - the command String
|
30
|
+
def dredd_command=(command)
|
31
|
+
@@dredd_command = command
|
32
|
+
end
|
33
|
+
|
22
34
|
# Default configuration
|
23
35
|
@@app = nil
|
36
|
+
@@dredd_command = 'dredd'
|
24
37
|
|
38
|
+
# Allow the default configuration to be overwritten from initializers
|
39
|
+
def configure
|
40
|
+
yield self if block_given?
|
41
|
+
end
|
25
42
|
end
|
26
43
|
end
|
27
44
|
end
|
data/lib/dredd/rack/rake_task.rb
CHANGED
data/lib/dredd/rack/runner.rb
CHANGED
@@ -49,7 +49,7 @@ module Dredd
|
|
49
49
|
# api_endpoint - the API URL as a String
|
50
50
|
#
|
51
51
|
def initialize(api_endpoint=nil)
|
52
|
-
@dredd_command =
|
52
|
+
@dredd_command = Dredd::Rack.dredd_command
|
53
53
|
@paths_to_blueprints = 'doc/*.apib doc/*.apib.md'
|
54
54
|
@api_endpoint = api_endpoint || ''
|
55
55
|
@command_parts = []
|
data/lib/dredd/rack/version.rb
CHANGED
@@ -16,7 +16,7 @@ describe Dredd::Rack::Configuration do
|
|
16
16
|
|
17
17
|
let(:subject) { @klass }
|
18
18
|
|
19
|
-
describe 'provides
|
19
|
+
describe 'provides .app which' do
|
20
20
|
|
21
21
|
it_behaves_like 'a configuration option', 'app'
|
22
22
|
|
@@ -24,5 +24,14 @@ describe Dredd::Rack::Configuration do
|
|
24
24
|
expect(subject.app).to be_nil
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
describe 'provides .dredd_command which' do
|
29
|
+
|
30
|
+
it_behaves_like 'a configuration option', 'dredd_command'
|
31
|
+
|
32
|
+
it "defauts to 'dredd'", private: true do
|
33
|
+
expect(subject.dredd_command).to eq 'dredd'
|
34
|
+
end
|
35
|
+
end
|
27
36
|
end
|
28
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dredd-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo Bulnes Guilpain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|