rails-rfc6570 2.6.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -17
- data/README.md +10 -16
- data/lib/rails/rfc6570/version.rb +3 -3
- data/lib/rails/rfc6570.rb +1 -1
- data/rails-rfc6570.gemspec +1 -4
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/log/test.log +96 -3108
- data/spec/rails/rfc6570/visitor_spec.rb +2 -2
- data/spec/rails/rfc6570_spec.rb +1 -1
- metadata +5 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7e8a03b1cefe0054439f9582d9d8befbba54e09c4d01ccc170f8e4be3d49295
|
4
|
+
data.tar.gz: f45beb2b71490f95993245b3c34b9ff56724dd889486353ac763d1f373cc6346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d52809f1e00ac16f94dd1254601955b722456c23d4cd0c4eb0e322e1e618842ac2c7336acbc7b73f1c35a17cc80d62659dc3d2a94f39fea99f0d15bf8faf5c9
|
7
|
+
data.tar.gz: f82e393910a7a48f9606de6a79439f35a267be250dd2d3c6eb2dd2efdf087393e7d1ddc87ed31b8ea4947b588b92f732ef1a748a88a4e33093279e553cf832dd
|
data/CHANGELOG.md
CHANGED
@@ -3,9 +3,8 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Changelog](http://keepachangelog.com/).
|
5
5
|
|
6
|
-
|
7
|
-
|
8
6
|
## Unreleased
|
7
|
+
|
9
8
|
---
|
10
9
|
|
11
10
|
### New
|
@@ -16,70 +15,97 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
|
|
16
15
|
|
17
16
|
### Breaks
|
18
17
|
|
18
|
+
## 3.0.0 - (2023-09-04)
|
19
|
+
|
20
|
+
---
|
21
|
+
|
22
|
+
### New
|
23
|
+
|
24
|
+
- Add Ruby 3.1 and 3.2 to test matrix
|
25
|
+
|
26
|
+
### Changes
|
27
|
+
|
28
|
+
- Drop Ruby < 2.7 from test matrix
|
29
|
+
- Drop Rails < 6.1 from test matrix
|
30
|
+
|
31
|
+
### Breaks
|
32
|
+
|
33
|
+
- Require Ruby 2.7+
|
19
34
|
|
20
35
|
## 2.6.0 - (2021-12-16)
|
36
|
+
|
21
37
|
---
|
22
38
|
|
23
39
|
### New
|
24
|
-
* Support for Rails 7
|
25
40
|
|
41
|
+
- Support for Rails 7
|
26
42
|
|
27
43
|
## 2.5.0 - (2020-12-13)
|
44
|
+
|
28
45
|
---
|
29
46
|
|
30
47
|
### New
|
31
|
-
* Add support for Rails 6.1
|
32
48
|
|
49
|
+
- Add support for Rails 6.1
|
33
50
|
|
34
51
|
## 2.4.0
|
52
|
+
|
35
53
|
---
|
36
54
|
|
37
|
-
|
55
|
+
- Add support for Rails 6.0
|
38
56
|
|
39
57
|
## 2.3.0
|
58
|
+
|
40
59
|
---
|
41
60
|
|
42
|
-
|
43
|
-
|
61
|
+
- Newly written visitor and formatter to improve performance (#3)
|
62
|
+
- Nested groups are expanded into a list of groups
|
44
63
|
|
45
64
|
## 2.2.0
|
65
|
+
|
46
66
|
---
|
47
67
|
|
48
|
-
|
68
|
+
- Add support to Rails 5.2 to gemspec
|
49
69
|
|
50
70
|
## 2.1.0
|
71
|
+
|
51
72
|
---
|
52
73
|
|
53
|
-
|
74
|
+
- Add emulation for Rails' routing behavior with original script name
|
54
75
|
|
55
76
|
## 2.0.0
|
77
|
+
|
56
78
|
---
|
57
79
|
|
58
|
-
|
59
|
-
|
80
|
+
- Add support for Rails 5.1
|
81
|
+
- Drop support for Rails < 4.2
|
60
82
|
|
61
83
|
## 1.1.1
|
84
|
+
|
62
85
|
---
|
63
86
|
|
64
|
-
|
87
|
+
- Fix full URL generation to not use `root_url` helper to avoid depending on that and to improve compatibility with e.g. rails engines.
|
65
88
|
|
66
89
|
## 1.1.0
|
90
|
+
|
67
91
|
---
|
68
92
|
|
69
|
-
|
93
|
+
- Added support for Rails 5.0
|
70
94
|
|
71
95
|
## 1.0.0
|
96
|
+
|
72
97
|
---
|
73
98
|
|
74
|
-
|
99
|
+
- No changes just bumping version to a production release
|
75
100
|
|
76
101
|
## 0.3.0
|
102
|
+
|
77
103
|
---
|
78
104
|
|
79
|
-
|
105
|
+
- Added Rails 4.2 support
|
80
106
|
|
81
107
|
## 0.2.0
|
82
|
-
---
|
83
108
|
|
84
|
-
|
109
|
+
---
|
85
110
|
|
111
|
+
- Added `_path_rfc6570` and `_url_rfc6570` helpers (#2)
|
data/README.md
CHANGED
@@ -1,28 +1,22 @@
|
|
1
1
|
# Rails::RFC6570
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://img.shields.io/github/actions/workflow/status/jgraichen/rails-rfc6570/test.yml?logo=github)](https://github.com/jgraichen/rails-rfc6570/actions/workflows/test.yml)
|
4
4
|
|
5
|
-
Pragmatic access to your Rails routes as RFC6570 URI templates. Tested with Rails
|
5
|
+
Pragmatic access to your Rails routes as RFC6570 URI templates. Tested with Rails 6.1, 7.0 and Ruby 2.7, 3.0, 3.1, 3.2.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install rails-rfc6570
|
11
|
+
```ruby
|
12
|
+
gem 'rails-rfc6570', '~> 3.0'
|
13
|
+
```
|
20
14
|
|
21
15
|
## Usage
|
22
16
|
|
23
17
|
**Rails::RFC6570** gives you direct access to your Rails routes as RFC6570 URI templates using the [addressable](https://github.com/sporkmonger/addressable) gem. It further patches `Addressable::Template` with a `#as_json` and `#to_s` so that you can simply pass the template objects or even partial expanded templates to your render call, decorator or serializer.
|
24
18
|
|
25
|
-
The following examples print a JSON index resource just like https://api.github.com
|
19
|
+
The following examples print a JSON index resource just like `https://api.github.com`:
|
26
20
|
|
27
21
|
```ruby
|
28
22
|
class ApplicationController < ActionController::API
|
@@ -67,9 +61,9 @@ the root action will return something similar to the following JSON:
|
|
67
61
|
|
68
62
|
```json
|
69
63
|
{
|
70
|
-
"users": "http://localhost:3000/users{?query,email,active}",
|
71
|
-
"user": "http://localhost:3000/users/{id}",
|
72
|
-
"root": "http://localhost:3000/"
|
64
|
+
"users": "http://localhost:3000/users{?query,email,active}",
|
65
|
+
"user": "http://localhost:3000/users/{id}",
|
66
|
+
"root": "http://localhost:3000/"
|
73
67
|
}
|
74
68
|
```
|
75
69
|
|
@@ -114,7 +108,7 @@ end
|
|
114
108
|
|
115
109
|
## Contributing
|
116
110
|
|
117
|
-
1. Fork it
|
111
|
+
1. [Fork it](http://github.com/jgraichen/rails-routes/fork)
|
118
112
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
119
113
|
3. Add specs
|
120
114
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module Rails
|
4
4
|
module RFC6570
|
5
5
|
module VERSION
|
6
|
-
MAJOR =
|
7
|
-
MINOR =
|
6
|
+
MAJOR = 3
|
7
|
+
MINOR = 0
|
8
8
|
PATCH = 0
|
9
9
|
STAGE = nil
|
10
10
|
|
11
|
-
STRING = [MAJOR, MINOR, PATCH, STAGE].
|
11
|
+
STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.').freeze
|
12
12
|
|
13
13
|
def self.to_s
|
14
14
|
STRING
|
data/lib/rails/rfc6570.rb
CHANGED
data/rails-rfc6570.gemspec
CHANGED
@@ -23,13 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
(.*\.gemspec|.*LICENSE.*|.*README.*|.*CHANGELOG.*)
|
24
24
|
)}x)
|
25
25
|
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
26
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
27
26
|
spec.require_paths = ['lib']
|
28
27
|
|
29
|
-
spec.required_ruby_version = '>= 2.
|
28
|
+
spec.required_ruby_version = '>= 2.7'
|
30
29
|
|
31
30
|
spec.add_runtime_dependency 'actionpack', '>= 4.2', '< 7.1'
|
32
31
|
spec.add_runtime_dependency 'addressable', '~> 2.3'
|
33
|
-
|
34
|
-
spec.add_development_dependency 'bundler'
|
35
32
|
end
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
2
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
3
|
|
4
|
-
require 'bundler/setup' if File.
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
5
|
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|