rails-rfc6570 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0011c2277baf555923c718d4a01115c09b782073
4
- data.tar.gz: 1d1bb93a9d2d0532c9d2701199ef56e6825cd385
3
+ metadata.gz: 1c3538df57e6f2e93bc183408aa687d64025ffa1
4
+ data.tar.gz: 51eaaa7663d213772123c3fe490ef837701a6097
5
5
  SHA512:
6
- metadata.gz: ff0b022b561c859014393657fd794529c58f182db2994df60803b4eb978244f125a47640c01092297a34cf7b2d4cc1236769d6ab9bb9fe8c6b1d8cc3f4b3e62a
7
- data.tar.gz: 2c9a03ee10bd4d793a275e661434b8edd7aa3a1b4c40e501b02fdd963dfb06ed503abf4c6c8f6f91da580801977e094b94e728ae6a7fa255a18d922e46455aad
6
+ metadata.gz: 4290fede98b6b52ab1c62b089f379c10a172e4be05457f9f97e772c31240da86d500267d5cd2b6e2352f9de3d9ae6b8e7a712f2ac82baf3cf8a7539bf671d181
7
+ data.tar.gz: 6e11a3b2143ae63e138a49b119b7c8ba663f3f220945c4dccfdf90c4ff0f6662299828ba2c1c561e5ac4c25cadbd1a7051e4d5015738b31b80a1d94ec67396cb
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rails::RFC6570
2
2
 
3
- Pragmatical access to your Rails routes as RFC6570 URI templates.
3
+ Pragmatical access to your Rails (4.0) routes as RFC6570 URI templates.
4
4
 
5
5
  ## Installation
6
6
 
@@ -63,9 +63,9 @@ the root action will return something similar to the following JSON:
63
63
 
64
64
  ```json
65
65
  {
66
- users: "http://localhost:3000/users{?query,email,active}",
67
- user: "http://localhost:3000/users/{id}",
68
- root: "http://localhost:3000/"
66
+ "users": "http://localhost:3000/users{?query,email,active}",
67
+ "user": "http://localhost:3000/users/{id}",
68
+ "root": "http://localhost:3000/"
69
69
  }
70
70
  ```
71
71
 
@@ -89,6 +89,8 @@ class UserDecorator < Draper::Decorator
89
89
  end
90
90
  ```
91
91
 
92
+ This gem does not support every construct possible with route matchers especially nested groups cannot be expressed in URI templates. It also makes some assumptions when converting splat matchers like swallowing a multiple slashes.
93
+
92
94
  You can also combine **Rails::RFC6570** with [rack-link_headers](https://jgraichen/rack-link_headers) and provide Hypermedia-linking everywhere!
93
95
 
94
96
  ```ruby
data/lib/rails/rfc6570.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rails/routes/version'
1
+ require 'rails/rfc6570/version'
2
2
 
3
3
  module ActionDispatch
4
4
  module Journey
@@ -27,7 +27,7 @@ module ActionDispatch
27
27
  action = route.defaults[:action].to_s
28
28
 
29
29
  if controller.present? && action.present?
30
- params = Rails::Routes.params_for(controller, action)
30
+ params = Rails::RFC6570.params_for(controller, action)
31
31
  str += '{?' + params.join(',') + '}' if params && params.any?
32
32
  end
33
33
  end
@@ -101,8 +101,8 @@ module Rails
101
101
  module RFC6570
102
102
  if defined?(::Rails::Railtie)
103
103
  class Railtie < Rails::Railtie # :nodoc:
104
- initializer 'rails-routes', :group => :all do |app|
105
- require 'rails/routes/patches'
104
+ initializer 'rails-rfc6570', :group => :all do |app|
105
+ require 'rails/rfc6570/patches'
106
106
 
107
107
  ActiveSupport.on_load(:action_controller) do
108
108
  include Rails::RFC6570::Helper
@@ -3,7 +3,7 @@ module Rails
3
3
  module VERSION
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
  STAGE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.').freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-rfc6570
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen