webpacker-routes 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/webpacker/routes.rb +4 -3
- data/lib/webpacker/routes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347e51b5067401b0315a50953592a477b54ab588ba6405c5b9a281f19bb5abbb
|
4
|
+
data.tar.gz: f9aaa63022d82a3758bb3416ffc8888c2d14ee6f1fffd1e30ffcf0fec1bc1719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 853dbe59e91370cc7d699d34d00de2803eb32f9130c72d65e77f772d37b3bd7d1712442c3653fa114b3241bd06cc272de188a50470d2cf7addc3ea5dbef58c6c
|
7
|
+
data.tar.gz: ec9ce0004b11fd5af8f0e1cc5fa9b57fb40cef8bee4a489b1a3b4416019836f13c148a9ee6db2003f1570240d6b2be4ee1e8e13df443dd195dc8c86d8ce33b7f
|
data/README.md
CHANGED
@@ -34,11 +34,9 @@ $ bundle exec rails webpacker:routes:generate
|
|
34
34
|
## License
|
35
35
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
36
36
|
|
37
|
-
##
|
37
|
+
## Todo
|
38
38
|
|
39
|
-
-
|
40
|
-
- to_prepare?
|
39
|
+
- default_url_options (especially host for urls)
|
41
40
|
- support all valid route names
|
42
|
-
- default_url_options
|
43
41
|
- relative_url_root
|
44
42
|
- camelcase
|
data/lib/webpacker/routes.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "webpacker/routes/version"
|
1
2
|
require "webpacker/routes/railtie"
|
2
3
|
|
3
4
|
module Webpacker
|
@@ -24,9 +25,9 @@ module Webpacker
|
|
24
25
|
defaults = route.defaults.except(:controller, :action).to_json
|
25
26
|
|
26
27
|
file.write(<<-JAVASCRIPT.strip_heredoc)
|
27
|
-
const #{name} = [#{spec}, #{segment_keys}, #{defaults}]
|
28
|
-
export const #{name}_url = (...args) => urlFor(#{name}, ...args)
|
29
|
-
export const #{name}_path = (...args) => pathFor(#{name}, ...args)
|
28
|
+
const #{name}_spec = [#{spec}, #{segment_keys}, #{defaults}]
|
29
|
+
export const #{name}_url = (...args) => urlFor(#{name}_spec, ...args)
|
30
|
+
export const #{name}_path = (...args) => pathFor(#{name}_spec, ...args)
|
30
31
|
JAVASCRIPT
|
31
32
|
end
|
32
33
|
end
|