volt 0.9.1.pre4 → 0.9.1.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +1 -0
- data/app/volt/tasks/query_tasks.rb +4 -3
- data/app/volt/tasks/store_tasks.rb +1 -1
- data/lib/volt/boot.rb +8 -7
- data/lib/volt/cli/asset_compile.rb +1 -1
- data/lib/volt/cli/console.rb +14 -3
- data/lib/volt/cli/new_gem.rb +3 -3
- data/lib/volt/cli.rb +3 -3
- data/lib/volt/config.rb +7 -1
- data/lib/volt/data_stores/base.rb +7 -0
- data/lib/volt/data_stores/data_store.rb +10 -3
- data/lib/volt/data_stores/mongo_driver.rb +58 -7
- data/lib/volt/models/associations.rb +2 -2
- data/lib/volt/models/persistors/array_store.rb +24 -6
- data/lib/volt/models/persistors/base.rb +4 -0
- data/lib/volt/models/persistors/model_store.rb +4 -15
- data/lib/volt/page/bindings/attribute_binding.rb +17 -15
- data/lib/volt/page/bindings/each_binding.rb +14 -17
- data/lib/volt/page/bindings/view_binding/controller_handler.rb +24 -0
- data/lib/volt/page/bindings/view_binding.rb +10 -30
- data/lib/volt/page/document_events.rb +7 -4
- data/lib/volt/page/page.rb +19 -13
- data/lib/volt/page/path_string_renderer.rb +41 -0
- data/lib/volt/page/targets/dom_section.rb +5 -2
- data/lib/volt/reactive/computation.rb +3 -1
- data/lib/volt/reactive/reactive_accessors.rb +8 -7
- data/lib/volt/reactive/reactive_array.rb +2 -0
- data/lib/volt/server/component_handler.rb +3 -3
- data/lib/volt/server/component_templates.rb +32 -6
- data/lib/volt/server/forking_server.rb +4 -2
- data/lib/volt/server/rack/asset_files.rb +5 -1
- data/lib/volt/server/rack/component_paths.rb +6 -4
- data/lib/volt/server/rack/opal_files.rb +16 -11
- data/lib/volt/server/rack/quiet_common_logger.rb +1 -1
- data/lib/volt/server.rb +1 -1
- data/lib/volt/spec/setup.rb +1 -1
- data/lib/volt/version.rb +5 -0
- data/lib/volt/volt/app.rb +12 -2
- data/spec/apps/kitchen_sink/app/main/views/mailers/welcome.email +12 -0
- data/spec/integration/http_endpoints_spec.rb +1 -3
- data/spec/integration/user_spec.rb +0 -10
- data/spec/models/associations_spec.rb +0 -3
- data/spec/models/model_spec.rb +13 -0
- data/spec/models/persistors/flash_spec.rb +45 -0
- data/spec/models/validators/phone_number_validator_spec.rb +2 -2
- data/spec/page/bindings/template_binding/view_lookup_for_path_spec.rb +0 -5
- data/spec/page/path_string_renderer_spec.rb +23 -0
- data/spec/page/sub_context_spec.rb +1 -0
- data/spec/router/routes_spec.rb +24 -5
- data/spec/server/html_parser/view_handler_spec.rb +20 -0
- data/spec/server/rack/quite_common_logger_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -4
- data/spec/tasks/query_tracker_spec.rb +30 -0
- data/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/templates/newgem/newgem.gemspec.tt +2 -4
- data/templates/project/Gemfile.tt +5 -2
- data/templates/project/config/app.rb.tt +49 -1
- data/volt.gemspec +12 -10
- metadata +24 -28
- data/VERSION +0 -1
- data/app/volt/tasks/live_query/data_store.rb +0 -33
- data/templates/newgem/VERSION +0 -1
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'mongo'
|
2
|
-
|
3
|
-
class DataStore
|
4
|
-
def initialize
|
5
|
-
end
|
6
|
-
|
7
|
-
def db
|
8
|
-
@@db ||= Volt::DataStore.fetch
|
9
|
-
end
|
10
|
-
|
11
|
-
def query(collection, query)
|
12
|
-
allowed_methods = ['find', 'skip', 'limit']
|
13
|
-
|
14
|
-
cursor = db[collection]
|
15
|
-
|
16
|
-
query.each do |query_part|
|
17
|
-
method_name, *args = query_part
|
18
|
-
|
19
|
-
unless allowed_methods.include?(method_name.to_s)
|
20
|
-
raise "`#{method_name}` is not part of a valid query"
|
21
|
-
end
|
22
|
-
|
23
|
-
cursor = cursor.send(method_name, *args)
|
24
|
-
end
|
25
|
-
|
26
|
-
cursor.to_a
|
27
|
-
end
|
28
|
-
|
29
|
-
def drop_database
|
30
|
-
db.connection.drop_database(Volt.config.db_name)
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
data/templates/newgem/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.1
|