nested 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +50 -3
- data/lib/nested.rb +8 -0
- data/nested.gemspec +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: 08311b441f9f650ce485cd6f5e628c76c20af3a8
|
4
|
+
data.tar.gz: d701b6f2c978ef0d457ba2c2f8d7071fe8320c14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7531556331af1d8770ced5c4bd5a16098be0fa8eef9509a97cd494b18bb21da1d26d8c5c9dd7c59e70eb106ab604c49f20f6992e6e28801ac7a894fa259c1af0
|
7
|
+
data.tar.gz: 0c4b3c81cfbff503df6efa4febe0d0df3d154797251a86f4f22774e67ebc594f12e8142df1a03f52eb09278940579bf31378a275da7d7c1220fa93eb74b91180
|
data/README.md
CHANGED
@@ -1,4 +1,51 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Nested
|
2
|
+
Nested is an opinionated Domain Specific Language (DSL) to implement RESTful APIs.
|
3
3
|
|
4
|
-
|
4
|
+
## Philosophy
|
5
|
+
- convention of configuration
|
6
|
+
- honor exiting defacto standards
|
7
|
+
|
8
|
+
## Getting Started
|
9
|
+
```
|
10
|
+
class TodoApp < Sinatra::Base
|
11
|
+
|
12
|
+
many :projects do
|
13
|
+
get
|
14
|
+
|
15
|
+
one do
|
16
|
+
many :tasks do
|
17
|
+
get
|
18
|
+
|
19
|
+
one do
|
20
|
+
get
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
singleton :creator, ->{ @project.creator } do
|
25
|
+
get
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
singleton :user, ->{ User.current } do
|
32
|
+
get
|
33
|
+
end
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
## Building Blocks
|
38
|
+
|
39
|
+
### Singleton
|
40
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
41
|
+
|
42
|
+
### Many
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
44
|
+
|
45
|
+
### One
|
46
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
## Credits
|
51
|
+
Nested is using the fantastic Sinatra framework under the hood.
|
data/lib/nested.rb
CHANGED
@@ -308,6 +308,14 @@ module Nested
|
|
308
308
|
route = "#{self.nested_config[:prefix]}" + resource.route(route_args, action)
|
309
309
|
when_args = args.map{|a| "$q.when(#{a})"}
|
310
310
|
|
311
|
+
js << " impl.#{fun_name}Url = function(#{args.join(',')}){"
|
312
|
+
js << " var deferred = $q.defer()"
|
313
|
+
js << " $q.all([#{when_args.join(',')}]).then(function(values){"
|
314
|
+
js << " deferred.resolve('#{route}')"
|
315
|
+
js << " })"
|
316
|
+
js << " return deferred.promise"
|
317
|
+
js << " }"
|
318
|
+
|
311
319
|
if [:get, :delete].include?(method)
|
312
320
|
args << "data" if !block_args.empty?
|
313
321
|
|
data/nested.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nested
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Zimmek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|