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
@@ -10,7 +10,7 @@ module Volt
10
10
  @scope.last
11
11
  end
12
12
 
13
- def initialize(initial_path, allow_sections=true)
13
+ def initialize(initial_path, allow_sections = true)
14
14
  @original_path = initial_path
15
15
 
16
16
  # Default to the body section
@@ -35,7 +35,7 @@ module Volt
35
35
  end
36
36
  end
37
37
 
38
- return templates
38
+ templates
39
39
  end
40
40
  end
41
41
  end
@@ -36,7 +36,7 @@ module Volt
36
36
  if args.blank?
37
37
  add_else(nil)
38
38
  else
39
- raise "else does not take a conditional, #{content} was provided."
39
+ fail "else does not take a conditional, #{content} was provided."
40
40
  end
41
41
  when 'template'
42
42
  add_template(args)
@@ -73,7 +73,7 @@ module Volt
73
73
  end
74
74
 
75
75
  def add_else(content)
76
- raise "#else can only be added inside of an if block"
76
+ fail '#else can only be added inside of an if block'
77
77
  end
78
78
 
79
79
  def add_each(content)
@@ -99,11 +99,11 @@ module Volt
99
99
  parent = 'self'
100
100
  end
101
101
 
102
- return parent
102
+ parent
103
103
  end
104
104
 
105
105
  def last_method_name(getter)
106
- return getter.strip[/[^.]+$/]
106
+ getter.strip[/[^.]+$/]
107
107
  end
108
108
 
109
109
  def add_component(tag_name, attributes, unary)
@@ -125,17 +125,17 @@ module Volt
125
125
  data_hash << "#{name.inspect} => Proc.new { #{getter} }"
126
126
 
127
127
  setter = getter_to_setter(getter)
128
- data_hash << "#{(name + "=").inspect} => Proc.new { |val| #{setter} }"
128
+ data_hash << "#{(name + '=').inspect} => Proc.new { |val| #{setter} }"
129
129
 
130
130
  # Add an _parent fetcher. Useful for things like volt-fields to get the parent model.
131
131
  parent = parent_fetcher(getter)
132
132
 
133
133
  # TODO: This adds some overhead, perhaps there is a way to compute this dynamically on the
134
134
  # front-end.
135
- data_hash << "#{(name + "_parent").inspect} => Proc.new { #{parent} }"
135
+ data_hash << "#{(name + '_parent').inspect} => Proc.new { #{parent} }"
136
136
 
137
137
  # Add a _last_method property. This is useful
138
- data_hash << "#{(name + "_last_method").inspect} => #{last_method_name(getter).inspect}"
138
+ data_hash << "#{(name + '_last_method').inspect} => #{last_method_name(getter).inspect}"
139
139
  end
140
140
  else
141
141
  # String
@@ -159,17 +159,17 @@ module Volt
159
159
  end
160
160
 
161
161
  # Called when this scope should be closed out
162
- def close_scope(pop=true)
162
+ def close_scope(pop = true)
163
163
  if pop
164
164
  scope = @handler.scope.pop
165
165
  else
166
166
  scope = @handler.last
167
167
  end
168
168
 
169
- raise "template path already exists: #{scope.path}" if @handler.templates[scope.path]
169
+ fail "template path already exists: #{scope.path}" if @handler.templates[scope.path]
170
170
 
171
171
  template = {
172
- 'html' => scope.html
172
+ 'html' => scope.html
173
173
  }
174
174
 
175
175
  if scope.bindings.size > 0
@@ -14,12 +14,12 @@ module Volt
14
14
 
15
15
  def load_dependencies(path)
16
16
  if path
17
- dependencies_file = File.join(path, "config/dependencies.rb")
17
+ dependencies_file = File.join(path, 'config/dependencies.rb')
18
18
  else
19
- raise "Unable to find component #{component_name.inspect}"
19
+ fail "Unable to find component #{component_name.inspect}"
20
20
  end
21
21
 
22
- if File.exists?(dependencies_file)
22
+ if File.exist?(dependencies_file)
23
23
  # Run the dependencies file in this asset files context
24
24
  code = File.read(dependencies_file)
25
25
  instance_eval(code)
@@ -28,18 +28,19 @@ module Volt
28
28
 
29
29
  def component(name)
30
30
  unless @included_components[name]
31
- # Get the path to the component
32
- path = @component_paths.component_path(name)
33
-
34
31
  # Track that we added
35
32
  @included_components[name] = true
36
33
 
37
- # Load the dependencies
38
- load_dependencies(path)
34
+ # Get the path to the component
35
+ @component_paths.component_paths(name).each do |path|
36
+
37
+ # Load the dependencies
38
+ load_dependencies(path)
39
39
 
40
- # Add any assets
41
- add_assets(path)
42
- @components << [path, name]
40
+ # Add any assets
41
+ add_assets(path)
42
+ @components << [path, name]
43
+ end
43
44
  end
44
45
  end
45
46
 
@@ -56,7 +57,7 @@ module Volt
56
57
  end
57
58
 
58
59
  def component_paths
59
- return @components
60
+ @components
60
61
  end
61
62
 
62
63
  def add_assets(path)
@@ -66,7 +67,6 @@ module Volt
66
67
  end
67
68
  end
68
69
 
69
-
70
70
  def javascript_files(opal_files)
71
71
  javascript_files = []
72
72
  @assets.each do |type, path|
@@ -88,7 +88,7 @@ module Volt
88
88
 
89
89
  javascript_files += opal_js_files
90
90
 
91
- return javascript_files
91
+ javascript_files.uniq
92
92
  end
93
93
 
94
94
  def css_files
@@ -102,8 +102,7 @@ module Volt
102
102
  end
103
103
  end
104
104
 
105
- return css_files
105
+ css_files.uniq
106
106
  end
107
-
108
107
  end
109
108
  end
@@ -6,7 +6,7 @@ require 'volt/server/rack/asset_files'
6
6
  # method that returns all of the ruby setup code for the component.
7
7
  module Volt
8
8
  class ComponentCode
9
- def initialize(component_name, component_paths, client=true)
9
+ def initialize(component_name, component_paths, client = true)
10
10
  @component_name = component_name
11
11
  @component_paths = component_paths
12
12
  @client = client
@@ -21,7 +21,7 @@ module Volt
21
21
  code << "\n\n"
22
22
  end
23
23
 
24
- return code
24
+ code
25
25
  end
26
26
  end
27
27
  end
@@ -4,7 +4,6 @@ require 'volt/page/page'
4
4
  module Volt
5
5
  class ComponentHtmlRenderer
6
6
  def initialize
7
-
8
7
  end
9
8
 
10
9
  def call(env)
@@ -1,7 +1,7 @@
1
1
  # ComponentPaths gives an array of every folder where you find a component.
2
2
  module Volt
3
3
  class ComponentPaths
4
- def initialize(root=nil)
4
+ def initialize(root = nil)
5
5
  @root = root || Dir.pwd
6
6
  end
7
7
 
@@ -9,12 +9,12 @@ module Volt
9
9
  def app_folders
10
10
  # Find all app folders
11
11
  @app_folders ||= begin
12
- volt_app = File.expand_path(File.join(File.dirname(__FILE__), "../../../../app"))
12
+ volt_app = File.expand_path(File.join(File.dirname(__FILE__), '../../../../app'))
13
13
  app_folders = [volt_app, "#{@root}/app", "#{@root}/vendor/app"].map { |f| File.expand_path(f) }
14
14
 
15
15
  # Gem folders with volt in them
16
16
  # TODO: we should probably qualify this a bit more
17
- app_folders += Gem.loaded_specs.values.map { |g| g.full_gem_path }.reject { |g| g !~ /volt/ }.map { |f| f + '/app' }
17
+ app_folders += Gem.loaded_specs.values.map(&:full_gem_path).reject { |g| g !~ /volt/ }.map { |f| f + '/app' }
18
18
 
19
19
  app_folders
20
20
  end
@@ -27,7 +27,7 @@ module Volt
27
27
  files << yield(app_folder)
28
28
  end
29
29
 
30
- return files.flatten
30
+ files.flatten
31
31
  end
32
32
 
33
33
  # returns an array of every folder that is a component
@@ -40,13 +40,16 @@ module Volt
40
40
  if File.directory?(folder)
41
41
  folder_name = folder[/[^\/]+$/]
42
42
 
43
- @components[folder_name] ||= []
44
- @components[folder_name] << folder
43
+ # Add in the folder if it's not alreay in there
44
+ folders = (@components[folder_name] ||= [])
45
+ unless folders.include?(folder)
46
+ folders << folder
47
+ end
45
48
  end
46
49
  end
47
50
  end
48
51
 
49
- return @components
52
+ @components
50
53
  end
51
54
 
52
55
  # Makes each components classes available on the load path, require classes.
@@ -73,12 +76,12 @@ module Volt
73
76
  end
74
77
  end
75
78
 
76
- # Returns the path for a specific component
77
- def component_path(name)
79
+ # Returns all paths for a specific component
80
+ def component_paths(name)
78
81
  folders = components[name]
79
82
 
80
83
  if folders
81
- return folders.first
84
+ return folders
82
85
  else
83
86
  return nil
84
87
  end
@@ -11,7 +11,7 @@ module Volt
11
11
 
12
12
  @@router ||= Routes.new.define do
13
13
  # Find the route file
14
- home_path = component_paths.component_path('main')
14
+ home_path = component_paths.component_paths('main').first
15
15
  route_file = File.read("#{home_path}/config/routes.rb")
16
16
  eval(route_file)
17
17
  end
@@ -22,19 +22,19 @@ module Volt
22
22
 
23
23
  return params if params
24
24
 
25
- return false
25
+ false
26
26
  end
27
27
 
28
28
  def call(env)
29
29
  if route_match?(env['PATH_INFO'])
30
- [200, {'Content-Type' => 'text/html; charset=utf-8'}, [html]]
30
+ [200, { 'Content-Type' => 'text/html; charset=utf-8' }, [html]]
31
31
  else
32
32
  @app.call env
33
33
  end
34
34
  end
35
35
 
36
36
  def html
37
- index_path = File.expand_path(File.join(Volt.root, "public/index.html"))
37
+ index_path = File.expand_path(File.join(Volt.root, 'public/index.html'))
38
38
  html = File.read(index_path)
39
39
 
40
40
  ERB.new(html).result(binding)
@@ -23,7 +23,7 @@ module Volt
23
23
  # environment in closure
24
24
  environment = @environment
25
25
 
26
- environment.cache = Sprockets::Cache::FileStore.new("./tmp")
26
+ environment.cache = Sprockets::Cache::FileStore.new('./tmp')
27
27
 
28
28
  if Volt.env.production?
29
29
  # Compress in production
@@ -33,7 +33,7 @@ module Volt
33
33
 
34
34
  environment.append_path(app_path)
35
35
 
36
- volt_gem_lib_path = File.expand_path(File.join(File.dirname(__FILE__), "../../.."))
36
+ volt_gem_lib_path = File.expand_path(File.join(File.dirname(__FILE__), '../../..'))
37
37
  environment.append_path(volt_gem_lib_path)
38
38
 
39
39
  add_asset_folders(environment)
@@ -44,8 +44,8 @@ module Volt
44
44
  end
45
45
 
46
46
  # opal-jquery gem
47
- spec = Gem::Specification.find_by_name("opal-jquery")
48
- environment.append_path(spec.gem_dir + "/opal")
47
+ spec = Gem::Specification.find_by_name('opal-jquery')
48
+ environment.append_path(spec.gem_dir + '/opal')
49
49
 
50
50
  builder.map '/assets' do
51
51
  run environment
@@ -65,6 +65,5 @@ module Volt
65
65
  environment.append_path(asset_folder)
66
66
  end
67
67
  end
68
-
69
68
  end
70
69
  end
@@ -1,6 +1,6 @@
1
1
  module Volt
2
2
  class SourceMapServer
3
- def initialize sprockets
3
+ def initialize(sprockets)
4
4
  @sprockets = sprockets
5
5
  end
6
6
 
@@ -24,9 +24,9 @@ module Volt
24
24
  asset = sprockets[path]
25
25
  return [404, {}, []] if asset.nil?
26
26
 
27
- return [200, {"Content-Type" => "text/json"}, [$OPAL_SOURCE_MAPS[asset.pathname].to_s]]
27
+ return [200, { 'Content-Type' => 'text/json' }, [$OPAL_SOURCE_MAPS[asset.pathname].to_s]]
28
28
  else
29
- return [200, {"Content-Type" => "text/text"}, [File.read(sprockets.resolve(path_info))]]
29
+ return [200, { 'Content-Type' => 'text/text' }, [File.read(sprockets.resolve(path_info))]]
30
30
  end
31
31
  end
32
32
  end
@@ -1,6 +1,6 @@
1
1
  require 'json'
2
2
  require 'sockjs/session'
3
- require File.join(File.dirname(__FILE__), "../../../app/volt/tasks/query_tasks")
3
+ require File.join(File.dirname(__FILE__), '../../../app/volt/tasks/query_tasks')
4
4
 
5
5
  module Volt
6
6
  class SocketConnectionHandler < SockJS::Session
@@ -15,14 +15,13 @@ module Volt
15
15
  end
16
16
 
17
17
  # Sends a message to all, optionally skipping a users channel
18
- def self.send_message_all(skip_channel=nil, *args)
18
+ def self.send_message_all(skip_channel = nil, *args)
19
19
  @@channels.each do |channel|
20
20
  if skip_channel && channel == skip_channel
21
21
  next
22
22
  end
23
23
  channel.send_message(*args)
24
24
  end
25
-
26
25
  end
27
26
 
28
27
  def initialize(session, *args)
@@ -63,7 +62,7 @@ module Volt
63
62
  end
64
63
 
65
64
  def inspect
66
- "<#{self.class.to_s}:#{object_id}>"
65
+ "<#{self.class}:#{object_id}>"
67
66
  end
68
67
  end
69
68
  end
@@ -13,7 +13,7 @@ module Volt
13
13
  end
14
14
 
15
15
  # Sends a message to all, optionally skipping a users channel
16
- def self.send_message_all(skip_channel=nil, *args)
16
+ def self.send_message_all(skip_channel = nil, *args)
17
17
  # Stub
18
18
  end
19
19
 
@@ -1,5 +1,5 @@
1
1
  module Volt
2
- def self.spec_setup(app_path='.')
2
+ def self.spec_setup(app_path = '.')
3
3
  if RUBY_PLATFORM == 'opal'
4
4
  require 'volt'
5
5
  else
@@ -23,7 +23,7 @@ module Volt
23
23
 
24
24
  Capybara.server do |app, port|
25
25
  require 'rack/handler/thin'
26
- Rack::Handler::Thin.run(app, :Port => port)
26
+ Rack::Handler::Thin.run(app, Port: port)
27
27
  end
28
28
 
29
29
  Capybara.app = Server.new(app_path).app
@@ -50,7 +50,7 @@ module Volt
50
50
  elsif ENV['BROWSER'] == 'safari'
51
51
  # Needs extension
52
52
  Capybara.register_driver :safari do |app|
53
- Capybara::Selenium::Driver.new(app, :browser => :safari)
53
+ Capybara::Selenium::Driver.new(app, browser: :safari)
54
54
  end
55
55
  Capybara.default_driver = :safari
56
56
  end
@@ -1,5 +1,5 @@
1
1
  require 'mongo'
2
2
 
3
- mongo_client = Mongo::MongoClient.new("localhost", 27017)
3
+ mongo_client = Mongo::MongoClient.new('localhost', 27_017)
4
4
 
5
- db = mongo_client.db("test1")
5
+ db = mongo_client.db('test1')
@@ -7,7 +7,7 @@ module Volt
7
7
  $page.tasks.call(self.name, name, *args, &block)
8
8
  end
9
9
  else
10
- def initialize(channel=nil, dispatcher=nil)
10
+ def initialize(channel = nil, dispatcher = nil)
11
11
  @channel = channel
12
12
  @dispatcher = dispatcher
13
13
  end
@@ -27,7 +27,7 @@ module Volt
27
27
  promise = Promise.new
28
28
 
29
29
  begin
30
- result = self.new(nil, nil).send(name, *args, &block)
30
+ result = new(nil, nil).send(name, *args, &block)
31
31
 
32
32
  promise.resolve(result)
33
33
  rescue => e
@@ -36,7 +36,7 @@ module Volt
36
36
  promise.reject(e)
37
37
  end
38
38
 
39
- return promise
39
+ promise
40
40
  end
41
41
  end
42
42
  end