rspec-apib 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b881ddc9569c27542ca7c4d29c691c9b37d5e85
4
- data.tar.gz: 7c51e086a7f24f4cfdb5fbce93d020fedbf54b9e
3
+ metadata.gz: 1e21bc20a799776d00e2f3b82f83eaf4774259ad
4
+ data.tar.gz: 8eaa71920cf9d9c91b4963db7540ec6e5f8a6974
5
5
  SHA512:
6
- metadata.gz: 06eb471cfa55de3668c81033c899838d0b9810bf39084cecebe79befdf3005d944fe22c47981dc6e214f30576ae5ea25dbee7c3636fca92d2cfe08bb5466a4c7
7
- data.tar.gz: 4ee28410a78066c8397dd347823df202c729ce96e39f9a93a79857322632f387fe2a78f10d25a6601849cc18e8efb9de529c9767cc208a9e3b3fbadb171c5bbb
6
+ metadata.gz: 91fd05e7336b5bc66def994ca582ae77bfd6234ce5fefff43bff0bc4fc91320a87398244b518e48a58fba0a14e81c03b8dcc0728e82ed1ee8e8459f58c19640a
7
+ data.tar.gz: dffd4b76bbdbac4219ff132691b6af552f5925b02ef459189ae2c938c9f0cdebedfbd6b31dc2f49c2c5a7d18e5606abfc1c4be029b9e70609c22a48e032609c5
data/Dockerfile CHANGED
@@ -10,15 +10,16 @@ ENV APP_HOME /usr/src/app
10
10
  RUN mkdir $APP_HOME
11
11
  WORKDIR $APP_HOME
12
12
 
13
- # Copy working directory
14
- ADD . $APP_HOME
13
+ # Install bundler
14
+ RUN gem install bundler
15
+
16
+ # Increase Bundler workers
17
+ ENV BUNDLE_JOBS=2
15
18
 
16
- # Set Bundler cache directory outside of app scope
17
- ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
18
- BUNDLE_JOBS=2 \
19
- BUNDLE_PATH=/bundle
19
+ # Copy working directory
20
+ COPY . $APP_HOME
20
21
 
21
- # Install gems
22
+ # Install newer version of Bundler and gems
22
23
  RUN bundle install
23
24
 
24
25
  # Add bin/ folder to PATH
data/README.md CHANGED
@@ -51,10 +51,21 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
51
51
 
52
52
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
53
53
 
54
- ## Contributing
54
+ ## Testing
55
+
56
+ To do continuous testing during development `guard` can be used. In order to
57
+ test against multiple versions of Rails, the environment variable
58
+ `RAILS_VERSION` can be used to choose a different dependency pattern then the
59
+ default one specified in the *.gemspec* file.
60
+
61
+ ```
62
+ RAILS_VERSION='~> 4.0' bundle install; bundle exec rspec
63
+ RAILS_VERSION='~> 5.0' bundle install; bundle exec rspec
64
+ ```
55
65
 
56
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec-apib. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
66
+ ## Contributing
57
67
 
68
+ Bug reports and pull requests are welcome on GitHub at https://github.com/spieker/rspec-apib. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
58
69
 
59
70
  ## License
60
71
 
data/docker-compose.yml CHANGED
@@ -10,4 +10,4 @@ bundle:
10
10
  image: rspecapib_gem
11
11
  command: echo "I'm a little data container, short and stout..."
12
12
  volumes:
13
- - /bundle
13
+ - /usr/local/bundle
@@ -33,11 +33,11 @@ module RSpec
33
33
 
34
34
  # The routing object for the rails route of the request
35
35
  def route
36
- @route ||= begin
37
- route = routes.router.send(:find_routes, request).first
38
- route = route.third if route.present?
39
- route
36
+ return @route if @route
37
+ routes.router.recognize(request) do |r, params|
38
+ @route = r
40
39
  end
40
+ @route
41
41
  end
42
42
 
43
43
  # The top level example group the example is contained in
@@ -56,7 +56,11 @@ module RSpec
56
56
  parts = route.parts
57
57
  tmp = {}
58
58
  parts.each do |part|
59
- if route.optional_parts.include?(part)
59
+ optional_parts = route.respond_to?(:optional_parts) ?
60
+ route.optional_parts :
61
+ (route.parts - route.required_parts)
62
+
63
+ if optional_parts.include?(part)
60
64
  tmp[part] = "(:#{part}:)"
61
65
  else
62
66
  tmp[part] = ":#{part}:"
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Apib
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
data/rspec-apib.gemspec CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'guard', '~> 2.13.0'
24
24
  spec.add_development_dependency 'guard-rspec', '~> 4.6.4'
25
25
  spec.add_development_dependency 'pry'
26
- spec.add_dependency 'rails', '>= 4.2'
26
+ spec.add_dependency 'rails', (ENV['RAILS_VERSION'] || '>= 4.2')
27
27
  spec.add_dependency 'rspec-rails', '~> 3.4'
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-apib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Spieker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2017-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.5.1
163
+ rubygems_version: 2.6.12
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: Generates API Blueprint from request specs