grape-path-helpers 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +15 -13
- data/lib/grape-path-helpers/version.rb +1 -1
- data/lib/tasks/grape_path_helpers.rake +1 -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: 503d81ea130278857cad2fea515eb2a963646dd3
|
4
|
+
data.tar.gz: 44075f836d0668feabc2974d8b9db23fca363539
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f270fbcff1cfe587aa4690cd2d2f9216267483a81280c872e0bc3e99a7e6cb0ee2ca403c92ca6e0c826c8259b8b35d510a118a477fa4d07aaacc8a9bf456c1f5
|
7
|
+
data.tar.gz: 4cfa551b90b82960c58dc291645cb93f189e27b8316d9b269f8bcd8b8c41bb5f80aebe02773678f7ca5748bda89428206bfb31967c34129a4ebcba390c562d03
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.2
|
4
|
+
|
5
|
+
* [Rename rake task from `grape:route_helpers` to `grape:path_helpers`](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/5)
|
6
|
+
|
7
|
+
## 1.0.1
|
8
|
+
|
9
|
+
* [Do not shadow helpers with the same name but more params](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/3)
|
10
|
+
* [Reduce the number of calls to HashWithIndifferentAccess](https://gitlab.com/gitlab-org/grape-path-helpers/merge_requests/4)
|
11
|
+
* Update to Grape 1.0
|
12
|
+
|
13
|
+
# Changelog for grape-route-helpers
|
14
|
+
|
3
15
|
## December 17 2016
|
4
16
|
|
5
17
|
* Bump to 2.1.0
|
data/README.md
CHANGED
@@ -1,21 +1,23 @@
|
|
1
|
-
# grape-
|
1
|
+
# grape-path-helpers
|
2
2
|
|
3
|
-
[![Build
|
3
|
+
[![Build status](https://gitlab.com/gitlab-org/grape-path-helpers/badges/master/build.svg)](https://gitlab.com/gitlab-org/grape-path-helpers/commits/master)
|
4
4
|
|
5
5
|
Provides named route helpers for Grape APIs, similar to [Rails' route helpers](http://edgeguides.rubyonrails.org/routing.html#path-and-url-helpers).
|
6
6
|
|
7
|
+
**This is a fork and rename of [group-route-helpers](https://github.com/reprah/grape-route-helpers). It [includes some fixes](CHANGELOG.md) needed for GitLab.**
|
8
|
+
|
7
9
|
### Installation
|
8
10
|
|
9
11
|
#### Compatibility with Grape
|
10
12
|
|
11
|
-
If you're using grape 0.16.0 or higher, you'll need version 2.0.0 or higher of grape-
|
13
|
+
If you're using grape 0.16.0 or higher, you'll need version 2.0.0 or higher of grape-path-helpers.
|
12
14
|
|
13
15
|
#### Rails
|
14
16
|
|
15
|
-
1.) Add the gem to your Gemfile.
|
17
|
+
p 1.) Add the gem to your Gemfile.
|
16
18
|
|
17
19
|
```bash
|
18
|
-
$ bundle install grape-
|
20
|
+
$ bundle install grape-path-helpers
|
19
21
|
```
|
20
22
|
|
21
23
|
#### Sinatra/Rack
|
@@ -25,13 +27,13 @@ $ bundle install grape-route-helpers
|
|
25
27
|
If you're not using Bundler to install/manage dependencies:
|
26
28
|
|
27
29
|
```bash
|
28
|
-
$ gem install grape-
|
30
|
+
$ gem install grape-path-helpers
|
29
31
|
```
|
30
32
|
|
31
33
|
```ruby
|
32
34
|
# environment setup file
|
33
35
|
require 'grape'
|
34
|
-
require 'grape/
|
36
|
+
require 'grape/path_helpers'
|
35
37
|
```
|
36
38
|
|
37
39
|
2.) Write a rake task called `:environment` that loads the application's environment first. This gem's tasks are dependent on it. You could put this in the root of your project directory:
|
@@ -42,8 +44,8 @@ require 'grape/route_helpers'
|
|
42
44
|
require 'rake'
|
43
45
|
require 'bundler'
|
44
46
|
Bundler.setup
|
45
|
-
require 'grape-
|
46
|
-
require 'grape-
|
47
|
+
require 'grape-path-helpers'
|
48
|
+
require 'grape-path-helpers/tasks'
|
47
49
|
|
48
50
|
desc 'load the Sinatra environment.'
|
49
51
|
task :environment do
|
@@ -59,7 +61,7 @@ To see which methods correspond to which paths, and which options you can pass t
|
|
59
61
|
|
60
62
|
```bash
|
61
63
|
# In your API root directory, at the command line
|
62
|
-
$ rake grape:
|
64
|
+
$ rake grape:path_helpers
|
63
65
|
```
|
64
66
|
|
65
67
|
#### Use Helpers in IRB/Pry
|
@@ -67,7 +69,7 @@ $ rake grape:route_helpers
|
|
67
69
|
You can use helper methods in your REPL session by including a module:
|
68
70
|
|
69
71
|
```ruby
|
70
|
-
[1] pry(main)> include
|
72
|
+
[1] pry(main)> include GrapePathHelpers::NamedRouteMatcher
|
71
73
|
```
|
72
74
|
#### Use Helpers in Your API
|
73
75
|
|
@@ -136,13 +138,13 @@ This results in creating a helper called `is_the_server_running_path`.
|
|
136
138
|
|
137
139
|
#### Testing
|
138
140
|
|
139
|
-
You can use route helpers in your API tests by including the `
|
141
|
+
You can use route helpers in your API tests by including the `GrapePathHelpers::NamedRouteMatcher` module inside your specs. Here's an example:
|
140
142
|
|
141
143
|
```ruby
|
142
144
|
require 'spec_helper'
|
143
145
|
|
144
146
|
describe Api::Base do
|
145
|
-
include
|
147
|
+
include GrapePathHelpers::NamedRouteMatcher
|
146
148
|
|
147
149
|
describe 'GET /ping' do
|
148
150
|
it 'returns a 200 OK' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-path-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Blessing
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|