cdq 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/cdq/version.rb +1 -1
- data/motion/cdq/context.rb +14 -9
- metadata +18 -30
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9e4159aee06a7a17669675f80c482c0cef41c456
|
4
|
+
data.tar.gz: 73c3f008cffa0e014230287e8e21bd751f9dca5d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 21ce21b6ac607663ad50317d5a1de945984bdc509c8c521e385c3fdaad119b6e3aea286d4150b46ca9dfcc44f52e09996ba28b24df1270116332123b929b7639
|
7
|
+
data.tar.gz: 495a1bf8692bf6c45762e78698870065ab4bb8df01a32185b46ff6d2b1bf1a65fea8652543fbd1f585a273941571a00daa43cc08562d3c720cfdf24f16f8a647
|
data/lib/cdq/version.rb
CHANGED
data/motion/cdq/context.rb
CHANGED
@@ -23,8 +23,10 @@ module CDQ
|
|
23
23
|
def push(context, options = {}, &block)
|
24
24
|
@has_been_set_up = true
|
25
25
|
|
26
|
-
|
26
|
+
if !context.is_a?(NSManagedObjectContext)
|
27
27
|
context = create(context, options)
|
28
|
+
elsif options[:named]
|
29
|
+
assign_name(options[:named], context)
|
28
30
|
end
|
29
31
|
|
30
32
|
if block_given?
|
@@ -120,10 +122,9 @@ module CDQ
|
|
120
122
|
context.performBlockAndWait ->{
|
121
123
|
coordinator = @store_manager.current
|
122
124
|
context.persistentStoreCoordinator = coordinator
|
123
|
-
|
125
|
+
|
124
126
|
NSNotificationCenter.defaultCenter.addObserver(self, selector:"did_finish_import:", name:NSPersistentStoreDidImportUbiquitousContentChangesNotification, object:nil)
|
125
127
|
@observed_context = context
|
126
|
-
#}
|
127
128
|
}
|
128
129
|
end
|
129
130
|
else
|
@@ -131,12 +132,7 @@ module CDQ
|
|
131
132
|
end
|
132
133
|
|
133
134
|
if options[:named]
|
134
|
-
|
135
|
-
raise "Cannot name a context '#{options[:named]}': conflicts with existing method"
|
136
|
-
end
|
137
|
-
self.class.send(:define_method, options[:named]) do
|
138
|
-
context
|
139
|
-
end
|
135
|
+
assign_name(options[:named], context)
|
140
136
|
end
|
141
137
|
context
|
142
138
|
end
|
@@ -278,6 +274,15 @@ module CDQ
|
|
278
274
|
|
279
275
|
private
|
280
276
|
|
277
|
+
def assign_name(name, context)
|
278
|
+
if respond_to?(name)
|
279
|
+
raise "Cannot name a context '#{name}': conflicts with existing method"
|
280
|
+
end
|
281
|
+
self.class.send(:define_method, name) do
|
282
|
+
context
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
281
286
|
def push_to_stack(value)
|
282
287
|
lstack = stack
|
283
288
|
lstack << value
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- infinitered
|
@@ -10,44 +9,40 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2015-
|
12
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: ruby-xcdm
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0.0'
|
23
|
-
- -
|
21
|
+
- - ">="
|
24
22
|
- !ruby/object:Gem::Version
|
25
23
|
version: 0.0.8
|
26
24
|
type: :runtime
|
27
25
|
prerelease: false
|
28
26
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
27
|
requirements:
|
31
|
-
- - ~>
|
28
|
+
- - "~>"
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: '0.0'
|
34
|
-
- -
|
31
|
+
- - ">="
|
35
32
|
- !ruby/object:Gem::Version
|
36
33
|
version: 0.0.8
|
37
34
|
- !ruby/object:Gem::Dependency
|
38
35
|
name: motion-yaml
|
39
36
|
requirement: !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
37
|
requirements:
|
42
|
-
- -
|
38
|
+
- - ">="
|
43
39
|
- !ruby/object:Gem::Version
|
44
40
|
version: '0'
|
45
41
|
type: :runtime
|
46
42
|
prerelease: false
|
47
43
|
version_requirements: !ruby/object:Gem::Requirement
|
48
|
-
none: false
|
49
44
|
requirements:
|
50
|
-
- -
|
45
|
+
- - ">="
|
51
46
|
- !ruby/object:Gem::Version
|
52
47
|
version: '0'
|
53
48
|
description: Core Data Query for RubyMotion
|
@@ -58,12 +53,14 @@ executables:
|
|
58
53
|
extensions: []
|
59
54
|
extra_rdoc_files: []
|
60
55
|
files:
|
61
|
-
- README.md
|
62
56
|
- LICENSE
|
57
|
+
- README.md
|
58
|
+
- bin/cdq
|
59
|
+
- lib/cdq.rb
|
63
60
|
- lib/cdq/cli.rb
|
64
61
|
- lib/cdq/generators.rb
|
65
62
|
- lib/cdq/version.rb
|
66
|
-
-
|
63
|
+
- motion/cdq.rb
|
67
64
|
- motion/cdq/collection_proxy.rb
|
68
65
|
- motion/cdq/config.rb
|
69
66
|
- motion/cdq/context.rb
|
@@ -76,44 +73,35 @@ files:
|
|
76
73
|
- motion/cdq/relationship_query.rb
|
77
74
|
- motion/cdq/store.rb
|
78
75
|
- motion/cdq/targeted_query.rb
|
79
|
-
- motion/cdq.rb
|
80
76
|
- motion/managed_object.rb
|
81
77
|
- templates/init/schemas/0001_initial.rb
|
82
78
|
- templates/init/spec/helpers/cdq.rb
|
83
79
|
- templates/model/app/models/name.rb
|
84
80
|
- templates/model/spec/models/name.rb
|
85
|
-
- vendor/cdq/ext/CoreDataQueryManagedObjectBase.m
|
86
81
|
- vendor/cdq/ext/CoreDataQueryManagedObjectBase.h
|
87
|
-
-
|
82
|
+
- vendor/cdq/ext/CoreDataQueryManagedObjectBase.m
|
88
83
|
homepage: http://infinitered.com/cdq
|
89
84
|
licenses:
|
90
85
|
- MIT
|
86
|
+
metadata: {}
|
91
87
|
post_install_message:
|
92
88
|
rdoc_options: []
|
93
89
|
require_paths:
|
94
90
|
- lib
|
95
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
-
none: false
|
97
92
|
requirements:
|
98
|
-
- -
|
93
|
+
- - ">="
|
99
94
|
- !ruby/object:Gem::Version
|
100
95
|
version: '0'
|
101
|
-
segments:
|
102
|
-
- 0
|
103
|
-
hash: 946966330312317208
|
104
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
97
|
requirements:
|
107
|
-
- -
|
98
|
+
- - ">="
|
108
99
|
- !ruby/object:Gem::Version
|
109
100
|
version: '0'
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
hash: 946966330312317208
|
113
101
|
requirements: []
|
114
102
|
rubyforge_project:
|
115
|
-
rubygems_version:
|
103
|
+
rubygems_version: 2.2.2
|
116
104
|
signing_key:
|
117
|
-
specification_version:
|
105
|
+
specification_version: 4
|
118
106
|
summary: A streamlined library for working with Core Data outside XCode
|
119
107
|
test_files: []
|