volt 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -6
- data/Readme.md +5 -5
- data/VERSION +1 -1
- data/lib/volt/boot.rb +4 -0
- data/lib/volt/console.rb +1 -1
- data/lib/volt/extra_core/object.rb +2 -4
- data/lib/volt/models/array_model.rb +0 -1
- data/lib/volt/models/model.rb +1 -5
- data/lib/volt/models/persistors/array_store.rb +0 -1
- data/lib/volt/models/persistors/params.rb +0 -2
- data/lib/volt/models/persistors/query/query_listener.rb +1 -1
- data/lib/volt/page/bindings/content_binding.rb +1 -2
- data/lib/volt/page/tasks.rb +0 -1
- data/lib/volt/page/url_tracker.rb +0 -5
- data/lib/volt/reactive/hash_dependency.rb +0 -1
- data/lib/volt/server/html_parser/attribute_scope.rb +1 -1
- data/lib/volt/server/rack/component_paths.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 725663d259d0cbdeb328cb92cb6185af9df2b191
|
4
|
+
data.tar.gz: 10b2471d0b582b232e176cba6a57d9b944b2571f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8892f547d0ad523e00ef77e48129675e5027ee1235f52bef93375b4aa2f90b4c77499344e7fa120163144bb05c2aa91e1c9e6a69cd85878174e6250ffc17973
|
7
|
+
data.tar.gz: 3f3893a24fd20f25923a6cca7b4f3d087690b52b80bc8bf00f1db4c7ec8de4d2a1835dd584e9364ebc6b5c0b283f0429ec21c70a7202df2dd30416a964b0d7a4
|
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
# 0.8.6 - Oct 5, 2014
|
2
2
|
|
3
3
|
- Major changes to the templating system (to address common concerns and make things simpler).
|
4
|
-
1. All binding now takes place between {{ and }} instead of { and } (double stash instead of single stash) Escaping is still with a tripple stash {{{ escap{{ed}} }}} => escap{{ed}}
|
4
|
+
1. All binding now takes place between ```{{ and }}``` instead of ```{ and }``` (double stash instead of single stash) Escaping is still with a tripple stash ```{{{ escap{{ed}} }}}``` => escap{{ed}}
|
5
5
|
2. Bindings can now be (almost) any ruby code. No more #'s at the beginning. Blocks are now closed with {{ end }}
|
6
|
-
If's are now: {{ if _something }} ... {{ elsif _other }} .. {{ else }} .. {{ end }}
|
7
|
-
Each's are now: {{ _items.each do |item| }} ... {{ end }}
|
8
|
-
Template bindings are now: {{ template "path" }} (along with other options)
|
9
|
-
|
6
|
+
If's are now: ```{{ if _something }}``` ... ```{{ elsif _other }}``` .. ```{{ else }}``` .. ```{{ end }}```
|
7
|
+
Each's are now: ```{{ _items.each do |item| }}``` ... ```{{ end }}```
|
8
|
+
Template bindings are now: ```{{ template "path" }}``` (along with other options)
|
10
9
|
Each should use do notation not brackets. Also, .each is not actually called, the binding is parsed and converted into a EachBinding. Other Eneumerable methods do not work at this time, only each. (more coming soon)
|
11
10
|
3. Bindings in routes now use double stashes as well get '/products/{{ _name }}/info'
|
12
|
-
4. To help clean things up, we reccomend spaces between {{ and }}
|
11
|
+
4. To help clean things up, we reccomend spaces between ```{{``` and ```}}```
|
13
12
|
|
14
13
|
|
15
14
|
# 0.8.4 - Oct 4, 2014
|
data/Readme.md
CHANGED
@@ -447,7 +447,7 @@ Above, I mentioned that Volt comes with many default collection models accessibl
|
|
447
447
|
|
448
448
|
The store collection backs data in the data store. Currently the only supported data store is Mongo. (More coming soon, RethinkDb will probably be next) You can use store very similar to the other collections.
|
449
449
|
|
450
|
-
In Volt you can access ```store``` on the front-end and the back-end. Data will automatically be synced between the front-end and the backend. Any changes to the data in store will be reflected on any clients using the data (unless a [buffer](#
|
450
|
+
In Volt you can access ```store``` on the front-end and the back-end. Data will automatically be synced between the front-end and the backend. Any changes to the data in store will be reflected on any clients using the data (unless a [buffer](#buffers) is in use - see below).
|
451
451
|
|
452
452
|
```ruby
|
453
453
|
store._items << {_name: 'Item 1'}
|
@@ -727,15 +727,15 @@ Here "auth" would be the component name.
|
|
727
727
|
|
728
728
|
## Reactive Accessors
|
729
729
|
|
730
|
-
The default ModelController proxies any missing methods to its model.
|
730
|
+
The default ModelController proxies any missing methods to its model. Sometimes you need to store additional data reactively in the controller outside of the model. (Though often you may want to condier doing another control/controller). In this case, you can add a ```reactive_accessor```. These behave just like ```attr_accessor``` except the values assigned and returned are tracked for any Computations.
|
731
731
|
|
732
732
|
```ruby
|
733
733
|
class Contacts < ModelController
|
734
|
-
reactive_accessor :
|
734
|
+
reactive_accessor :query
|
735
735
|
end
|
736
736
|
```
|
737
737
|
|
738
|
-
Now from the view we can bind to
|
738
|
+
Now from the view we can bind to query while also changing in and out the model. You can also use ```reactive_reader``` and ```reactive_writer``` When query is accessed it tracks that it was accessed and will any Computations when it changes.
|
739
739
|
|
740
740
|
# Tasks
|
741
741
|
|
@@ -982,7 +982,7 @@ Routes are matched top to bottom in a routes file.
|
|
982
982
|
|
983
983
|
# Channel
|
984
984
|
|
985
|
-
Controllers provide a `#channel` method, that you can use to get the status of the connection to the backend. Channel
|
985
|
+
Controllers provide a `#channel` method, that you can use to get the status of the connection to the backend. Channel's access methods are reactive and when the status changes, the watching computations will be re-triggered. It provides the following:
|
986
986
|
|
987
987
|
| method | description |
|
988
988
|
|-------------|-----------------------------------------------------------|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.8
|
data/lib/volt/boot.rb
CHANGED
data/lib/volt/console.rb
CHANGED
@@ -6,8 +6,7 @@ class Object
|
|
6
6
|
Hash[instance_variables.map { |name| [name[1..-1], instance_variable_get(name)] }]
|
7
7
|
end
|
8
8
|
|
9
|
-
# Provides the same functionality as ||, but
|
10
|
-
# work with method calls, we provide .or as a convience.
|
9
|
+
# Provides the same functionality as ||, but treats a nil model as falsy
|
11
10
|
def or(other)
|
12
11
|
if self && !self.nil?
|
13
12
|
return self
|
@@ -16,8 +15,7 @@ class Object
|
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
19
|
-
# Provides the same functionality as &&,
|
20
|
-
# work with method calls, we provide .and as a convience
|
18
|
+
# Provides the same functionality as &&, treats a nil model as falsy
|
21
19
|
def and(other)
|
22
20
|
if self && !self.nil?
|
23
21
|
return other
|
data/lib/volt/models/model.rb
CHANGED
@@ -173,7 +173,7 @@ class Model
|
|
173
173
|
rescue => e
|
174
174
|
result = e
|
175
175
|
|
176
|
-
# Cleanup backtrace
|
176
|
+
# Cleanup backtrace
|
177
177
|
# TODO: this could be better
|
178
178
|
result.backtrace.reject! {|line| line['lib/models/model.rb'] || line['lib/models/live_value.rb'] }
|
179
179
|
end
|
@@ -243,10 +243,6 @@ class Model
|
|
243
243
|
# Add the new item
|
244
244
|
result << value
|
245
245
|
|
246
|
-
# TODORW:
|
247
|
-
# trigger!('added', nil, 0)
|
248
|
-
# trigger!('changed')
|
249
|
-
|
250
246
|
return nil
|
251
247
|
end
|
252
248
|
|
@@ -18,7 +18,7 @@ class QueryListener
|
|
18
18
|
@tasks.call('QueryTasks', 'add_listener', @collection, @query) do |results, errors|
|
19
19
|
# puts "Query Tasks: #{results.inspect} - #{@stores.inspect} - #{self.inspect}"
|
20
20
|
# When the initial data comes back, add it into the stores.
|
21
|
-
@stores.each do |store|
|
21
|
+
@stores.dup.each do |store|
|
22
22
|
# Clear if there are existing items
|
23
23
|
store.model.clear if store.model.size > 0
|
24
24
|
|
data/lib/volt/page/tasks.rb
CHANGED
@@ -88,7 +88,7 @@ module AttributeScope
|
|
88
88
|
if tag_name == 'textarea'
|
89
89
|
raise "The content of text area's can not be bound to multiple bindings."
|
90
90
|
else
|
91
|
-
# Multiple
|
91
|
+
# Multiple values can not be passed to value or checked attributes.
|
92
92
|
raise "Multiple bindings can not be passed to a #{attribute_name} binding."
|
93
93
|
end
|
94
94
|
end
|
@@ -60,6 +60,14 @@ class ComponentPaths
|
|
60
60
|
path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
|
61
61
|
require(path)
|
62
62
|
end
|
63
|
+
|
64
|
+
if Volt.server?
|
65
|
+
# Add models to page
|
66
|
+
Dir["#{app_folder}/*/models/*.rb"].each do |ruby_file|
|
67
|
+
class_name = File.basename(ruby_file).gsub(/[.]rb$/, '')
|
68
|
+
$page.add_model(class_name)
|
69
|
+
end
|
70
|
+
end
|
63
71
|
end
|
64
72
|
end
|
65
73
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|