versioned-routes-rails 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
  SHA256:
3
- metadata.gz: 63e9e22cc102712233d0ebc24b54dcea25d5e0879b55455d41675956063439b2
4
- data.tar.gz: cf42d4dd12c33f109891cf9defb68b2afc0f1527fd9159f4a06ec3b56f546621
3
+ metadata.gz: be1589161c8e9cf26731cfb9d3d4c0d04eaf3564d15a43ca2d77db7991691aff
4
+ data.tar.gz: a4ac74cc6726810af4cef4da1f79d4a62a8d88370d4e7749a425e2d72b0f8412
5
5
  SHA512:
6
- metadata.gz: cdaf2619c06eeeddf0219b3c11d294fbbb978f4d6b691fe462179305748f4dfed5e71d4c682210e58cd01db389d1865f619b482888d8807944ffd7f87b5fa902
7
- data.tar.gz: 786729d9a02996b1060d00bb5a5397d84b91a4f0de41e7038cb72978c1882cf2fedffa6a8296e22c58fa9a996e0c3d5f303bdddc48203bfe808e68de6b199be8
6
+ metadata.gz: 1dd0beb1aaa536275d0bd5db24b99826bd9677f7cc3384632f1bca541651eb87579a456d985a9de16c881a0db1715e8dc2211d15bf3e5d0579ac8bc304065951
7
+ data.tar.gz: 40986578d54c12136cda9a6f6b559aa75c9162647e80d1668da6a5594f23b715c372998c97379fa31effd17ea07ffd2f177ab13bcdfbc6616f1e1d264afc526a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- versioned-routes-rails (0.1.0)
4
+ versioned-routes-rails (0.2.0)
5
5
  actionpack
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -22,6 +22,8 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
+ `require 'versioned_routes'` in your `routes.rb` to load the `version` DSL.
26
+
25
27
  Controllers must be namespaced as `VN::ThingController`, where `N` is the API version.
26
28
 
27
29
  For example, let's define our V1 API as a set of `Message` resources, with some member actions. These will map to `V1::MessagesController`.
@@ -29,6 +31,8 @@ For example, let's define our V1 API as a set of `Message` resources, with some
29
31
  Our V2 API will only change the logic of `V1::MessagesController#show`, so we'll only specify that action in the `version 2` block. Requests to `/api/v2/messages/:id` will be routed to `V2::MessagesController#show`, while all other `/api/v2/messages` requests will still be routed to `V1::MessagesController`.
30
32
 
31
33
  ```ruby
34
+ require 'versioned_routes'
35
+
32
36
  Rails.application.routes.draw do
33
37
  scope :api do
34
38
  version 1 do
@@ -50,7 +54,7 @@ end
50
54
  $ rake routes
51
55
  ```
52
56
 
53
- ```text
57
+ <pre>
54
58
  Prefix Verb URI Pattern Controller#Action
55
59
  read_v1_message POST /api/v1/messages/:id/read(.:format) v1/messages#read {:format=>:json, :api_version=>1}
56
60
  v1_messages GET /api/v1/messages(.:format) v1/messages#index {:format=>:json, :api_version=>1}
@@ -66,7 +70,7 @@ $ rake routes
66
70
  PATCH /api/v2/messages/:id(.:format) v1/messages#update {:format=>:json, :api_version=>1}
67
71
  PUT /api/v2/messages/:id(.:format) v1/messages#update {:format=>:json, :api_version=>1}
68
72
  DELETE /api/v2/messages/:id(.:format) v1/messages#destroy {:format=>:json, :api_version=>1}
69
- ```
73
+ </pre>
70
74
 
71
75
  ## Development
72
76
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VersionedRoutes
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versioned-routes-rails
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
  - Yasyf Mohamedali