README.md in grape-path-helpers-1.0.1 vs README.md in grape-path-helpers-1.0.2

- old
+ new

@@ -1,51 +1,53 @@ -# grape-route-helpers +# grape-path-helpers -[![Build Status](https://travis-ci.org/reprah/grape-route-helpers.svg)](https://travis-ci.org/reprah/grape-route-helpers) +[![Build status](https://gitlab.com/gitlab-org/grape-path-helpers/badges/master/build.svg)](https://gitlab.com/gitlab-org/grape-path-helpers/commits/master) Provides named route helpers for Grape APIs, similar to [Rails' route helpers](http://edgeguides.rubyonrails.org/routing.html#path-and-url-helpers). +**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.** + ### Installation #### Compatibility with Grape -If you're using grape 0.16.0 or higher, you'll need version 2.0.0 or higher of grape-route-helpers. +If you're using grape 0.16.0 or higher, you'll need version 2.0.0 or higher of grape-path-helpers. #### Rails - 1.) Add the gem to your Gemfile. +p 1.) Add the gem to your Gemfile. ```bash -$ bundle install grape-route-helpers +$ bundle install grape-path-helpers ``` #### Sinatra/Rack 1.) Add the gem to your Gemfile if you're using Bundler. If you're not using Bundler to install/manage dependencies: ```bash -$ gem install grape-route-helpers +$ gem install grape-path-helpers ``` ```ruby # environment setup file require 'grape' -require 'grape/route_helpers' +require 'grape/path_helpers' ``` 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: ```ruby # Rakefile require 'rake' require 'bundler' Bundler.setup -require 'grape-route-helpers' -require 'grape-route-helpers/tasks' +require 'grape-path-helpers' +require 'grape-path-helpers/tasks' desc 'load the Sinatra environment.' task :environment do require File.expand_path('your_app_file', File.dirname(__FILE__)) end @@ -57,19 +59,19 @@ To see which methods correspond to which paths, and which options you can pass them: ```bash # In your API root directory, at the command line -$ rake grape:route_helpers +$ rake grape:path_helpers ``` #### Use Helpers in IRB/Pry You can use helper methods in your REPL session by including a module: ```ruby -[1] pry(main)> include GrapeRouteHelpers::NamedRouteMatcher +[1] pry(main)> include GrapePathHelpers::NamedRouteMatcher ``` #### Use Helpers in Your API Use the methods inside your Grape API actions. Given this example API: @@ -134,16 +136,16 @@ This results in creating a helper called `is_the_server_running_path`. #### Testing -You can use route helpers in your API tests by including the `GrapeRouteHelpers::NamedRouteMatcher` module inside your specs. Here's an example: +You can use route helpers in your API tests by including the `GrapePathHelpers::NamedRouteMatcher` module inside your specs. Here's an example: ```ruby require 'spec_helper' describe Api::Base do - include GrapeRouteHelpers::NamedRouteMatcher + include GrapePathHelpers::NamedRouteMatcher describe 'GET /ping' do it 'returns a 200 OK' do get api_v2_ping_path expect(response.status).to be(200)