nested 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -3
  3. data/lib/nested.rb +8 -0
  4. data/nested.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7063cd0594194d6e5f4036d64efe0bc45f6ed93c
4
- data.tar.gz: 4c9f893b97e071121ac3b48e8e75e650f72b75ef
3
+ metadata.gz: 08311b441f9f650ce485cd6f5e628c76c20af3a8
4
+ data.tar.gz: d701b6f2c978ef0d457ba2c2f8d7071fe8320c14
5
5
  SHA512:
6
- metadata.gz: f5cb48d77b00da7a4289cb9ea3d0ac6da5a78f035cb801d370e2830044bd540e8ecc7eff38f0c9946c299ef258156e0b54570b6d8559c3378c8ecb275864135b
7
- data.tar.gz: 84d5537846238eb86517ad44145134a423112b572659689f6eaf28341bce9530e936b34806d1acbbede9ece32b6c4310c711e4e266f26610a1912ba69ad31073
6
+ metadata.gz: 7531556331af1d8770ced5c4bd5a16098be0fa8eef9509a97cd494b18bb21da1d26d8c5c9dd7c59e70eb106ab604c49f20f6992e6e28801ac7a894fa259c1af0
7
+ data.tar.gz: 0c4b3c81cfbff503df6efa4febe0d0df3d154797251a86f4f22774e67ebc594f12e8142df1a03f52eb09278940579bf31378a275da7d7c1220fa93eb74b91180
data/README.md CHANGED
@@ -1,4 +1,51 @@
1
- nested
2
- ======
1
+ # Nested
2
+ Nested is an opinionated Domain Specific Language (DSL) to implement RESTful APIs.
3
3
 
4
- a nestable dsl to create a restful api
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "nested"
3
- s.version = "0.0.14"
3
+ s.version = "0.0.15"
4
4
 
5
5
  s.authors = ["Jan Zimmek"]
6
6
  s.email = %q{jan.zimmek@web.de}
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.14
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-21 00:00:00.000000000 Z
11
+ date: 2013-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport