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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/CONTRIBUTING.md +1 -1
  4. data/README.md +1 -0
  5. data/app/volt/tasks/query_tasks.rb +4 -3
  6. data/app/volt/tasks/store_tasks.rb +1 -1
  7. data/lib/volt/boot.rb +8 -7
  8. data/lib/volt/cli/asset_compile.rb +1 -1
  9. data/lib/volt/cli/console.rb +14 -3
  10. data/lib/volt/cli/new_gem.rb +3 -3
  11. data/lib/volt/cli.rb +3 -3
  12. data/lib/volt/config.rb +7 -1
  13. data/lib/volt/data_stores/base.rb +7 -0
  14. data/lib/volt/data_stores/data_store.rb +10 -3
  15. data/lib/volt/data_stores/mongo_driver.rb +58 -7
  16. data/lib/volt/models/associations.rb +2 -2
  17. data/lib/volt/models/persistors/array_store.rb +24 -6
  18. data/lib/volt/models/persistors/base.rb +4 -0
  19. data/lib/volt/models/persistors/model_store.rb +4 -15
  20. data/lib/volt/page/bindings/attribute_binding.rb +17 -15
  21. data/lib/volt/page/bindings/each_binding.rb +14 -17
  22. data/lib/volt/page/bindings/view_binding/controller_handler.rb +24 -0
  23. data/lib/volt/page/bindings/view_binding.rb +10 -30
  24. data/lib/volt/page/document_events.rb +7 -4
  25. data/lib/volt/page/page.rb +19 -13
  26. data/lib/volt/page/path_string_renderer.rb +41 -0
  27. data/lib/volt/page/targets/dom_section.rb +5 -2
  28. data/lib/volt/reactive/computation.rb +3 -1
  29. data/lib/volt/reactive/reactive_accessors.rb +8 -7
  30. data/lib/volt/reactive/reactive_array.rb +2 -0
  31. data/lib/volt/server/component_handler.rb +3 -3
  32. data/lib/volt/server/component_templates.rb +32 -6
  33. data/lib/volt/server/forking_server.rb +4 -2
  34. data/lib/volt/server/rack/asset_files.rb +5 -1
  35. data/lib/volt/server/rack/component_paths.rb +6 -4
  36. data/lib/volt/server/rack/opal_files.rb +16 -11
  37. data/lib/volt/server/rack/quiet_common_logger.rb +1 -1
  38. data/lib/volt/server.rb +1 -1
  39. data/lib/volt/spec/setup.rb +1 -1
  40. data/lib/volt/version.rb +5 -0
  41. data/lib/volt/volt/app.rb +12 -2
  42. data/spec/apps/kitchen_sink/app/main/views/mailers/welcome.email +12 -0
  43. data/spec/integration/http_endpoints_spec.rb +1 -3
  44. data/spec/integration/user_spec.rb +0 -10
  45. data/spec/models/associations_spec.rb +0 -3
  46. data/spec/models/model_spec.rb +13 -0
  47. data/spec/models/persistors/flash_spec.rb +45 -0
  48. data/spec/models/validators/phone_number_validator_spec.rb +2 -2
  49. data/spec/page/bindings/template_binding/view_lookup_for_path_spec.rb +0 -5
  50. data/spec/page/path_string_renderer_spec.rb +23 -0
  51. data/spec/page/sub_context_spec.rb +1 -0
  52. data/spec/router/routes_spec.rb +24 -5
  53. data/spec/server/html_parser/view_handler_spec.rb +20 -0
  54. data/spec/server/rack/quite_common_logger_spec.rb +3 -3
  55. data/spec/spec_helper.rb +0 -4
  56. data/spec/tasks/query_tracker_spec.rb +30 -0
  57. data/templates/newgem/lib/newgem/version.rb.tt +7 -0
  58. data/templates/newgem/newgem.gemspec.tt +2 -4
  59. data/templates/project/Gemfile.tt +5 -2
  60. data/templates/project/config/app.rb.tt +49 -1
  61. data/volt.gemspec +12 -10
  62. metadata +24 -28
  63. data/VERSION +0 -1
  64. data/app/volt/tasks/live_query/data_store.rb +0 -33
  65. 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
@@ -1 +0,0 @@
1
- 0.0.1