volt 0.6.0 → 0.6.1
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 +4 -4
- data/Readme.md +7 -0
- data/VERSION +1 -1
- data/app/volt/tasks/live_query/live_query.rb +1 -1
- data/lib/volt/console.rb +1 -1
- data/lib/volt/models/array_model.rb +2 -2
- data/lib/volt/models/model.rb +2 -2
- data/lib/volt/models/model_helpers.rb +23 -0
- data/lib/volt/page/page.rb +0 -1
- data/lib/volt/server.rb +1 -1
- data/lib/volt/server/rack/component_paths.rb +13 -2
- 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: da0ec8ba7a9dd12d296bbcc1aa8d61f1ead80e7b
|
4
|
+
data.tar.gz: 2c2cfe82c79dffd7595ca067c684733e4c5808fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00936670499b943bd1cd52a2db013c9991429b85b1739cccb237975832524aaff9ad195856d09f2e3c9f2527004990a3287c1c1a676cd47ca5955b5011c0e983
|
7
|
+
data.tar.gz: 171b29c7808b72547de2e088981f69cacf515426f89a0a5c2eaac286d358f0dfb2ef58695c4ff4893860ea8f59d3de748c9a4863af7256ae4a8710652e99c47b
|
data/Readme.md
CHANGED
@@ -695,6 +695,13 @@ TODO
|
|
695
695
|
|
696
696
|
# Data Store
|
697
697
|
|
698
|
+
Volt provides a data store collection on the front-end and the back-end. Unlike the other [collections](#provided-collections), all plural names are assumed to be collections (like an array), and all singluar are assumed to be a model (like a hash).
|
699
|
+
|
700
|
+
```ruby
|
701
|
+
|
702
|
+
store._things
|
703
|
+
```
|
704
|
+
|
698
705
|
**Work in process**
|
699
706
|
|
700
707
|
| state | events bound | description |
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
@@ -30,7 +30,7 @@ class LiveQuery
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def notify_added(index, data, skip_channel)
|
33
|
-
notify! do |channel|
|
33
|
+
notify!(skip_channel) do |channel|
|
34
34
|
# puts "Added: #{index} - #{data.inspect} to #{channel.inspect}"
|
35
35
|
channel.send_message("added", nil, @collection, @query, index, data)
|
36
36
|
end
|
data/lib/volt/console.rb
CHANGED
data/lib/volt/models/model.rb
CHANGED
@@ -20,4 +20,27 @@ module ModelHelpers
|
|
20
20
|
def event_removed(event, no_more_events)
|
21
21
|
@persistor.event_removed(event, no_more_events) if @persistor
|
22
22
|
end
|
23
|
+
|
24
|
+
# Gets the class for a model at the specified path.
|
25
|
+
def class_at_path(path)
|
26
|
+
if path && path.last == :[]
|
27
|
+
begin
|
28
|
+
# TODO: SECURITY on the back-end we need to check that the model class we're loading
|
29
|
+
# is coming from the models folder.
|
30
|
+
|
31
|
+
# remove the _ and then singularize
|
32
|
+
klass_name = path[-2][1..-1].singularize.camelize
|
33
|
+
|
34
|
+
klass_name = klass_name.camelize
|
35
|
+
klass = Object.send(:const_get, klass_name.to_sym)
|
36
|
+
rescue NameError => e
|
37
|
+
# Ignore exception, just means the model isn't defined
|
38
|
+
klass = Model
|
39
|
+
end
|
40
|
+
else
|
41
|
+
klass = Model
|
42
|
+
end
|
43
|
+
|
44
|
+
return klass
|
45
|
+
end
|
23
46
|
end
|
data/lib/volt/page/page.rb
CHANGED
data/lib/volt/server.rb
CHANGED
@@ -47,8 +47,19 @@ class ComponentPaths
|
|
47
47
|
return @components
|
48
48
|
end
|
49
49
|
|
50
|
-
# Makes each components classes available on the load path
|
51
|
-
def
|
50
|
+
# Makes each components classes available on the load path, require classes.
|
51
|
+
def require_in_components
|
52
|
+
# app_folders do |app_folder|
|
53
|
+
# $LOAD_PATH.unshift(app_folder)
|
54
|
+
#
|
55
|
+
# Dir["#{app_folder}/*/{controllers,model}/*.rb"].each do |ruby_file|
|
56
|
+
# path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
|
57
|
+
# puts "Path: #{path}"
|
58
|
+
# # require(path)
|
59
|
+
# end
|
60
|
+
# end
|
61
|
+
|
62
|
+
# add each tasks folder directly
|
52
63
|
components.each do |name,component_folders|
|
53
64
|
component_folders.each do |component_folder|
|
54
65
|
Dir["#{component_folder}/tasks"].sort.each do |tasks_folder|
|
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.6.
|
4
|
+
version: 0.6.1
|
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-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|