deep_unrest 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/deep_unrest/application_controller.rb +1 -2
- data/lib/deep_unrest.rb +4 -5
- data/lib/deep_unrest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c3e91ce0d55f72657cbbc336204ee4e9892d55
|
4
|
+
data.tar.gz: 94d86685379dd5dd778234d59d0d46973e774b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240d5d75be4343f354d1255ecc8eb1a0f3a5218b5162c433e2260677c44d7407bc62309e0f7b2a3b5469a2ea27a3834758eef6a31c88f6cc2b9f3c90fe1b0ee0
|
7
|
+
data.tar.gz: e50e934116f6095b25b8dea4f3139bc4c203c4f3999b1b622fb329bab0df0c234ceca63fe5050523133b7e518ecb5d73fc78beb213f05a6fdae3113ceae7d6d2
|
data/lib/deep_unrest.rb
CHANGED
@@ -46,7 +46,7 @@ module DeepUnrest
|
|
46
46
|
|
47
47
|
def self.get_scope_type(id, last, destroy)
|
48
48
|
case id
|
49
|
-
when /^\[\w+\]$/
|
49
|
+
when /^\[[\w+\-]+\]$/
|
50
50
|
:create
|
51
51
|
when /^\.\w+$/
|
52
52
|
if last
|
@@ -74,7 +74,7 @@ module DeepUnrest
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def self.temp_id?(str)
|
77
|
-
/^\[\w+\]$/.match(str)
|
77
|
+
/^\[[\w+\-]+\]$/.match(str)
|
78
78
|
end
|
79
79
|
|
80
80
|
def self.plural?(s)
|
@@ -117,7 +117,7 @@ module DeepUnrest
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def self.parse_path(path)
|
120
|
-
rx = /(?<type>\w+)(?<id>(?:\[|\.)[\w
|
120
|
+
rx = /(?<type>\w+)(?<id>(?:\[|\.)[\w+\-\*\]]+)/
|
121
121
|
result = path.scan(rx)
|
122
122
|
unless result.map { |res| res.join('') }.join('.') == path
|
123
123
|
raise InvalidPath, "Invalid path: #{path}"
|
@@ -341,7 +341,7 @@ module DeepUnrest
|
|
341
341
|
end
|
342
342
|
|
343
343
|
def self.parse_error_path(key)
|
344
|
-
rx = /(((^|\.)(?<type>[^\.\[]+)(?:\[(?<idx>\d+)\])\.)?(?<field>[\w
|
344
|
+
rx = /(((^|\.)(?<type>[^\.\[]+)(?:\[(?<idx>\d+)\])\.)?(?<field>[\w\-\.]+)$)/
|
345
345
|
rx.match(key)
|
346
346
|
end
|
347
347
|
|
@@ -422,4 +422,3 @@ module DeepUnrest
|
|
422
422
|
raise Conflict, formatted_errors.to_json unless formatted_errors.empty?
|
423
423
|
end
|
424
424
|
end
|
425
|
-
|
data/lib/deep_unrest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deep_unrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lynn Hurley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|