volt 0.9.0.pre6 → 0.9.0.pre7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d7f725c0927c9b59afe03d26fb21eabd1dedb70
4
- data.tar.gz: 5db3976c7d9fa0c0f4d39143fbdc55f605ef1d4d
3
+ metadata.gz: 7b1a1de6a4ca5bb3040697994dc02235caef5df1
4
+ data.tar.gz: 560933928252e51c201ffc9f0167d7a81255c415
5
5
  SHA512:
6
- metadata.gz: 19f53d2bf32447609e05e3ec6bc7f111b746da01e6def14e94bc94a56a0f1940b328342d15d82e9378227855d99c02369b0bf31e356616a2ee149b8fd489b080
7
- data.tar.gz: e7a5b0e5e96857977531d42c3805e9547ebff7af8cc3248aab7d39374e2fb880d124ceaf83493bd3cf61ca3db8d17198c2b8e0e66cada5cf59b9c08412fed9b3
6
+ metadata.gz: 55024841e17f8e8f267f5728f5ed46ac81254c29c4fb3f494a840b2c337d5cbe901204bdac3396380465460b03cc2ebcaabc886d6a77b234ec50ce96d1b4a6be
7
+ data.tar.gz: 72dccab3dfa677e6b444e152ca9b3654cf48317de5a65a2ac2494b6084bc862301dbedce6d8663a803c0e46b0bb0167a5549f042724c768975877f6fc89d7c94
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0.pre6
1
+ 0.9.0.pre7
@@ -62,9 +62,6 @@ class QueryTasks < Volt::Task
62
62
  def remove_listener(collection, query)
63
63
  live_query = @@live_query_pool.lookup(collection, query)
64
64
  live_query.remove_channel(@channel)
65
- #
66
- # puts "REMOVE LIST1"
67
- # @@live_query_pool.print
68
65
  end
69
66
 
70
67
  # Removes a channel from all associated live queries
@@ -83,6 +83,9 @@ module Volt
83
83
  promise = @persistor.added(model, @array.size - 1)
84
84
  if promise && promise.is_a?(Promise)
85
85
  return promise.then do
86
+ # Mark the model as loaded
87
+ model.change_state_to(:loaded_state, :loaded)
88
+
86
89
  # return the model
87
90
  model
88
91
  end.fail do |err|
@@ -94,7 +97,6 @@ module Volt
94
97
  trigger_size_change!
95
98
  #
96
99
  # re-raise, err might not be an Error object, so we use a rejected promise to re-raise
97
-
98
100
  Promise.new.reject(err)
99
101
  end
100
102
  end
@@ -69,23 +69,19 @@ module Volt
69
69
  # Called by child models to track their listeners
70
70
  def listener_added
71
71
  @listener_event_counter.add
72
- # puts "LIST ADDED: #{inspect} - #{@listener_event_counter.count} #{@model.path.inspect}"
73
72
  end
74
73
 
75
74
  # Called by child models to track their listeners
76
75
  def listener_removed
77
76
  @listener_event_counter.remove
78
- # puts "LIST REMOVED: #{inspect} - #{@query.inspect} - #{@listener_event_counter.count} #{@model.path.inspect}"
79
77
  end
80
78
 
81
79
  # Called when an event is removed and we no longer want to keep in
82
80
  # sync with the database. The data is kept in memory and the model's
83
81
  # loaded_state is marked as "dirty" meaning it may not be in sync.
84
82
  def stop_listening
85
- # puts "Stop LIST1"
86
83
  Timers.next_tick do
87
84
  Computation.run_without_tracking do
88
- # puts "STOP LIST2"
89
85
  if @listener_event_counter.count == 0
90
86
  if @added_to_query
91
87
  @query_listener.remove_store(self)
@@ -100,7 +100,6 @@ module Volt
100
100
 
101
101
  queue_client_save
102
102
  else
103
- # puts "SAVE TO DB: #{@model.inspect} - #{self_attributes.inspect} - #{@model.changed_attributes.inspect}"
104
103
  errors = save_to_db!(self_attributes)
105
104
  if errors.size == 0
106
105
  promise.resolve(nil)
@@ -35,7 +35,6 @@ module Volt
35
35
  store.model.change_state_to(:loaded_state, :loaded)
36
36
 
37
37
  # if Volt.server?
38
- # puts "BACK TO DIRTY"
39
38
  # store.model.change_state_to(:loaded_state, :dirty)
40
39
  # end
41
40
  end
@@ -57,8 +56,6 @@ module Volt
57
56
  def add_store(store, &block)
58
57
  @stores << store
59
58
 
60
- # puts "ADD STORE FOR: #{@collection.inspect}: #{@query.inspect}"
61
-
62
59
  if @listening
63
60
  # We are already listening and have this model somewhere else,
64
61
  # copy the data from the existing model.
@@ -81,7 +78,6 @@ module Volt
81
78
  def remove_store(store)
82
79
  @stores.delete(store)
83
80
 
84
- # puts "REMOVE STORE: #{@collection.inspect}: #{@query.inspect} - #{@stores.size}"
85
81
  # When there are no stores left, remove the query listener from
86
82
  # the pool, it can get created again later.
87
83
  if @stores.size == 0
@@ -7,7 +7,6 @@ module Volt
7
7
  HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;', "\n" => "<br />\n" }
8
8
 
9
9
  def initialize(page, target, context, binding_name, getter)
10
- # puts "New Content Binding: #{self.inspect}"
11
10
  super(page, target, context, binding_name)
12
11
 
13
12
  # Listen for changes
@@ -92,10 +92,7 @@ module Volt
92
92
  def remove
93
93
  @nodes = []
94
94
 
95
- # puts "Component Node Removed"
96
95
  changed!
97
-
98
- # @binding_id = nil
99
96
  end
100
97
 
101
98
  def remove_anchors
@@ -45,7 +45,8 @@ module Volt
45
45
  if promise
46
46
  if error
47
47
  # TODO: full error handling
48
- puts "Task Response: #{error.inspect}"
48
+ Volt.logger.error("Task Response:")
49
+ Volt.logger.error(error)
49
50
  promise.reject(error)
50
51
  else
51
52
  promise.resolve(result)
@@ -13,6 +13,11 @@ module Volt
13
13
 
14
14
  # Forward any missing methods to the array
15
15
  def method_missing(method_name, *args, &block)
16
+ # Long term we should probably handle all Enum methods
17
+ # directly for smarter updating. For now, just depend on size
18
+ # so updates retrigger the whole method call.
19
+ @size_dep.depend
20
+
16
21
  @array.send(method_name, *args, &block)
17
22
  end
18
23
 
@@ -43,7 +43,6 @@ module Volt
43
43
  if @__store_accessed
44
44
  # Clear the database after each spec where we use store
45
45
  # @@db ||= Volt::DataStore.fetch
46
- # puts "DB CLASS: #{@@db.inspect}"
47
46
  # @@db.drop_database
48
47
  ::DataStore.new.drop_database
49
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.pre6
4
+ version: 0.9.0.pre7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout