modularity-rails 0.14.0 → 0.15.0
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.
- data/demo/Gemfile +1 -1
- data/demo/spec/javascripts/data/ajax_loader_spec.coffee +71 -75
- data/demo/spec/javascripts/data/persistence_manager_spec.coffee +47 -31
- data/lib/modularity-rails/version.rb +1 -1
- data/vendor/assets/javascripts/modularity/data/ajax_loader.coffee +56 -19
- data/vendor/assets/javascripts/modularity/data/persistence_manager.coffee +45 -22
- metadata +30 -30
data/demo/Gemfile
CHANGED
@@ -4,133 +4,129 @@
|
|
4
4
|
|
5
5
|
describe 'ajax_loader', ->
|
6
6
|
|
7
|
-
ajax_loader = spy = spy_get = null
|
7
|
+
ajax_loader = spy = spy_get = spy_fire = null
|
8
8
|
beforeEach ->
|
9
9
|
spy = sinon.spy()
|
10
10
|
spy_get = sinon.spy jQuery, 'get'
|
11
|
+
spy_fire = sinon.spy modularity, 'fire_global_event'
|
11
12
|
|
12
13
|
afterEach ->
|
13
14
|
spy_get.restore()
|
15
|
+
spy_fire.restore()
|
14
16
|
|
15
17
|
describe 'constructor', ->
|
18
|
+
|
16
19
|
it "stores the 'cache' settings", ->
|
17
20
|
loader = new modularity.AjaxLoader {caching: yes}
|
18
|
-
loader.caching.
|
21
|
+
expect(loader.caching).to.be.true
|
22
|
+
|
23
|
+
it 'defaults to no caching', ->
|
24
|
+
loader = new modularity.AjaxLoader {}
|
25
|
+
expect(loader.caching).to.be.false
|
19
26
|
|
20
27
|
|
21
28
|
describe 'get', ->
|
22
29
|
url = "/users/4"
|
23
30
|
|
24
|
-
|
31
|
+
beforeEach ->
|
32
|
+
ajax_loader = new modularity.AjaxLoader {caching: yes}
|
25
33
|
|
26
|
-
|
27
|
-
ajax_loader = new modularity.AjaxLoader {caching: yes}
|
34
|
+
describe 'first time request', ->
|
28
35
|
|
29
|
-
|
36
|
+
beforeEach ->
|
37
|
+
ajax_loader.get url, spy
|
30
38
|
|
31
|
-
|
32
|
-
|
39
|
+
it 'makes an ajax request', ->
|
40
|
+
expect(jQuery.get).to.have.been.calledOnce
|
33
41
|
|
34
|
-
|
35
|
-
|
42
|
+
it 'saves the callback for later', ->
|
43
|
+
expect(ajax_loader.cb_cache.get(url)).to.have.length 1
|
44
|
+
expect(ajax_loader.cb_cache.get(url)[0]).to.equal spy
|
36
45
|
|
46
|
+
it 'returns without calling the callback', ->
|
47
|
+
expect(spy).to.not.have.been.called
|
37
48
|
|
38
|
-
it 'saves the callback for later', ->
|
39
|
-
ajax_loader.cache.get(url).should.have.length 1
|
40
|
-
ajax_loader.cache.get(url)[0].should.equal spy
|
41
49
|
|
42
|
-
|
43
|
-
spy.should.not.have.been.called
|
50
|
+
describe 'the request is already in progress', ->
|
44
51
|
|
45
|
-
|
52
|
+
existing_cb = sinon.spy()
|
53
|
+
new_cb = sinon.spy()
|
54
|
+
beforeEach ->
|
55
|
+
ajax_loader.cb_cache.add url, [existing_cb]
|
56
|
+
ajax_loader.get url, new_cb
|
46
57
|
|
47
|
-
|
48
|
-
|
58
|
+
it 'adds the callback to the callback cache', ->
|
59
|
+
expect(ajax_loader.cb_cache.get(url)).to.have.length 2
|
60
|
+
expect(ajax_loader.cb_cache.get(url)[0]).to.equal existing_cb
|
61
|
+
expect(ajax_loader.cb_cache.get(url)[1]).to.equal new_cb
|
49
62
|
|
63
|
+
it 'returns without calling the callback', ->
|
64
|
+
expect(new_cb).to.not.have.been.called
|
50
65
|
|
51
|
-
|
52
|
-
|
53
|
-
ajax_loader.cache.get(url)[0].should.equal spy
|
66
|
+
it 'does not make another ajax request', ->
|
67
|
+
expect(jQuery.get).to.not.have.been.called
|
54
68
|
|
69
|
+
it "does not fire the 'loading' event", ->
|
70
|
+
expect(modularity.fire_global_event).to.not.have.been.called
|
55
71
|
|
56
|
-
it 'returns without calling the callback', ->
|
57
|
-
spy.should.not.have.been.called
|
58
72
|
|
73
|
+
describe 'ajax request returns successfully', ->
|
59
74
|
|
60
|
-
|
61
|
-
|
75
|
+
old_jquery_get = null
|
76
|
+
beforeEach ->
|
77
|
+
jquery_callback = null
|
78
|
+
old_jquery_get = jQuery.get
|
79
|
+
jQuery.get = (url, callback) -> callback 'result'
|
62
80
|
|
63
|
-
|
81
|
+
afterEach ->
|
82
|
+
jQuery.get = old_jquery_get
|
64
83
|
|
84
|
+
describe 'with caching enabled', ->
|
65
85
|
beforeEach ->
|
66
|
-
|
67
|
-
jQuery.get = (url, callback) -> jquery_callback = callback
|
86
|
+
ajax_loader.caching = true
|
68
87
|
ajax_loader.get url, spy
|
69
|
-
jquery_callback('result')
|
70
88
|
|
71
89
|
it 'calls the given callbacks with the server data', ->
|
72
90
|
expect(spy.calledWith('result')).to.be.true
|
73
91
|
|
74
|
-
it '
|
75
|
-
ajax_loader.
|
76
|
-
|
77
|
-
describe 'the data has already been loaded', ->
|
78
|
-
|
79
|
-
it 'calls the callback with the cached data', ->
|
80
|
-
ajax_loader.cache.add url, "my data"
|
81
|
-
|
82
|
-
ajax_loader.get(url, spy)
|
92
|
+
it 'removes the callbacks from the callback cache', ->
|
93
|
+
expect(ajax_loader.cb_cache.get(url)).to.be.undefined
|
83
94
|
|
84
|
-
|
85
|
-
expect(
|
95
|
+
it 'stores the data in the data cache', ->
|
96
|
+
expect(ajax_loader.data_cache.get(url)).to.equal 'result'
|
86
97
|
|
98
|
+
it "fires the 'loading' event", ->
|
99
|
+
expect(modularity.fire_global_event.calledWith('AJAX_LOADED')).to.be.true
|
87
100
|
|
88
|
-
describe 'with caching disabled', ->
|
89
|
-
|
90
|
-
beforeEach ->
|
91
|
-
ajax_loader = new modularity.AjaxLoader {caching: no}
|
92
|
-
|
93
|
-
describe 'first time request', ->
|
94
101
|
|
102
|
+
describe 'with caching disabled', ->
|
95
103
|
beforeEach ->
|
104
|
+
ajax_loader.caching = false
|
96
105
|
ajax_loader.get url, spy
|
97
106
|
|
98
|
-
it '
|
99
|
-
|
100
|
-
|
101
|
-
it 'saves the callback for later', ->
|
102
|
-
ajax_loader.cache.get(url).should.have.length 1
|
103
|
-
ajax_loader.cache.get(url)[0].should.equal spy
|
104
|
-
|
105
|
-
it 'returns without calling the callback', ->
|
106
|
-
spy.should.not.have.been.called
|
107
|
+
it 'calls the given callbacks with the server data', ->
|
108
|
+
expect(spy.calledWith('result')).to.be.true
|
107
109
|
|
108
|
-
|
110
|
+
it 'removes the callbacks from the callback cache', ->
|
111
|
+
expect(ajax_loader.cb_cache.get(url)).to.be.undefined
|
109
112
|
|
110
|
-
|
111
|
-
ajax_loader.
|
113
|
+
it 'does not store the data in the data cache', ->
|
114
|
+
expect(ajax_loader.data_cache.get(url)).to.be.undefined
|
112
115
|
|
113
|
-
it
|
114
|
-
|
115
|
-
ajax_loader.cache.get(url)[0].should.equal spy
|
116
|
+
it "fires the 'loading' event", ->
|
117
|
+
expect(modularity.fire_global_event.calledWith('AJAX_LOADED')).to.be.true
|
116
118
|
|
117
|
-
it 'returns without calling the callback', ->
|
118
|
-
spy.should.not.have.been.called
|
119
119
|
|
120
|
-
|
121
|
-
jQuery.get.should.not.have.been.called
|
120
|
+
describe 'the data has already been loaded', ->
|
122
121
|
|
123
|
-
|
122
|
+
it 'calls the callback with the cached data', ->
|
123
|
+
ajax_loader.data_cache.add url, "my data"
|
124
124
|
|
125
|
-
|
126
|
-
jquery_callback = null
|
127
|
-
jQuery.get = (url, callback) -> jquery_callback = callback
|
128
|
-
ajax_loader.get url, spy
|
129
|
-
jquery_callback('result')
|
125
|
+
ajax_loader.get(url, spy)
|
130
126
|
|
131
|
-
|
132
|
-
|
127
|
+
expect(spy).to.have.been.called
|
128
|
+
expect(spy.calledWith('my data')).to.be.true
|
133
129
|
|
134
|
-
|
135
|
-
|
130
|
+
it "does not fire the 'loading' event", ->
|
131
|
+
expect(modularity.fire_global_event).to.not.have.been.called
|
136
132
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
describe 'PersistenceManager', ->
|
7
|
-
|
7
|
+
|
8
8
|
# Global variables for testing.
|
9
9
|
persistence_manager = null
|
10
10
|
entry_1 = {id: 1, value: 'one'}
|
@@ -46,7 +46,7 @@ describe 'PersistenceManager', ->
|
|
46
46
|
|
47
47
|
beforeEach ->
|
48
48
|
sinon.stub(jQuery, 'ajax').yieldsTo('success', entry_2)
|
49
|
-
|
49
|
+
|
50
50
|
afterEach ->
|
51
51
|
jQuery.ajax.restore()
|
52
52
|
|
@@ -109,33 +109,6 @@ describe 'PersistenceManager', ->
|
|
109
109
|
persistence_manager.entry_url(entry_1).should.equal '/users/1.json'
|
110
110
|
|
111
111
|
|
112
|
-
describe 'load_all', ->
|
113
|
-
|
114
|
-
loading_done_callback = null
|
115
|
-
beforeEach ->
|
116
|
-
sinon.stub(jQuery, 'ajax').yieldsTo('success', [entry_1, entry_2])
|
117
|
-
loading_done_callback = sinon.spy()
|
118
|
-
persistence_manager.load_all loading_done_callback, {'q': 'foo'},
|
119
|
-
|
120
|
-
afterEach ->
|
121
|
-
jQuery.ajax.restore()
|
122
|
-
|
123
|
-
it 'makes a request to the INDEX action of the server', ->
|
124
|
-
jQuery.ajax.should.have.been.calledOnce
|
125
|
-
jQuery.ajax.args[0][0].url.should.equal '/users.json'
|
126
|
-
|
127
|
-
it 'provides the given data as parameters to the request', ->
|
128
|
-
jQuery.ajax.args[0][0].data.should.eql {'q': 'foo'}
|
129
|
-
|
130
|
-
it 'fills the server cache with the response data', ->
|
131
|
-
persistence_manager.server_data.length().should.eql 2
|
132
|
-
persistence_manager.server_data.get(1).should.eql entry_1
|
133
|
-
persistence_manager.server_data.get(2).should.eql entry_2
|
134
|
-
|
135
|
-
it 'calls the given callback method when the data is available', ->
|
136
|
-
loading_done_callback.should.have.been.calledOnce
|
137
|
-
|
138
|
-
|
139
112
|
describe 'load', ->
|
140
113
|
|
141
114
|
describe 'entry exists in client data cache', ->
|
@@ -171,7 +144,7 @@ describe 'PersistenceManager', ->
|
|
171
144
|
|
172
145
|
|
173
146
|
describe "entry doesn't exist on the client at all", ->
|
174
|
-
|
147
|
+
|
175
148
|
beforeEach ->
|
176
149
|
sinon.stub(jQuery, 'ajax').yieldsTo('success', entry_1)
|
177
150
|
|
@@ -203,6 +176,49 @@ describe 'PersistenceManager', ->
|
|
203
176
|
done()
|
204
177
|
|
205
178
|
|
179
|
+
describe 'load_all', ->
|
180
|
+
|
181
|
+
loading_done_callback = null
|
182
|
+
beforeEach ->
|
183
|
+
sinon.stub(jQuery, 'ajax').yieldsTo('success', [entry_1, entry_2])
|
184
|
+
loading_done_callback = sinon.spy()
|
185
|
+
persistence_manager.load_all loading_done_callback, {'q': 'foo'},
|
186
|
+
|
187
|
+
afterEach ->
|
188
|
+
jQuery.ajax.restore()
|
189
|
+
|
190
|
+
it 'makes a request to the INDEX action of the server', ->
|
191
|
+
jQuery.ajax.should.have.been.calledOnce
|
192
|
+
jQuery.ajax.args[0][0].url.should.equal '/users.json'
|
193
|
+
|
194
|
+
it 'provides the given data as parameters to the request', ->
|
195
|
+
jQuery.ajax.args[0][0].data.should.eql {'q': 'foo'}
|
196
|
+
|
197
|
+
it 'fills the server cache with the response data', ->
|
198
|
+
persistence_manager.server_data.length().should.eql 2
|
199
|
+
persistence_manager.server_data.get(1).should.eql entry_1
|
200
|
+
persistence_manager.server_data.get(2).should.eql entry_2
|
201
|
+
|
202
|
+
it 'calls the given callback method when the data is available', ->
|
203
|
+
loading_done_callback.should.have.been.calledOnce
|
204
|
+
|
205
|
+
|
206
|
+
describe 'load_many', ->
|
207
|
+
|
208
|
+
describe 'all snippets in cache', ->
|
209
|
+
it 'returns an array of all requested snippets', ->
|
210
|
+
persistence_manager.add_all [{id: 1}, {id: 2}, {id: 3}]
|
211
|
+
persistence_manager.load_many [1,2], (snippets) ->
|
212
|
+
expect(snippets).to.have.length 2
|
213
|
+
expect(snippets[0].id).to.equal 1
|
214
|
+
expect(snippets[1].id).to.equal 2
|
215
|
+
|
216
|
+
|
217
|
+
describe 'some snippets are not cached', ->
|
218
|
+
|
219
|
+
it 'loads the missing snippets from the server'
|
220
|
+
|
221
|
+
|
206
222
|
describe 'save', ->
|
207
223
|
|
208
224
|
describe 'for unsaved objects', ->
|
@@ -224,7 +240,7 @@ describe 'PersistenceManager', ->
|
|
224
240
|
sinon.stub(jQuery, 'ajax').yieldsTo('success', entry_2)
|
225
241
|
server_entry = {id: 1, title: 'server title', desc: 'server desc'}
|
226
242
|
persistence_manager.server_data.add server_entry
|
227
|
-
|
243
|
+
|
228
244
|
afterEach ->
|
229
245
|
jQuery.ajax.restore()
|
230
246
|
|
@@ -11,30 +11,67 @@
|
|
11
11
|
class window.modularity.AjaxLoader
|
12
12
|
|
13
13
|
constructor: (params = {}) ->
|
14
|
-
|
14
|
+
|
15
|
+
# Caches the callbacks.
|
16
|
+
@cb_cache = new modularity.Cache()
|
15
17
|
|
16
18
|
# Whether to perform caching of data.
|
17
19
|
# Default: no.
|
18
|
-
@caching = params.caching
|
20
|
+
@caching = !!params.caching
|
21
|
+
|
22
|
+
# Caches the data loaded.
|
23
|
+
@data_cache = new modularity.Cache()
|
24
|
+
|
25
|
+
# The number of currently running loading operations.
|
26
|
+
@loader_count = 0
|
27
|
+
|
19
28
|
|
29
|
+
# The different events that this class can fire.
|
30
|
+
@events =
|
31
|
+
AJAX_LOADING: 'AJAX_LOADING'
|
32
|
+
AJAX_LOADED: 'AJAX_LOADED'
|
20
33
|
|
34
|
+
|
35
|
+
# Loads the data from the given URL asynchronously.
|
21
36
|
get: (url, callback) ->
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
else
|
32
|
-
@cache.remove url
|
33
|
-
|
34
|
-
# Request while the GET call is still pending -->
|
37
|
+
|
38
|
+
# Return immediately if we have cached data.
|
39
|
+
if @caching
|
40
|
+
cached_data = @data_cache.get url
|
41
|
+
return callback(cached_data) if cached_data?
|
42
|
+
|
43
|
+
# Here, we have no cached data. Check
|
44
|
+
|
45
|
+
# If a GET call to this URL is already in progress -->
|
35
46
|
# add the given callback to the list of waiting callbacks.
|
36
|
-
|
37
|
-
|
47
|
+
request_in_progress = @cb_cache.get url
|
48
|
+
return request_in_progress.push(callback) if request_in_progress?
|
49
|
+
|
50
|
+
# Here, no request is currently in progress --> start a new one.
|
51
|
+
|
52
|
+
# Add callback to callback list.
|
53
|
+
@cb_cache.add url, [callback]
|
54
|
+
|
55
|
+
# Fire 'loading' event if this is the start of a loading operation.
|
56
|
+
@loader_count++
|
57
|
+
if @loader_count == 1
|
58
|
+
window.modularity.fire_global_event window.modularity.AjaxLoader.events.AJAX_LOADING
|
59
|
+
|
60
|
+
# Perform the request.
|
61
|
+
jQuery.get url, (data) =>
|
62
|
+
|
63
|
+
# Add result to cache.
|
64
|
+
if @caching
|
65
|
+
@data_cache.add url, data
|
66
|
+
|
67
|
+
# Call callbacks.
|
68
|
+
cb(data) for cb in @cb_cache.get url
|
69
|
+
|
70
|
+
# Remove request from callback list.
|
71
|
+
@cb_cache.remove url
|
72
|
+
|
73
|
+
# Fire 'loaded' event.
|
74
|
+
@loader_count--
|
75
|
+
if @loader_count == 0
|
76
|
+
window.modularity.fire_global_event window.modularity.AjaxLoader.events.AJAX_LOADED
|
38
77
|
|
39
|
-
# There is a cached response for this request --> answer the request immediately.
|
40
|
-
callback(cached_value)
|
@@ -6,18 +6,18 @@
|
|
6
6
|
class modularity.PersistenceManager
|
7
7
|
|
8
8
|
constructor: (params) ->
|
9
|
-
|
9
|
+
|
10
10
|
# Copy of the data as it is on the server.
|
11
11
|
@server_data = new modularity.IndexedCache 'id'
|
12
|
-
|
12
|
+
|
13
13
|
# Copy of the data as it is on the client.
|
14
14
|
@client_data = new modularity.IndexedCache 'id'
|
15
|
-
|
15
|
+
|
16
16
|
# The base url on the server. Expected to be a fully RESTful API.
|
17
17
|
@base_url = params.url
|
18
18
|
|
19
19
|
@key = params.key or 'id'
|
20
|
-
|
20
|
+
|
21
21
|
# For handling parallel requests to the server.
|
22
22
|
@loader = new modularity.AjaxLoader { cache: no }
|
23
23
|
|
@@ -34,25 +34,23 @@ class modularity.PersistenceManager
|
|
34
34
|
|
35
35
|
# Creates the given object on the server.
|
36
36
|
create: (obj, callback) ->
|
37
|
-
jQuery.ajax
|
37
|
+
jQuery.ajax
|
38
38
|
url: @collection_url()
|
39
39
|
type: 'POST'
|
40
40
|
data: obj
|
41
41
|
success: (server_obj) =>
|
42
42
|
@server_data.add server_obj
|
43
43
|
callback server_obj
|
44
|
-
}
|
45
44
|
|
46
45
|
|
47
46
|
delete: (obj, callback) ->
|
48
47
|
@client_data.remove obj
|
49
48
|
@server_data.remove obj
|
50
|
-
jQuery.ajax
|
49
|
+
jQuery.ajax
|
51
50
|
url: @entry_url(obj)
|
52
51
|
type: 'DELETE'
|
53
52
|
success: ->
|
54
53
|
callback() if callback?
|
55
|
-
}
|
56
54
|
|
57
55
|
|
58
56
|
# Returns the url to access a single entry.
|
@@ -60,19 +58,29 @@ class modularity.PersistenceManager
|
|
60
58
|
"#{@base_url}/#{entry[@key]}.json"
|
61
59
|
|
62
60
|
|
63
|
-
# Returns the
|
64
|
-
|
65
|
-
|
61
|
+
# Returns the cached data object, or undefined.
|
62
|
+
get_cached: (key) ->
|
63
|
+
|
66
64
|
# Try to use client_data cache.
|
67
65
|
client_obj = @client_data.get key
|
68
|
-
return
|
69
|
-
|
66
|
+
return client_obj if client_obj
|
67
|
+
|
70
68
|
# No data in client cache --> try to use server cache.
|
71
69
|
server_obj = @server_data.get key
|
72
70
|
if server_obj
|
73
71
|
client_obj = modularity.clone_hash server_obj
|
74
72
|
@client_data.add client_obj
|
75
|
-
return
|
73
|
+
return client_obj
|
74
|
+
|
75
|
+
# Object not found in client or server cache.
|
76
|
+
return undefined
|
77
|
+
|
78
|
+
|
79
|
+
# Returns the entry with the given key.
|
80
|
+
load: (key, callback) ->
|
81
|
+
|
82
|
+
# Try to load from cache.
|
83
|
+
return callback(snippet) if snippet = @get_cached key
|
76
84
|
|
77
85
|
# No data on client at all --> load data from server.
|
78
86
|
@loader.get "#{@base_url}/#{key}", (server_entry) =>
|
@@ -85,16 +93,32 @@ class modularity.PersistenceManager
|
|
85
93
|
# Loads all objects from the server.
|
86
94
|
# Provides the given params as parameters to the GET request.
|
87
95
|
load_all: (callback, params) ->
|
88
|
-
jQuery.ajax
|
96
|
+
jQuery.ajax
|
89
97
|
url: @collection_url()
|
90
98
|
cache: no
|
91
99
|
data: params
|
92
100
|
success: (data) =>
|
93
101
|
@server_data.add_all data
|
94
102
|
callback()
|
95
|
-
}
|
96
103
|
|
97
|
-
|
104
|
+
|
105
|
+
# Loads all snippets with the given ids.
|
106
|
+
load_many: (ids, callback) ->
|
107
|
+
missing_ids = []
|
108
|
+
snippets = []
|
109
|
+
$.each ids, (pos, id) =>
|
110
|
+
snippet = @get_cached id
|
111
|
+
if snippet
|
112
|
+
snippets.push snippet
|
113
|
+
else
|
114
|
+
missing_ids.push id
|
115
|
+
|
116
|
+
if missing_ids.length == 0
|
117
|
+
return callback(snippets)
|
118
|
+
|
119
|
+
alert "uncached snippets found: #{missing_ids}"
|
120
|
+
|
121
|
+
|
98
122
|
# Saves the given object.
|
99
123
|
# Does the right thing (create or update) dependent on
|
100
124
|
# whether the object already has a key parameter.
|
@@ -109,24 +133,23 @@ class modularity.PersistenceManager
|
|
109
133
|
# The given object must exist on the server already,
|
110
134
|
# and have a proper value in the key attribute.
|
111
135
|
update: (obj, callback) ->
|
112
|
-
|
136
|
+
|
113
137
|
# Create a new hash, containing only the changed attributes between obj and it's replica in @server_data.
|
114
138
|
diff_obj = modularity.object_diff @server_data.get(obj[@key]), obj
|
115
139
|
return if modularity.object_length(diff_obj) == 0
|
116
|
-
|
140
|
+
|
117
141
|
# Add key attribute.
|
118
142
|
diff_obj[@key] = obj[@key]
|
119
|
-
|
143
|
+
|
120
144
|
# Update server_data version.
|
121
145
|
@server_data.add obj
|
122
146
|
|
123
147
|
# Send to server
|
124
|
-
jQuery.ajax
|
148
|
+
jQuery.ajax
|
125
149
|
url: @entry_url(obj)
|
126
150
|
type: 'PUT'
|
127
151
|
data: diff_obj
|
128
152
|
success: (server_obj) =>
|
129
153
|
@server_data.add server_obj
|
130
154
|
callback server_obj if callback
|
131
|
-
}
|
132
155
|
|
metadata
CHANGED
@@ -1,96 +1,96 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modularity-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.0
|
5
4
|
prerelease:
|
5
|
+
version: 0.15.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kevin Goslar
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.1.0
|
20
|
+
none: false
|
21
|
+
name: rails
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
26
|
- - ! '>='
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: 3.1.0
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: capybara-webkit
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
29
|
none: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
34
32
|
requirements:
|
35
33
|
- - ! '>='
|
36
34
|
- !ruby/object:Gem::Version
|
37
35
|
version: '0'
|
36
|
+
none: false
|
37
|
+
name: capybara-webkit
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
42
41
|
requirements:
|
43
42
|
- - ! '>='
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: evergreen
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
45
|
none: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
48
|
requirements:
|
51
49
|
- - ! '>='
|
52
50
|
- !ruby/object:Gem::Version
|
53
51
|
version: '0'
|
52
|
+
none: false
|
53
|
+
name: evergreen
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ! '>='
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: rb-fsevent
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
61
|
none: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
64
|
requirements:
|
67
65
|
- - ! '>='
|
68
66
|
- !ruby/object:Gem::Version
|
69
67
|
version: '0'
|
68
|
+
none: false
|
69
|
+
name: rb-fsevent
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
74
73
|
requirements:
|
75
74
|
- - ! '>='
|
76
75
|
- !ruby/object:Gem::Version
|
77
76
|
version: '0'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: guard-livereload
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
77
|
none: false
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
80
|
requirements:
|
83
81
|
- - ! '>='
|
84
82
|
- !ruby/object:Gem::Version
|
85
83
|
version: '0'
|
84
|
+
none: false
|
85
|
+
name: guard-livereload
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
90
89
|
requirements:
|
91
90
|
- - ! '>='
|
92
91
|
- !ruby/object:Gem::Version
|
93
92
|
version: '0'
|
93
|
+
none: false
|
94
94
|
description: Description of ModularityRails.
|
95
95
|
email:
|
96
96
|
- kevin.goslar@gmail.com
|
@@ -192,20 +192,20 @@ rdoc_options: []
|
|
192
192
|
require_paths:
|
193
193
|
- lib
|
194
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
-
none: false
|
196
195
|
requirements:
|
197
196
|
- - ! '>='
|
198
197
|
- !ruby/object:Gem::Version
|
199
198
|
version: '0'
|
200
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
199
|
none: false
|
200
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
201
|
requirements:
|
203
202
|
- - ! '>='
|
204
203
|
- !ruby/object:Gem::Version
|
205
204
|
version: '0'
|
205
|
+
none: false
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 1.8.
|
208
|
+
rubygems_version: 1.8.23
|
209
209
|
signing_key:
|
210
210
|
specification_version: 3
|
211
211
|
summary: Summary of ModularityRails.
|