volt 0.7.19 → 0.7.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e52814d6fe0018d0ed9ff87c726b083c0d97c6d6
4
- data.tar.gz: e45c97fe12819f7ab1abe17d9d0166379fa61a30
3
+ metadata.gz: aa39c02ee12d025fbd0f43f6bcd38928a466e1e1
4
+ data.tar.gz: 9dd5cce8c4f0b1ccdd5d9772c4c17f46f135746b
5
5
  SHA512:
6
- metadata.gz: fccff09f4fe9c5ddeaf5d41a8e8fe4e284c9f1af137a11578ba08f6eafc336a6b13e27c4b3bf54665e6d6933c6c3e4f328db1b574e514a49764d188a223a64d7
7
- data.tar.gz: ee4387876d87956bb39127f2fad009f42fc7c1078e50b409a1fa3f4c88a2e91c1ebf4b267b56acdaa711faceff03e6f8d402ceb3beeb56462247f63bbf8a1c6e
6
+ metadata.gz: c9c71a4a6718bd7dc334c2f617c780436afd2bf912e5968afcc739bb0495bd2000591b179765f1dcd9bc569be6b5f5002489570b6949e3ebebb134803c1049bc
7
+ data.tar.gz: 0dec8374eec63d4b4c4db435b9b7f4111935d091e572b9e901f796ffbe46a99a9e611c24f276541c2c635cd48481c9b3d2e492de18241df7eac61291d298f01a
data/Readme.md CHANGED
@@ -2,9 +2,7 @@
2
2
  [![Code Climate](https://codeclimate.com/github/voltrb/volt.png)](https://codeclimate.com/github/voltrb/volt)
3
3
  [![Build Status](https://travis-ci.org/voltrb/volt.png?branch=master)](https://travis-ci.org/voltrb/volt)
4
4
  [![Volt Chat](https://badges.gitter.im/voltrb/volt.png)](https://gitter.im/voltrb/volt)
5
- [![Pledgie](https://pledgie.com/campaigns/26731.png?skin_name=chrome)](https://pledgie.com/campaigns/26731)
6
5
 
7
- =======
8
6
  ** For the current status of volt, read: http://voltframework.com/blog
9
7
 
10
8
  # Volt
@@ -64,11 +62,11 @@ Then create a new project:
64
62
 
65
63
  This will setup a basic project. Now let's run the server:
66
64
 
67
- volt server
65
+ bundle exec volt server
68
66
 
69
67
  You can access the Volt console with:
70
68
 
71
- volt console
69
+ bundle exec volt console
72
70
 
73
71
  # Guide Sections
74
72
 
@@ -838,3 +836,5 @@ store._things
838
836
  # Contributing
839
837
 
840
838
  You want to contribute? Great! Thanks for being awesome! At the moment, we have a big internal todo list, hop on https://gitter.im/voltrb/volt so we don't duplicate work. Pull requests are always welcome, but asking about helping on gitter should save some duplication.
839
+
840
+ [![Pledgie](https://pledgie.com/campaigns/26731.png?skin_name=chrome)](https://pledgie.com/campaigns/26731)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.19
1
+ 0.7.20
@@ -26,7 +26,7 @@ class DomTemplate
26
26
 
27
27
  # Returns the dom nodes and bindings
28
28
  def make_new
29
- bindings = update_binding_anchors!
29
+ bindings = update_binding_anchors!(`self.nodes`)
30
30
 
31
31
  new_nodes = `self.nodes.cloneNode(true)`
32
32
 
@@ -60,7 +60,7 @@ class DomTemplate
60
60
 
61
61
  # Takes the binding_anchors and updates them with new numbers (comments and id's)
62
62
  # then returns the bindings updated to the new numbers.
63
- def update_binding_anchors!
63
+ def update_binding_anchors!(nodes)
64
64
  new_bindings = {}
65
65
 
66
66
  @binding_anchors.each_pair do |name, anchors|
@@ -90,6 +90,11 @@ class DomTemplate
90
90
  end_comment.textContent = " $/" + new_name + " ";
91
91
  }
92
92
 
93
+ # %x{
94
+ # start_comment.innerText = " $" + new_name + " ";
95
+ # end_comment.innerText = " $/" + new_name + " ";
96
+ # }
97
+
93
98
  new_bindings[new_name] = @bindings[name]
94
99
  end
95
100
  end
@@ -15,7 +15,7 @@ class ComponentHandler
15
15
 
16
16
  javascript_code = compile_for_component(component_name)
17
17
 
18
- return [200, {"Content-Type" => "text/html; charset=utf-8"}, StringIO.new(javascript_code)]
18
+ return [200, {"Content-Type" => "application/javascript; charset=utf-8"}, StringIO.new(javascript_code)]
19
19
  end
20
20
 
21
21
  def compile_for_component(component_name)
@@ -55,7 +55,8 @@ class ComponentPaths
55
55
  app_folders do |app_folder|
56
56
  $LOAD_PATH.unshift(app_folder)
57
57
 
58
- Dir["#{app_folder}/*/{controllers,models}/*.rb"].each do |ruby_file|
58
+ # Sort so we get consistent load order across platforms
59
+ Dir["#{app_folder}/*/{controllers,models}/*.rb"].sort.each do |ruby_file|
59
60
  path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4]
60
61
  require(path)
61
62
  end
@@ -63,8 +64,8 @@ class ComponentPaths
63
64
  end
64
65
 
65
66
  # add each tasks folder directly
66
- components.each do |name,component_folders|
67
- component_folders.each do |component_folder|
67
+ components.sort.each do |name,component_folders|
68
+ component_folders.sort.each do |component_folder|
68
69
  Dir["#{component_folder}/tasks"].sort.each do |tasks_folder|
69
70
  $LOAD_PATH.unshift(tasks_folder)
70
71
  end
@@ -0,0 +1,2 @@
1
+ <:Body>
2
+ <h2>Index Template</h2>
@@ -3,3 +3,7 @@
3
3
 
4
4
  <:Body>
5
5
  <h1>Home</h1>
6
+
7
+ {#template "index"}
8
+
9
+ <p>After template</p>
@@ -2,14 +2,14 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <% javascript_files.each do |javascript_file| %>
6
- <script src="<%= javascript_file %>"></script>
7
- <% end %>
8
-
9
- <% css_files.each do |css_file| %>
10
- <link href="<%= css_file %>" media="all" rel="stylesheet" type="text/css" />
11
- <% end %>
5
+ <% javascript_files.each do |javascript_file| %>
6
+ <script src="<%= javascript_file %>"></script>
7
+ <% end %>
12
8
 
9
+ <% css_files.each do |css_file| %>
10
+ <link href="<%= css_file %>" media="all" rel="stylesheet" type="text/css" />
11
+ <% end %>
12
+
13
13
  </head>
14
14
  <body>
15
15
 
@@ -1,11 +1,14 @@
1
- if ENV['IN_BROWSER']
1
+ if ENV['BROWSER'] && ENV['BROWSER'] == 'firefox'
2
2
  require 'spec_helper'
3
3
 
4
4
  describe "integration test", :type => :feature do
5
- it "should load the page" do
5
+ it "should load the page" do
6
6
  visit '/'
7
7
 
8
8
  expect(page).to have_content('Home')
9
+ # expect(page).to have_content('About')
10
+ # page.has_text?('About')
11
+ # puts "HAS CONTENT: #{page.has_text?('About')}"
9
12
  end
10
13
  end
11
14
  end
@@ -11,7 +11,7 @@ end
11
11
  describe TemplateBinding do
12
12
  before do
13
13
  @page = double('page')
14
- expect(@page).to receive(:templates).at_least(1).times.and_return { @templates }
14
+ expect(@page).to receive(:templates).at_least(1).times { @templates }
15
15
 
16
16
  # TODO: We should decouple things so we don't need to allocate
17
17
  @template_binding = TemplateBinding.allocate
@@ -0,0 +1,10 @@
1
+
2
+ if ENV['BROWSER'] && ENV['BROWSER'] == 'poltergeist'
3
+ describe 'Rack Requests', type: :feature do
4
+ it "should send JS file with JS mimetype" do
5
+ visit '/components/main.js'
6
+
7
+ expect( page.response_headers[ 'Content-Type' ]).to include 'application/javascript'
8
+ end
9
+ end
10
+ end
data/spec/spec_helper.rb CHANGED
@@ -5,59 +5,53 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
 
8
- ENV['SERVER'] = 'true'
9
- ENV['SAUCE_USERNAME'] = 'ryanstout'
10
- ENV['SAUCE_ACCESS_KEY'] = 'a537b01d-33ed-4028-9e80-eeb602748a5f'
11
-
12
- if ENV['IN_BROWSER']
8
+ if ENV['BROWSER']
13
9
  if RUBY_PLATFORM == 'opal'
14
10
  else
11
+ require 'capybara'
12
+ require 'capybara/dsl'
15
13
  require 'capybara/rspec'
16
14
  # Needed at the moment to get chrome tests working
17
- require 'chromedriver2/helper'
18
15
  require 'capybara/poltergeist'
19
- # require "sauce/capybara"
20
- # require 'sauce/connect'
21
16
  end
22
17
  end
23
18
 
24
19
  require 'volt'
25
20
 
26
- # Capybara.default_driver = :sauce
27
- # Capybara.server_port = 2020
28
- #
29
- # Sauce.config do |conf|
30
- # conf[:start_tunnel] = true
31
- # conf[:browsers] = [
32
- # ["Windows 7","Firefox","26"]
33
- # ]
34
- # # conf[:application_host] = "127.0.0.1"
35
- # # conf[:application_port] = "2020"
36
- # # conf[:browser_url] = "http://127.0.0.1:2020/"
37
- # end
38
-
39
- # Capybara.register_driver :selenium do |app|
40
- # Capybara::Selenium::Driver.new(app, :browser => :chrome)
41
- # end
42
-
43
- if ENV['IN_BROWSER']
21
+ if ENV['BROWSER']
44
22
  if RUBY_PLATFORM == 'opal'
45
23
  else
24
+
46
25
  require 'volt/server'
47
26
 
27
+ Capybara.server do |app, port|
28
+ require 'rack/handler/thin'
29
+ Rack::Handler::Thin.run(app, :Port => port)
30
+ end
48
31
 
49
32
  kitchen_sink_path = File.expand_path(File.join(File.dirname(__FILE__), "apps/kitchen_sink"))
50
33
  Capybara.app = Server.new(kitchen_sink_path).app
51
34
 
52
- Capybara.default_driver = :poltergeist
53
-
54
- # Capybara.register_driver :chrome do |app|
55
- # Capybara::Selenium::Driver.new(app, :browser => :chrome)
56
- # end
57
- #
58
- # Capybara.default_driver = :chrome
35
+ if ENV['BROWSER'] == 'poltergeist'
36
+ Capybara.default_driver = :poltergeist
37
+ elsif ENV['BROWSER'] == 'chrome'
38
+ Capybara.register_driver :chrome do |app|
39
+ Capybara::Selenium::Driver.new(app, :browser => :chrome)
40
+ end
59
41
 
60
- # Capybara.default_driver = :selenium
42
+ Capybara.default_driver = :chrome
43
+ elsif ENV['BROWSER'] == 'firefox'
44
+
45
+ # require 'selenium/webdriver'
46
+ # # require 'selenium/client'
47
+ #
48
+ Capybara.default_driver = :selenium
49
+
50
+ # Capybara.register_driver :selenium_firefox do |app|
51
+ # Capybara::Selenium::Driver.new(app, :browser => :firefox)
52
+ # end
53
+ # Capybara.current_driver = :selenium_firefox
54
+ end
61
55
  end
62
56
  end
63
57
 
data/volt.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "thor", "~> 0.18.0"
23
23
  spec.add_dependency "pry", "~> 0.9.12.0"
24
- spec.add_dependency "rspec", "3.0.0.beta1"
24
+ # spec.add_dependency "rspec", "3.0.0.beta1"
25
25
  spec.add_dependency "rack", "~> 1.5.0"
26
26
  spec.add_dependency "sprockets-sass", "~> 1.0.0"
27
27
  spec.add_dependency "sass", "~> 3.2.5"
@@ -39,14 +39,13 @@ Gem::Specification.new do |spec|
39
39
 
40
40
  # spec.add_dependency "rack-colorized_logger", "~> 1.0.4"
41
41
 
42
-
43
42
  spec.add_development_dependency "bundler", "~> 1.5"
44
- spec.add_development_dependency "guard", "2.0.1" # bug in current guard
45
- spec.add_development_dependency "guard-rspec", "~> 1.2.0"
43
+ spec.add_development_dependency "guard", "2.6.0" # bug in current guard
44
+ spec.add_development_dependency "guard-rspec", "~> 4.3.0"
46
45
  spec.add_development_dependency "opal-rspec", "0.3.0.beta3"
47
46
  spec.add_development_dependency "yard", "~> 0.8.7.0"
48
- spec.add_development_dependency "capybara", "~> 2.2.0"
49
- spec.add_development_dependency "selenium-webdriver", "~> 2.39.0"
47
+ spec.add_development_dependency "capybara", "~> 2.4.2"
48
+ spec.add_development_dependency "selenium-webdriver", "~> 2.43.0"
50
49
  spec.add_development_dependency "chromedriver2-helper", "~> 0.0.8"
51
50
  spec.add_development_dependency "poltergeist", "~> 1.5.0"
52
51
  spec.add_development_dependency "sauce", "~> 3.3.0"
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.7.19
4
+ version: 0.7.20
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-09-20 00:00:00.000000000 Z
11
+ date: 2014-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.12.0
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 3.0.0.beta1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 3.0.0.beta1
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rack
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -212,28 +198,28 @@ dependencies:
212
198
  requirements:
213
199
  - - '='
214
200
  - !ruby/object:Gem::Version
215
- version: 2.0.1
201
+ version: 2.6.0
216
202
  type: :development
217
203
  prerelease: false
218
204
  version_requirements: !ruby/object:Gem::Requirement
219
205
  requirements:
220
206
  - - '='
221
207
  - !ruby/object:Gem::Version
222
- version: 2.0.1
208
+ version: 2.6.0
223
209
  - !ruby/object:Gem::Dependency
224
210
  name: guard-rspec
225
211
  requirement: !ruby/object:Gem::Requirement
226
212
  requirements:
227
213
  - - "~>"
228
214
  - !ruby/object:Gem::Version
229
- version: 1.2.0
215
+ version: 4.3.0
230
216
  type: :development
231
217
  prerelease: false
232
218
  version_requirements: !ruby/object:Gem::Requirement
233
219
  requirements:
234
220
  - - "~>"
235
221
  - !ruby/object:Gem::Version
236
- version: 1.2.0
222
+ version: 4.3.0
237
223
  - !ruby/object:Gem::Dependency
238
224
  name: opal-rspec
239
225
  requirement: !ruby/object:Gem::Requirement
@@ -268,28 +254,28 @@ dependencies:
268
254
  requirements:
269
255
  - - "~>"
270
256
  - !ruby/object:Gem::Version
271
- version: 2.2.0
257
+ version: 2.4.2
272
258
  type: :development
273
259
  prerelease: false
274
260
  version_requirements: !ruby/object:Gem::Requirement
275
261
  requirements:
276
262
  - - "~>"
277
263
  - !ruby/object:Gem::Version
278
- version: 2.2.0
264
+ version: 2.4.2
279
265
  - !ruby/object:Gem::Dependency
280
266
  name: selenium-webdriver
281
267
  requirement: !ruby/object:Gem::Requirement
282
268
  requirements:
283
269
  - - "~>"
284
270
  - !ruby/object:Gem::Version
285
- version: 2.39.0
271
+ version: 2.43.0
286
272
  type: :development
287
273
  prerelease: false
288
274
  version_requirements: !ruby/object:Gem::Requirement
289
275
  requirements:
290
276
  - - "~>"
291
277
  - !ruby/object:Gem::Version
292
- version: 2.39.0
278
+ version: 2.43.0
293
279
  - !ruby/object:Gem::Dependency
294
280
  name: chromedriver2-helper
295
281
  requirement: !ruby/object:Gem::Requirement
@@ -513,6 +499,7 @@ files:
513
499
  - spec/apps/kitchen_sink/Gemfile
514
500
  - spec/apps/kitchen_sink/app/main/config/routes.rb
515
501
  - spec/apps/kitchen_sink/app/main/controllers/main_controller.rb
502
+ - spec/apps/kitchen_sink/app/main/views/main/index.html
516
503
  - spec/apps/kitchen_sink/app/main/views/main/main.html
517
504
  - spec/apps/kitchen_sink/config.ru
518
505
  - spec/apps/kitchen_sink/public/index.html
@@ -543,6 +530,7 @@ files:
543
530
  - spec/server/html_parser/view_parser_spec.rb
544
531
  - spec/server/rack/asset_files_spec.rb
545
532
  - spec/server/rack/component_paths_spec.rb
533
+ - spec/server/rack/rack_requests_spec.rb
546
534
  - spec/spec_helper.rb
547
535
  - spec/store/mongo_spec.rb
548
536
  - spec/tasks/live_query_spec.rb
@@ -627,6 +615,7 @@ test_files:
627
615
  - spec/apps/kitchen_sink/Gemfile
628
616
  - spec/apps/kitchen_sink/app/main/config/routes.rb
629
617
  - spec/apps/kitchen_sink/app/main/controllers/main_controller.rb
618
+ - spec/apps/kitchen_sink/app/main/views/main/index.html
630
619
  - spec/apps/kitchen_sink/app/main/views/main/main.html
631
620
  - spec/apps/kitchen_sink/config.ru
632
621
  - spec/apps/kitchen_sink/public/index.html
@@ -657,6 +646,7 @@ test_files:
657
646
  - spec/server/html_parser/view_parser_spec.rb
658
647
  - spec/server/rack/asset_files_spec.rb
659
648
  - spec/server/rack/component_paths_spec.rb
649
+ - spec/server/rack/rack_requests_spec.rb
660
650
  - spec/spec_helper.rb
661
651
  - spec/store/mongo_spec.rb
662
652
  - spec/tasks/live_query_spec.rb