volt 0.8.15 → 0.8.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -0
  3. data/CHANGELOG.md +11 -0
  4. data/Gemfile +1 -1
  5. data/Guardfile +2 -3
  6. data/Rakefile +1 -4
  7. data/VERSION +1 -1
  8. data/app/volt/controllers/notices_controller.rb +1 -1
  9. data/app/volt/tasks/live_query/data_store.rb +7 -7
  10. data/app/volt/tasks/live_query/live_query.rb +7 -9
  11. data/app/volt/tasks/live_query/live_query_pool.rb +13 -12
  12. data/app/volt/tasks/live_query/query_tracker.rb +4 -5
  13. data/app/volt/tasks/query_tasks.rb +9 -11
  14. data/app/volt/tasks/store_tasks.rb +4 -4
  15. data/app/volt/tasks/user_tasks.rb +1 -1
  16. data/bin/volt +2 -2
  17. data/lib/volt.rb +3 -7
  18. data/lib/volt/assets/test.rb +1 -2
  19. data/lib/volt/benchmark/benchmark.rb +3 -3
  20. data/lib/volt/boot.rb +1 -1
  21. data/lib/volt/cli.rb +18 -18
  22. data/lib/volt/cli/asset_compile.rb +8 -10
  23. data/lib/volt/cli/generate.rb +9 -11
  24. data/lib/volt/cli/new_gem.rb +51 -51
  25. data/lib/volt/config.rb +2 -3
  26. data/lib/volt/console.rb +1 -1
  27. data/lib/volt/controllers/model_controller.rb +6 -6
  28. data/lib/volt/data_stores/data_store.rb +1 -1
  29. data/lib/volt/data_stores/mongo_driver.rb +1 -1
  30. data/lib/volt/extra_core/array.rb +2 -2
  31. data/lib/volt/extra_core/blank.rb +1 -2
  32. data/lib/volt/extra_core/extra_core.rb +1 -1
  33. data/lib/volt/extra_core/inflector/methods.rb +0 -1
  34. data/lib/volt/extra_core/logger.rb +13 -7
  35. data/lib/volt/extra_core/numeric.rb +1 -1
  36. data/lib/volt/extra_core/string.rb +7 -7
  37. data/lib/volt/extra_core/stringify_keys.rb +5 -5
  38. data/lib/volt/models.rb +2 -2
  39. data/lib/volt/models/array_model.rb +18 -19
  40. data/lib/volt/models/cursor.rb +0 -1
  41. data/lib/volt/models/model.rb +17 -35
  42. data/lib/volt/models/model_hash_behaviour.rb +0 -2
  43. data/lib/volt/models/model_state.rb +1 -1
  44. data/lib/volt/models/model_wrapper.rb +1 -1
  45. data/lib/volt/models/persistors/array_store.rb +26 -13
  46. data/lib/volt/models/persistors/base.rb +1 -1
  47. data/lib/volt/models/persistors/flash.rb +2 -2
  48. data/lib/volt/models/persistors/local_store.rb +2 -3
  49. data/lib/volt/models/persistors/model_store.rb +7 -6
  50. data/lib/volt/models/persistors/params.rb +2 -2
  51. data/lib/volt/models/persistors/query/query_listener.rb +2 -0
  52. data/lib/volt/models/persistors/query/query_listener_pool.rb +1 -1
  53. data/lib/volt/models/persistors/store.rb +1 -2
  54. data/lib/volt/models/persistors/store_state.rb +2 -3
  55. data/lib/volt/models/url.rb +17 -16
  56. data/lib/volt/models/validations.rb +11 -14
  57. data/lib/volt/models/validators/length_validator.rb +3 -3
  58. data/lib/volt/models/validators/presence_validator.rb +2 -2
  59. data/lib/volt/page/bindings/attribute_binding.rb +2 -3
  60. data/lib/volt/page/bindings/base_binding.rb +1 -1
  61. data/lib/volt/page/bindings/each_binding.rb +8 -9
  62. data/lib/volt/page/bindings/event_binding.rb +2 -3
  63. data/lib/volt/page/bindings/template_binding.rb +8 -7
  64. data/lib/volt/page/bindings/template_binding/grouped_controllers.rb +2 -1
  65. data/lib/volt/page/channel.rb +10 -10
  66. data/lib/volt/page/channel_stub.rb +1 -1
  67. data/lib/volt/page/document.rb +0 -1
  68. data/lib/volt/page/document_events.rb +4 -4
  69. data/lib/volt/page/page.rb +26 -19
  70. data/lib/volt/page/string_template_renderer.rb +2 -2
  71. data/lib/volt/page/sub_context.rb +10 -4
  72. data/lib/volt/page/targets/attribute_section.rb +1 -1
  73. data/lib/volt/page/targets/attribute_target.rb +1 -2
  74. data/lib/volt/page/targets/base_section.rb +4 -4
  75. data/lib/volt/page/targets/binding_document/base_node.rb +0 -1
  76. data/lib/volt/page/targets/binding_document/component_node.rb +4 -5
  77. data/lib/volt/page/targets/dom_section.rb +21 -22
  78. data/lib/volt/page/targets/dom_target.rb +1 -1
  79. data/lib/volt/page/targets/dom_template.rb +11 -12
  80. data/lib/volt/page/targets/helpers/comment_searchers.rb +7 -8
  81. data/lib/volt/page/tasks.rb +0 -1
  82. data/lib/volt/page/template_renderer.rb +1 -1
  83. data/lib/volt/page/url_tracker.rb +3 -3
  84. data/lib/volt/reactive/computation.rb +5 -11
  85. data/lib/volt/reactive/dependency.rb +1 -3
  86. data/lib/volt/reactive/eventable.rb +17 -4
  87. data/lib/volt/reactive/hash_dependency.rb +1 -0
  88. data/lib/volt/reactive/reactive_accessors.rb +0 -1
  89. data/lib/volt/reactive/reactive_array.rb +20 -25
  90. data/lib/volt/reactive/reactive_hash.rb +3 -3
  91. data/lib/volt/router/routes.rb +11 -13
  92. data/lib/volt/server.rb +17 -17
  93. data/lib/volt/server/component_handler.rb +2 -2
  94. data/lib/volt/server/component_templates.rb +8 -8
  95. data/lib/volt/server/html_parser/attribute_scope.rb +9 -10
  96. data/lib/volt/server/html_parser/if_view_scope.rb +2 -2
  97. data/lib/volt/server/html_parser/sandlebars_parser.rb +14 -14
  98. data/lib/volt/server/html_parser/textarea_scope.rb +1 -2
  99. data/lib/volt/server/html_parser/view_handler.rb +1 -1
  100. data/lib/volt/server/html_parser/view_parser.rb +1 -1
  101. data/lib/volt/server/html_parser/view_scope.rb +10 -10
  102. data/lib/volt/server/rack/asset_files.rb +15 -16
  103. data/lib/volt/server/rack/component_code.rb +2 -2
  104. data/lib/volt/server/rack/component_html_renderer.rb +0 -1
  105. data/lib/volt/server/rack/component_paths.rb +13 -10
  106. data/lib/volt/server/rack/index_files.rb +4 -4
  107. data/lib/volt/server/rack/opal_files.rb +4 -5
  108. data/lib/volt/server/rack/source_map_server.rb +3 -3
  109. data/lib/volt/server/socket_connection_handler.rb +3 -4
  110. data/lib/volt/server/socket_connection_handler_stub.rb +1 -1
  111. data/lib/volt/spec/setup.rb +3 -3
  112. data/lib/volt/store/mongo.rb +2 -2
  113. data/lib/volt/tasks/task_handler.rb +3 -3
  114. data/lib/volt/utils/generic_counting_pool.rb +2 -2
  115. data/lib/volt/utils/generic_pool.rb +7 -8
  116. data/lib/volt/utils/local_storage.rb +4 -4
  117. data/lib/volt/volt/environment.rb +1 -1
  118. data/spec/apps/file_loading/app/shared/config/dependencies.rb +1 -1
  119. data/spec/apps/kitchen_sink/Gemfile +0 -2
  120. data/spec/apps/kitchen_sink/app/main/config/routes.rb +5 -5
  121. data/spec/apps/kitchen_sink/app/main/controllers/main_controller.rb +7 -6
  122. data/spec/apps/kitchen_sink/app/main/controllers/todos_controller.rb +3 -4
  123. data/spec/controllers/reactive_accessors_spec.rb +4 -4
  124. data/spec/extra_core/inflector_spec.rb +1 -1
  125. data/spec/extra_core/string_transformation_test_cases.rb +23 -24
  126. data/spec/extra_core/string_transformations_spec.rb +11 -12
  127. data/spec/integration/bindings_spec.rb +15 -15
  128. data/spec/integration/list_spec.rb +12 -13
  129. data/spec/integration/templates_spec.rb +3 -3
  130. data/spec/models/model_spec.rb +74 -80
  131. data/spec/models/persistors/params_spec.rb +2 -2
  132. data/spec/models/persistors/store_spec.rb +4 -4
  133. data/spec/models/validations_spec.rb +14 -23
  134. data/spec/page/bindings/content_binding_spec.rb +7 -8
  135. data/spec/page/bindings/template_binding_spec.rb +22 -24
  136. data/spec/page/sub_context_spec.rb +2 -2
  137. data/spec/reactive/computation_spec.rb +3 -3
  138. data/spec/reactive/reactive_array_spec.rb +12 -12
  139. data/spec/router/routes_spec.rb +45 -48
  140. data/spec/server/html_parser/sandlebars_parser_spec.rb +42 -42
  141. data/spec/server/html_parser/view_parser_spec.rb +132 -153
  142. data/spec/server/rack/asset_files_spec.rb +9 -8
  143. data/spec/server/rack/component_paths_spec.rb +5 -5
  144. data/spec/server/rack/rack_requests_spec.rb +3 -3
  145. data/spec/spec_helper.rb +1 -1
  146. data/spec/tasks/live_query_spec.rb +4 -5
  147. data/spec/tasks/query_tasks.rb +2 -4
  148. data/spec/tasks/query_tracker_spec.rb +29 -29
  149. data/spec/templates/targets/binding_document/component_node_spec.rb +1 -1
  150. data/spec/utils/generic_counting_pool_spec.rb +4 -4
  151. data/spec/utils/generic_pool_spec.rb +12 -12
  152. data/templates/component/config/routes.rb +2 -2
  153. data/templates/component/controllers/main_controller.rb +7 -6
  154. data/templates/newgem/app/newgem/config/dependencies.rb +1 -1
  155. data/templates/newgem/app/newgem/config/routes.rb +1 -1
  156. data/templates/project/app/main/config/routes.rb +2 -2
  157. data/templates/project/app/main/controllers/main_controller.rb +7 -6
  158. data/templates/project/spec/sample_spec.rb +2 -2
  159. data/volt.gemspec +32 -33
  160. metadata +3 -4
  161. data/lib/volt/extra_core/log.rb +0 -56
  162. data/lib/volt/extra_core/try.rb +0 -31
@@ -1,25 +1,26 @@
1
1
  if RUBY_PLATFORM != 'opal'
2
+ require 'spec_helper'
2
3
  require 'volt/server/rack/asset_files'
3
4
 
4
5
  describe Volt::AssetFiles do
5
6
  before do
6
- spec_app_root = File.join(File.dirname(__FILE__), "../../apps/file_loading")
7
+ spec_app_root = File.join(File.dirname(__FILE__), '../../apps/file_loading')
7
8
 
8
- path_to_main = File.join(File.dirname(__FILE__), "../../apps/file_loading/app/main")
9
+ path_to_main = File.join(File.dirname(__FILE__), '../../apps/file_loading/app/main')
9
10
  @component_paths = Volt::ComponentPaths.new(spec_app_root)
10
11
  end
11
12
 
12
- it "should return the dependencies list" do
13
- main = Volt::AssetFiles.new("main", @component_paths)
13
+ it 'should return the dependencies list' do
14
+ main = Volt::AssetFiles.new('main', @component_paths)
14
15
 
15
16
  components = main.components
16
- expect(components).to eq(['volt', 'main', 'shared', 'bootstrap', "slideshow"])
17
+ expect(components).to eq(%w(volt main shared bootstrap slideshow))
17
18
  end
18
19
 
19
- it "should list all JS files" do
20
- main = Volt::AssetFiles.new("main", @component_paths)
20
+ it 'should list all JS files' do
21
+ main = Volt::AssetFiles.new('main', @component_paths)
21
22
 
22
- expect(main.javascript_files(nil)).to eq(["/assets/js/jquery-2.0.3.js", "/assets/js/setImmediate.js", "/assets/js/sockjs-0.3.4.min.js", "/assets/js/bootstrap.js", "/assets/js/test2.js", "/assets/js/test3.js", "/assets/js/test1.js", "/assets/volt/page/page.js", "/components/main.js"])
23
+ expect(main.javascript_files(nil)).to eq(['/assets/js/jquery-2.0.3.js', '/assets/js/setImmediate.js', '/assets/js/sockjs-0.3.4.min.js', '/assets/js/bootstrap.js', '/assets/js/test2.js', '/assets/js/test3.js', '/assets/js/test1.js', '/assets/volt/page/page.js', '/components/main.js'])
23
24
  end
24
25
  end
25
26
  end
@@ -3,13 +3,13 @@ if RUBY_PLATFORM != 'opal'
3
3
 
4
4
  describe Volt::ComponentPaths do
5
5
  before do
6
- spec_app_root = File.join(File.dirname(__FILE__), "../../apps/file_loading")
6
+ spec_app_root = File.join(File.dirname(__FILE__), '../../apps/file_loading')
7
7
 
8
- path_to_main = File.join(File.dirname(__FILE__), "../../apps/file_loading/app/main")
8
+ path_to_main = File.join(File.dirname(__FILE__), '../../apps/file_loading/app/main')
9
9
  @component_paths = Volt::ComponentPaths.new(spec_app_root)
10
10
  end
11
11
 
12
- it "should return the paths to all app folders" do
12
+ it 'should return the paths to all app folders' do
13
13
  match_count = 0
14
14
  @component_paths.app_folders do |app_folder|
15
15
  if app_folder[/spec\/apps\/file_loading\/app$/] || app_folder[/spec\/apps\/file_loading\/vendor\/app$/]
@@ -20,8 +20,8 @@ if RUBY_PLATFORM != 'opal'
20
20
  expect(match_count).to eq(2)
21
21
  end
22
22
 
23
- it "should return the path to a component" do
24
- main_path = @component_paths.component_path('main')
23
+ it 'should return the path to a component' do
24
+ main_path = @component_paths.component_paths('main').first
25
25
  expect(main_path).to match(/spec\/apps\/file_loading\/app\/main$/)
26
26
  end
27
27
  end
@@ -1,10 +1,10 @@
1
1
 
2
2
  if ENV['BROWSER'] && ENV['BROWSER'] == 'phantom'
3
3
  describe 'Rack Requests', type: :feature do
4
- it "should send JS file with JS mimetype" do
4
+ it 'should send JS file with JS mimetype' do
5
5
  visit '/components/main.js'
6
6
 
7
- expect( page.response_headers[ 'Content-Type' ]).to include 'application/javascript'
7
+ expect(page.response_headers['Content-Type']).to include 'application/javascript'
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -3,7 +3,7 @@ require 'volt/spec/setup'
3
3
  if RUBY_PLATFORM == 'opal'
4
4
  else
5
5
  # Specs are run against the kitchen sink app
6
- kitchen_sink_path = File.expand_path(File.join(File.dirname(__FILE__), "apps/kitchen_sink"))
6
+ kitchen_sink_path = File.expand_path(File.join(File.dirname(__FILE__), 'apps/kitchen_sink'))
7
7
  Volt.spec_setup(kitchen_sink_path)
8
8
  end
9
9
 
@@ -1,20 +1,19 @@
1
1
  if RUBY_PLATFORM != 'opal'
2
- describe "LiveQuery" do
2
+ describe 'LiveQuery' do
3
3
  before do
4
- load File.join(File.dirname(__FILE__), "../../app/volt/tasks/live_query/live_query.rb")
4
+ load File.join(File.dirname(__FILE__), '../../app/volt/tasks/live_query/live_query.rb')
5
5
  end
6
6
 
7
- it "should run a query" do
7
+ it 'should run a query' do
8
8
  pool = double('volt/pool')
9
9
  data_store = double('volt/data store')
10
10
 
11
11
  expect(data_store).to receive(:query).with('_items', {}).and_return([
12
- {'_id' => 0, '_name' => 'one'}
12
+ { '_id' => 0, '_name' => 'one' }
13
13
  ])
14
14
 
15
15
  live_query = LiveQuery.new(pool, data_store, '_items', {})
16
16
  end
17
17
 
18
-
19
18
  end
20
19
  end
@@ -1,10 +1,8 @@
1
1
  if RUBY_PLATFORM != 'opal'
2
- describe "Volt::QueryTasks" do
2
+ describe 'Volt::QueryTasks' do
3
3
  before do
4
- load File.join(File.dirname(__FILE__), "../../app/volt/tasks/query_tasks.rb")
4
+ load File.join(File.dirname(__FILE__), '../../app/volt/tasks/query_tasks.rb')
5
5
  end
6
6
 
7
-
8
-
9
7
  end
10
8
  end
@@ -1,7 +1,7 @@
1
1
  if RUBY_PLATFORM != 'opal'
2
- describe "LiveQuery" do
2
+ describe 'LiveQuery' do
3
3
  before do
4
- load File.join(File.dirname(__FILE__), "../../app/volt/tasks/live_query/live_query.rb")
4
+ load File.join(File.dirname(__FILE__), '../../app/volt/tasks/live_query/live_query.rb')
5
5
  end
6
6
 
7
7
  # LiveQueryStub behaves as the front-end would with the changes to a
@@ -18,7 +18,7 @@ if RUBY_PLATFORM != 'opal'
18
18
 
19
19
  def notify_removed(ids, skip_channel)
20
20
  # Remove the id's that need to be removed
21
- @items.reject! {|item| ids.include?(item['_id']) }
21
+ @items.reject! { |item| ids.include?(item['_id']) }
22
22
  end
23
23
 
24
24
  def notify_added(index, data, skip_channel)
@@ -26,7 +26,7 @@ if RUBY_PLATFORM != 'opal'
26
26
  end
27
27
 
28
28
  def notify_moved(id, index, skip_channel)
29
- item = @items.find {|item| item['_id'] == id }
29
+ item = @items.find { |item| item['_id'] == id }
30
30
  @items.delete(item)
31
31
 
32
32
  @items.insert(index, item)
@@ -47,9 +47,9 @@ if RUBY_PLATFORM != 'opal'
47
47
 
48
48
  end
49
49
 
50
- it "should add items" do
50
+ it 'should add items' do
51
51
  @items = [
52
- {'_id' => 1, '_name' => 'one'}
52
+ { '_id' => 1, '_name' => 'one' }
53
53
  ]
54
54
 
55
55
  expect(@live_query.items).to eq([])
@@ -59,57 +59,57 @@ if RUBY_PLATFORM != 'opal'
59
59
  expect(@live_query.items).to eq(@items)
60
60
  end
61
61
 
62
- it "should remove items" do
62
+ it 'should remove items' do
63
63
  @items = [
64
- {'_id' => 1, '_name' => 'one'},
65
- {'_id' => 2, '_name' => 'two'}
64
+ { '_id' => 1, '_name' => 'one' },
65
+ { '_id' => 2, '_name' => 'two' }
66
66
  ]
67
67
  @query_tracker.run
68
68
  expect(@live_query.items).to eq(@items)
69
69
 
70
70
  @items = [
71
- {'_id' => 2, '_name' => 'two'}
71
+ { '_id' => 2, '_name' => 'two' }
72
72
  ]
73
73
  @query_tracker.run
74
74
  expect(@live_query.items).to eq(@items)
75
75
  end
76
76
 
77
- it "should move items" do
77
+ it 'should move items' do
78
78
  @items = [
79
- {'_id' => 1, '_name' => 'one'},
80
- {'_id' => 2, '_name' => 'two'},
81
- {'_id' => 3, '_name' => 'three'}
79
+ { '_id' => 1, '_name' => 'one' },
80
+ { '_id' => 2, '_name' => 'two' },
81
+ { '_id' => 3, '_name' => 'three' }
82
82
  ]
83
83
  @query_tracker.run
84
84
  expect(@live_query.items).to eq(@items)
85
85
 
86
86
  @items = [
87
- {'_id' => 2, '_name' => 'two'},
88
- {'_id' => 3, '_name' => 'three'},
89
- {'_id' => 1, '_name' => 'one'}
87
+ { '_id' => 2, '_name' => 'two' },
88
+ { '_id' => 3, '_name' => 'three' },
89
+ { '_id' => 1, '_name' => 'one' }
90
90
  ]
91
91
  @query_tracker.run
92
92
  expect(@live_query.items).to eq(@items)
93
93
  end
94
94
 
95
- it "should handle complex transforms" do
95
+ it 'should handle complex transforms' do
96
96
  @items = [
97
- {'_id' => 1, '_name' => 'one'},
98
- {'_id' => 2, '_name' => 'two'},
99
- {'_id' => 3, '_name' => 'three'},
100
- {'_id' => 4, '_name' => 'four'},
101
- {'_id' => 5, '_name' => 'five'}
97
+ { '_id' => 1, '_name' => 'one' },
98
+ { '_id' => 2, '_name' => 'two' },
99
+ { '_id' => 3, '_name' => 'three' },
100
+ { '_id' => 4, '_name' => 'four' },
101
+ { '_id' => 5, '_name' => 'five' }
102
102
  ]
103
103
  @query_tracker.run
104
104
  expect(@live_query.items).to eq(@items)
105
105
 
106
106
  @items = [
107
- {'_id' => 7, '_name' => 'seven'},
108
- {'_id' => 4, '_name' => 'four'},
109
- {'_id' => 1, '_name' => 'one'},
110
- {'_id' => 5, '_name' => 'five'},
111
- {'_id' => 3, '_name' => 'three'},
112
- {'_id' => 6, '_name' => 'five'}
107
+ { '_id' => 7, '_name' => 'seven' },
108
+ { '_id' => 4, '_name' => 'four' },
109
+ { '_id' => 1, '_name' => 'one' },
110
+ { '_id' => 5, '_name' => 'five' },
111
+ { '_id' => 3, '_name' => 'three' },
112
+ { '_id' => 6, '_name' => 'five' }
113
113
  ]
114
114
  @query_tracker.run
115
115
  expect(@live_query.items).to eq(@items)
@@ -10,7 +10,7 @@ describe Volt::ComponentNode do
10
10
  @component.html = html
11
11
  end
12
12
 
13
- it "should find a component from a binding id" do
13
+ it 'should find a component from a binding id' do
14
14
  expect(@component.find_by_binding_id(1).to_html).to eq('Inside')
15
15
  expect(@component.find_by_binding_id(0).to_html).to eq('Before Inside After')
16
16
 
@@ -1,8 +1,8 @@
1
1
  require 'volt/utils/generic_counting_pool'
2
2
 
3
3
  class CountingPoolTest < Volt::GenericCountingPool
4
- def create(id, name=nil)
5
- return Object.new
4
+ def create(id, name = nil)
5
+ Object.new
6
6
  end
7
7
  end
8
8
 
@@ -11,7 +11,7 @@ describe Volt::GenericCountingPool do
11
11
  @count_pool = CountingPoolTest.new
12
12
  end
13
13
 
14
- it "should lookup and retrieve" do
14
+ it 'should lookup and retrieve' do
15
15
  item1 = @count_pool.find('one')
16
16
 
17
17
  item2 = @count_pool.find('one')
@@ -21,7 +21,7 @@ describe Volt::GenericCountingPool do
21
21
  expect(item2).to_not eq(item3)
22
22
  end
23
23
 
24
- it "should only remove items when the same number have been removed as have been added" do
24
+ it 'should only remove items when the same number have been removed as have been added' do
25
25
  item1 = @count_pool.find('_items', 'one')
26
26
  item2 = @count_pool.find('_items', 'one')
27
27
  expect(@count_pool.instance_variable_get('@pool')).to_not eq({})
@@ -1,8 +1,8 @@
1
1
  require 'volt/utils/generic_pool'
2
2
 
3
3
  class PoolTest < Volt::GenericPool
4
- def create(collection, query, other=nil)
5
- return Object.new
4
+ def create(collection, query, other = nil)
5
+ Object.new
6
6
  end
7
7
  end
8
8
 
@@ -12,18 +12,18 @@ describe Volt::GenericPool do
12
12
  @pool_test = PoolTest.new
13
13
  end
14
14
 
15
- it "should insert nested for fast lookup at a path" do
15
+ it 'should insert nested for fast lookup at a path' do
16
16
  item1 = @pool_test.lookup('_items', 'one')
17
- expect(@pool_test.instance_variable_get('@pool')).to eq({'_items' => {'one' => item1}})
17
+ expect(@pool_test.instance_variable_get('@pool')).to eq('_items' => { 'one' => item1 })
18
18
  end
19
19
 
20
- it "should retrieve the same item both times" do
20
+ it 'should retrieve the same item both times' do
21
21
  item1 = @pool_test.lookup('_items', {})
22
22
  item2 = @pool_test.lookup('_items', {})
23
23
  expect(item1.object_id).to eq(item2.object_id)
24
24
  end
25
25
 
26
- it "should recreate after being removed" do
26
+ it 'should recreate after being removed' do
27
27
  item1 = @pool_test.lookup('_items', {})
28
28
  item2 = @pool_test.lookup('_items', {})
29
29
  expect(item1.object_id).to eq(item2.object_id)
@@ -33,17 +33,17 @@ describe Volt::GenericPool do
33
33
  expect(item3.object_id).to_not eq(item2.object_id)
34
34
  end
35
35
 
36
- it "should remove all of the way down" do
37
- @pool_test.instance_variable_set('@pool', {:name => {:ok => true}, :yep => true})
36
+ it 'should remove all of the way down' do
37
+ @pool_test.instance_variable_set('@pool', name: { ok: true }, yep: true)
38
38
 
39
39
  @pool_test.remove(:name, :ok)
40
40
 
41
- expect(@pool_test.instance_variable_get('@pool')).to eq({:yep => true})
41
+ expect(@pool_test.instance_variable_get('@pool')).to eq(yep: true)
42
42
  end
43
43
 
44
- it "should lookup all items at a path" do
45
- item1 = @pool_test.lookup('_items', '_some', {:name => 'bob'})
46
- item2 = @pool_test.lookup('_items', '_some', {:name => 'jim'})
44
+ it 'should lookup all items at a path' do
45
+ item1 = @pool_test.lookup('_items', '_some', name: 'bob')
46
+ item2 = @pool_test.lookup('_items', '_some', name: 'jim')
47
47
 
48
48
  expect(@pool_test.lookup_all('_items', '_some')).to eq([item1, item2])
49
49
  end
@@ -1,6 +1,6 @@
1
1
  # See https://github.com/voltrb/volt#routes for more info on routes
2
2
 
3
- get "/about", _action: 'about'
3
+ get '/about', _action: 'about'
4
4
 
5
5
  # The main route, this should be last. It will match any params not previously matched.
6
- get '/', {}
6
+ get '/', {}
@@ -8,10 +8,11 @@ class MainController < Volt::ModelController
8
8
  end
9
9
 
10
10
  private
11
- # the main template contains a #template binding that shows another
12
- # template. This is the path to that template. It may change based
13
- # on the params._controller and params._action values.
14
- def main_path
15
- params._controller.or('main') + "/" + params._action.or('index')
16
- end
11
+
12
+ # the main template contains a #template binding that shows another
13
+ # template. This is the path to that template. It may change based
14
+ # on the params._controller and params._action values.
15
+ def main_path
16
+ params._controller.or('main') + '/' + params._action.or('index')
17
+ end
17
18
  end
@@ -1 +1 @@
1
- # Component dependencies
1
+ # Component dependencies
@@ -1 +1 @@
1
- # Component routes
1
+ # Component routes
@@ -1,6 +1,6 @@
1
1
  # See https://github.com/voltrb/volt#routes for more info on routes
2
2
 
3
- get "/about", _action: 'about'
3
+ get '/about', _action: 'about'
4
4
 
5
5
  # The main route, this should be last. It will match any params not previously matched.
6
- get '/', {}
6
+ get '/', {}
@@ -8,10 +8,11 @@ class MainController < Volt::ModelController
8
8
  end
9
9
 
10
10
  private
11
- # the main template contains a #template binding that shows another
12
- # template. This is the path to that template. It may change based
13
- # on the params._controller and params._action values.
14
- def main_path
15
- params._controller.or('main') + "/" + params._action.or('index')
16
- end
11
+
12
+ # the main template contains a #template binding that shows another
13
+ # template. This is the path to that template. It may change based
14
+ # on the params._controller and params._action values.
15
+ def main_path
16
+ params._controller.or('main') + '/' + params._action.or('index')
17
+ end
17
18
  end
@@ -1,8 +1,8 @@
1
1
  if ENV['BROWSER']
2
2
  require 'spec_helper'
3
3
 
4
- describe "sample integration test", :type => :feature do
5
- it "should load the page" do
4
+ describe 'sample integration test', type: :feature do
5
+ it 'should load the page' do
6
6
  visit '/'
7
7
 
8
8
  expect(page).to have_content('Home')
@@ -5,50 +5,49 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  version = File.read(File.expand_path('../VERSION', __FILE__)).strip
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = "volt"
8
+ spec.name = 'volt'
9
9
  spec.version = version
10
- spec.authors = ["Ryan Stout"]
11
- spec.email = ["ryan@agileproductions.com"]
12
- spec.summary = %q{A ruby web framework where your ruby runs on both server and client (via Opal)}
10
+ spec.authors = ['Ryan Stout']
11
+ spec.email = ['ryan@agileproductions.com']
12
+ spec.summary = 'A ruby web framework where your ruby runs on both server and client (via Opal)'
13
13
  # spec.description = %q{}
14
- spec.homepage = "http://voltframework.com"
15
- spec.license = "MIT"
14
+ spec.homepage = 'http://voltframework.com'
15
+ spec.license = 'MIT'
16
16
 
17
- spec.files = `git ls-files`.split($/)
17
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ["lib"]
21
-
22
- spec.add_dependency "thor", "~> 0.19.0"
23
- spec.add_dependency "pry", "~> 0.9.12.0"
24
- spec.add_dependency "rack", "~> 1.5.0"
25
- spec.add_dependency "sprockets-sass", "~> 1.0.0"
26
- spec.add_dependency "sass", "~> 3.2.5"
27
- spec.add_dependency "mongo", "~> 1.9.0"
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_dependency 'thor', '~> 0.19.0'
23
+ spec.add_dependency 'pry', '~> 0.9.12.0'
24
+ spec.add_dependency 'rack', '~> 1.5.0'
25
+ spec.add_dependency 'sprockets-sass', '~> 1.0.0'
26
+ spec.add_dependency 'sass', '~> 3.2.5'
27
+ spec.add_dependency 'mongo', '~> 1.9.0'
28
28
  # spec.add_dependency "bson_ext", "~> 1.9.0"
29
29
  # spec.add_dependency "thin", "~> 1.6.0"
30
- spec.add_dependency "rake", "~> 10.0.4"
31
- spec.add_dependency "listen", "~> 2.7.0"
32
- spec.add_dependency "uglifier", "~> 2.4.0"
33
- spec.add_dependency "yui-compressor", "~> 0.12.0"
34
- spec.add_dependency "opal", "~> 0.6.0"
35
- spec.add_dependency "opal-jquery", "~> 0.2.0"
36
- spec.add_dependency "rspec-core", "~> 3.1.0"
37
- spec.add_dependency "rspec-expectations", "~> 3.1.0"
38
- spec.add_dependency "capybara", "~> 2.4.2"
39
- spec.add_dependency "selenium-webdriver", "~> 2.43.0"
40
- spec.add_dependency "chromedriver2-helper", "~> 0.0.8"
41
- spec.add_dependency "poltergeist", "~> 1.5.0"
42
- spec.add_dependency "opal-rspec", "0.3.0.beta3"
43
- spec.add_dependency "bundler", ">= 1.5"
44
-
30
+ spec.add_dependency 'rake', '~> 10.0.4'
31
+ spec.add_dependency 'listen', '~> 2.7.0'
32
+ spec.add_dependency 'uglifier', '~> 2.4.0'
33
+ spec.add_dependency 'yui-compressor', '~> 0.12.0'
34
+ spec.add_dependency 'opal', '~> 0.6.0'
35
+ spec.add_dependency 'opal-jquery', '~> 0.2.0'
36
+ spec.add_dependency 'rspec-core', '~> 3.1.0'
37
+ spec.add_dependency 'rspec-expectations', '~> 3.1.0'
38
+ spec.add_dependency 'capybara', '~> 2.4.2'
39
+ spec.add_dependency 'selenium-webdriver', '~> 2.43.0'
40
+ spec.add_dependency 'chromedriver2-helper', '~> 0.0.8'
41
+ spec.add_dependency 'poltergeist', '~> 1.5.0'
42
+ spec.add_dependency 'opal-rspec', '0.3.0.beta3'
43
+ spec.add_dependency 'bundler', '>= 1.5'
45
44
 
46
45
  # spec.add_dependency "promise.rb", "~> 0.6.1"
47
46
 
48
47
  # spec.add_dependency "rack-colorized_logger", "~> 1.0.4"
49
48
 
50
- spec.add_development_dependency "guard", "2.6.0" # bug in current guard
51
- spec.add_development_dependency "guard-rspec", "~> 4.3.0"
52
- spec.add_development_dependency "yard", "~> 0.8.7.0"
49
+ spec.add_development_dependency 'guard', '2.6.0' # bug in current guard
50
+ spec.add_development_dependency 'guard-rspec', '~> 4.3.0'
51
+ spec.add_development_dependency 'yard', '~> 0.8.7.0'
53
52
 
54
53
  end