Skip to content

Commit 5717920

Browse files
committed
Merge pull request #41 from dblock/multiple-swagger-versions
Test against multiple grape-swagger versions, fix compat with 0.8.0.
2 parents 0ecf289 + 4c68102 commit 5717920

File tree

8 files changed

+140
-15
lines changed

8 files changed

+140
-15
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
sudo: false
2+
13
before_install:
24
- "export DISPLAY=:99.0"
35
- "sh -e /etc/init.d/xvfb start"
@@ -8,3 +10,12 @@ cache: bundler
810

911
rvm:
1012
- 2.1.2
13+
14+
env:
15+
- GRAPE_SWAGGER_VERSION=0.7.2
16+
- GRAPE_SWAGGER_VERSION=0.8.0
17+
- GRAPE_SWAGGER_VERSION=HEAD
18+
19+
matrix:
20+
allow_failures:
21+
- env: GRAPE_SWAGGER_VERSION=HEAD

CONTRIBUTING.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Contributing to Grape-Swagger-Rails
2+
3+
This project is work of [many contributors](https://github.com/BrandyMint/grape-swagger-rails/graphs/contributors).
4+
You're encouraged to submit [pull requests](https://github.com/BrandyMint/grape-swagger-rails/pulls),
5+
[propose features and discuss issues](https://github.com/BrandyMint/grape-swagger-rails/issues).
6+
7+
In the examples below, substitute your Github username for `contributor` in URLs.
8+
9+
## Fork the Project
10+
11+
Fork the [project on Github](https://github.com/BrandyMint/grape-swagger-rails) and check out your copy.
12+
13+
```
14+
git clone https://github.com/contributor/grape-swagger.git
15+
cd grape-swagger
16+
git remote add upstream https://github.com/BrandyMint/grape-swagger-rails.git
17+
```
18+
19+
## Create a Topic Branch
20+
21+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
22+
23+
```
24+
git checkout master
25+
git pull upstream master
26+
git checkout -b my-feature-branch
27+
```
28+
29+
## Bundle Install and Test
30+
31+
Ensure that you can build the project and run tests.
32+
33+
```
34+
bundle install
35+
bundle exec rake
36+
```
37+
38+
## Write Tests
39+
40+
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
41+
Add to [spec](spec).
42+
43+
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
44+
45+
## Write Code
46+
47+
Implement your feature or bug fix.
48+
49+
Make sure that `bundle exec rake` completes without errors.
50+
51+
You might find it useful to iterate on code by running the test project from spec/dummy.
52+
53+
```
54+
spec/dummy$ GRAPE_SWAGGER_VERSION=HEAD bundle install
55+
56+
Updating git://github.com/tim-vandecasteele/grape-swagger.git
57+
Fetching gem metadata from https://rubygems.org/.........
58+
Resolving dependencies...
59+
...
60+
61+
spec/dummy$ GRAPE_SWAGGER_VERSION=HEAD rails s
62+
=> Booting WEBrick
63+
=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000
64+
=> Run `rails server -h` for more startup options
65+
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
66+
=> Ctrl-C to shutdown server
67+
...
68+
```
69+
70+
Navigate to http://localhost:3000/swagger.
71+
72+
## Write Documentation
73+
74+
Document any external behavior in the [README](README.md).
75+
76+
## Push
77+
78+
```
79+
git push origin my-feature-branch
80+
```
81+
82+
## Make a Pull Request
83+
84+
Go to https://github.com/contributor/grape and select your feature branch.
85+
Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
86+
87+
## Rebase
88+
89+
If you've been working on a change for a while, rebase with upstream/master.
90+
91+
```
92+
git fetch upstream
93+
git rebase upstream/master
94+
git push origin my-feature-branch -f
95+
```
96+
97+
## Check on Your Pull Request
98+
99+
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
100+
101+
## Be Patient
102+
103+
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
104+
105+
## Thank You
106+
107+
Please do know that we really appreciate and value your time and work. We love you, really.

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
source 'https://rubygems.org'
22

33
gemspec
4+
5+
case version = ENV['GRAPE_SWAGGER_VERSION'] || '~> 0.9.0'
6+
when 'HEAD'
7+
gem 'grape-swagger', github: 'tim-vandecasteele/grape-swagger'
8+
else
9+
gem 'grape-swagger', version
10+
end

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013 Aleksandr B. Ivanov
1+
Copyright (c) 2013-2014 Aleksandr B. Ivanov & Contributors
22

33
MIT License
44

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,20 @@ end
9292

9393
### Updating Swagger UI from Dist
9494

95-
To update Swagger UI from its [distribution](https://github.com/wordnik/swagger-ui), run 'bundle exec rake swagger_ui:dist:update'. Examine the changes carefully.
95+
To update Swagger UI from its [distribution](https://github.com/wordnik/swagger-ui), run `bundle exec rake swagger_ui:dist:update`. Examine the changes carefully.
9696

97-
##Contributors
97+
## Contributors
9898

99-
* unloved (https://github.com/unloved)
100-
* dapi (https://github.com/dapi)
101-
* joelvh (https://github.com/joelvh)
102-
* dblock (https://github.com/dblock)
99+
* [unloved](https://github.com/unloved)
100+
* [dapi](https://github.com/dapi)
101+
* [joelvh](https://github.com/joelvh)
102+
* [dblock](https://github.com/dblock)
103+
* ... and [more](https://github.com/BrandyMint/grape-swagger-rails/graphs/contributors) ...
103104

104105
## Contributing
105106

106-
1. Fork it
107-
2. Create your feature branch (`git checkout -b my-new-feature`)
108-
3. Commit your changes (`git commit -am 'Add some feature'`)
109-
4. Push to the branch (`git push origin my-new-feature`)
110-
5. Create new Pull Request
107+
See [CONTRIBUTING](CONTRIBUTING.md).
111108

109+
## License
110+
111+
MIT License, see [LICENSE](LICENSE.txt).

grape-swagger-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
1717
spec.require_paths = %w(lib)
1818

1919
spec.add_dependency 'railties', '>= 3.2.12'
20-
spec.add_dependency 'grape-swagger', '~> 0.7.2'
20+
spec.add_dependency 'grape-swagger', '>= 0.7.2'
2121

2222
spec.add_development_dependency 'bundler', '~> 1.3'
2323
spec.add_development_dependency 'rake'

lib/grape-swagger-rails.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def before_filter(&block)
1515

1616
self.options = Options.new(
1717

18-
url: '/swagger_doc.json',
18+
url: '/swagger_doc',
1919
app_name: 'Swagger',
2020
app_url: 'http://swagger.wordnik.com',
2121

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
GrapeSwaggerRails.options.url = '/api/swagger_doc.json'
1+
GrapeSwaggerRails.options.url = '/api/swagger_doc'
22
GrapeSwaggerRails.options.app_name = 'Swagger'
33
GrapeSwaggerRails.options.app_url = 'http://localhost:3000'

0 commit comments

Comments
 (0)