CloudSesame 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e652837a674dc067f1330484f696ba6e5cefa439
|
4
|
+
data.tar.gz: 40b265eaf764e89e15a5074e51dea46dcbdd0cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b7685b103c802e5c336a34d44f72f0220a6cf74b2da2909760fc65e8ea17b660e42efcaa22a2a257d34513e4efbbeadbf4d0ff57fca967f1e8ece099209d94
|
7
|
+
data.tar.gz: 5e9707453aafaf01c0eb99d2b19f892504d5da3354658206cc7cd53cf6ea3ed55fe19e3f3c7d4b675a135d6b5926df031699ea54876e0ba964032317252f8f1a
|
data/Gemfile.lock
CHANGED
data/cloud_sesame.gemspec
CHANGED
@@ -3,14 +3,23 @@ module CloudSesame
|
|
3
3
|
module DSL
|
4
4
|
module ScopeMethods
|
5
5
|
|
6
|
-
def scopes
|
7
|
-
|
6
|
+
def scopes(name = nil, *args)
|
7
|
+
if (name && context_scopes && (callback = context_scopes[name])) || name.nil?
|
8
|
+
instance_exec(*args, &callback) if callback
|
9
|
+
dsl_return
|
10
|
+
else
|
11
|
+
raise NoMethodError, "scope[#{ name }] does not exist"
|
12
|
+
end
|
8
13
|
end
|
9
14
|
|
10
15
|
private
|
11
16
|
|
17
|
+
def context_scopes
|
18
|
+
dsl_context[:scopes]
|
19
|
+
end
|
20
|
+
|
12
21
|
def method_missing(name, *args, &block)
|
13
|
-
if
|
22
|
+
if context_scopes && (callback = context_scopes[name])
|
14
23
|
instance_exec *args, &callback
|
15
24
|
dsl_return
|
16
25
|
else
|