volt 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/{templates/project/public → app/volt/assets}/js/jquery-2.0.3.js +0 -0
- data/{templates/project/public → app/volt/assets}/js/sockjs-0.2.1.min.js +0 -0
- data/lib/volt.rb +4 -0
- data/lib/volt/server/rack/component_files.rb +18 -11
- data/lib/volt/server/rack/component_paths.rb +1 -1
- data/lib/volt/server/rack/index_files.rb +2 -2
- data/lib/volt/server/rack/opal_files.rb +5 -7
- data/spec/app/bootstrap/assets/js/bootstrap.js +0 -0
- data/spec/app/main/config/dependencies.rb +1 -0
- data/spec/app/slideshow/assets/js/test3.js +0 -0
- data/spec/server/rack/component_files_spec.rb +2 -2
- data/templates/project/app/home/config/dependencies.rb +1 -0
- data/templates/project/public/index.html +0 -2
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7be61678b8ab551460135dfeeaaab5060ed02f47
|
4
|
+
data.tar.gz: cc56d76316db3a18138fcce5f9bae3b7e4d301d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cbbe9373a883d689ac88dfbc2d710a8c8e621de33e9baf90b1513b62c85021c7eda0ea21a8ed037d1d85a58149a64c71e742c681cd4ee5b5f591479ecf6df67
|
7
|
+
data.tar.gz: 9052a27af07b504f5f765d5c9ad2c833efea2acecb60e820518cf9a5532198435be84b3c84cfdf64a750e35077f1ba4b1e026801d51108c58f2937fa70582bbd
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.9
|
File without changes
|
File without changes
|
data/lib/volt.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
require 'volt/server/rack/component_paths'
|
2
|
-
|
3
|
-
SOURCE_MAPS = !!ENV['MAPS'] unless defined?(SOURCE_MAPS)
|
2
|
+
require 'volt'
|
4
3
|
|
5
4
|
# Takes in the path to a component and gets all other components
|
6
5
|
# required from this one
|
7
6
|
class ComponentFiles
|
8
|
-
def initialize(component_name, component_paths)
|
7
|
+
def initialize(component_name, component_paths, main_component=false)
|
9
8
|
@component_name = component_name
|
10
9
|
@component_paths = component_paths
|
11
10
|
@asset_folders = []
|
12
11
|
@components = [component_name]
|
12
|
+
@main_component = main_component
|
13
|
+
|
14
|
+
if @main_component
|
15
|
+
# Add in volt's JS files first
|
16
|
+
component('volt')
|
17
|
+
end
|
13
18
|
|
14
19
|
load_child_components
|
15
20
|
add_asset_folder(component_name)
|
@@ -57,7 +62,6 @@ class ComponentFiles
|
|
57
62
|
if File.exists?(dependencies_file)
|
58
63
|
# Run the dependencies file in this ComponentFiles context
|
59
64
|
code = File.read(dependencies_file)
|
60
|
-
puts "CODE: #{code.inspect}"
|
61
65
|
instance_eval(code)
|
62
66
|
end
|
63
67
|
end
|
@@ -75,16 +79,19 @@ class ComponentFiles
|
|
75
79
|
|
76
80
|
|
77
81
|
def javascript_files
|
78
|
-
|
79
|
-
|
80
|
-
else
|
81
|
-
javascript_files = ['/assets/volt/templates/page.js']
|
82
|
+
javascript_files = asset_folders do |asset_folder|
|
83
|
+
Dir["#{asset_folder}/**/*.js"].map {|path| '/assets' + path[asset_folder.size..-1] }
|
82
84
|
end
|
83
85
|
|
84
|
-
|
85
|
-
|
86
|
-
|
86
|
+
opal_js_files = []
|
87
|
+
if Volt.source_maps?
|
88
|
+
opal_js_files << environment['volt/templates/page'].to_a.map {|v| '/assets/' + v.logical_path + '?body=1' }
|
89
|
+
else
|
90
|
+
opal_js_files << '/assets/volt/templates/page.js'
|
87
91
|
end
|
92
|
+
opal_js_files << '/components/home.js'
|
93
|
+
|
94
|
+
javascript_files.insert(2, *opal_js_files)
|
88
95
|
|
89
96
|
return javascript_files
|
90
97
|
end
|
@@ -23,8 +23,8 @@ class IndexFiles
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def javascript_files
|
26
|
-
# TODO:
|
27
|
-
ComponentFiles.new('home', @component_paths).javascript_files
|
26
|
+
# TODO: Cache somehow, this is being loaded every time
|
27
|
+
ComponentFiles.new('home', @component_paths, true).javascript_files
|
28
28
|
end
|
29
29
|
|
30
30
|
def css_files
|
@@ -1,14 +1,12 @@
|
|
1
1
|
require 'volt/server/rack/source_map_server'
|
2
2
|
|
3
|
-
SOURCE_MAPS = !!ENV['MAPS'] unless defined?(SOURCE_MAPS)
|
4
|
-
|
5
|
-
Opal::Processor.source_map_enabled = SOURCE_MAPS
|
6
|
-
# Opal::Processor.arity_check_enabled = true
|
7
|
-
# Opal::Processor.dynamic_require_severity = :raise
|
8
|
-
|
9
3
|
# Sets up the maps for the opal assets, and source maps if enabled.
|
10
4
|
class OpalFiles
|
11
5
|
def initialize(builder, app_path, component_paths)
|
6
|
+
Opal::Processor.source_map_enabled = Volt.source_maps?
|
7
|
+
# Opal::Processor.arity_check_enabled = true
|
8
|
+
# Opal::Processor.dynamic_require_severity = :raise
|
9
|
+
|
12
10
|
@component_paths = component_paths
|
13
11
|
environment = Opal::Environment.new
|
14
12
|
environment.cache = Sprockets::Cache::FileStore.new("./tmp")
|
@@ -33,7 +31,7 @@ class OpalFiles
|
|
33
31
|
run environment
|
34
32
|
end
|
35
33
|
|
36
|
-
if
|
34
|
+
if Volt.source_maps?
|
37
35
|
source_maps = SourceMapServer.new(environment)
|
38
36
|
|
39
37
|
builder.map(source_maps.prefix) do
|
File without changes
|
File without changes
|
@@ -12,12 +12,12 @@ describe ComponentFiles do
|
|
12
12
|
main = ComponentFiles.new("main", @component_paths)
|
13
13
|
|
14
14
|
components = main.components
|
15
|
-
expect(components).to eq(['main', 'shared', 'bootstrap'])
|
15
|
+
expect(components).to eq(['main', 'shared', 'bootstrap', "slideshow"])
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should list all JS files" do
|
19
19
|
main = ComponentFiles.new("main", @component_paths)
|
20
20
|
|
21
|
-
expect(main.javascript_files).to eq(["/assets/volt/templates/page.js", "/components/home.js", "/assets/js/
|
21
|
+
expect(main.javascript_files).to eq(["/assets/js/test2.js", "/assets/js/bootstrap.js", "/assets/volt/templates/page.js", "/components/home.js", "/assets/js/test3.js", "/assets/js/test1.js"])
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
@@ -265,6 +265,8 @@ files:
|
|
265
265
|
- Rakefile
|
266
266
|
- Readme.md
|
267
267
|
- VERSION
|
268
|
+
- app/volt/assets/js/jquery-2.0.3.js
|
269
|
+
- app/volt/assets/js/sockjs-0.2.1.min.js
|
268
270
|
- bin/volt
|
269
271
|
- docs/GETTING_STARTED.md
|
270
272
|
- docs/GUIDE.md
|
@@ -336,10 +338,12 @@ files:
|
|
336
338
|
- lib/volt/templates/targets/dom_target.rb
|
337
339
|
- lib/volt/templates/template_binding.rb
|
338
340
|
- lib/volt/templates/template_renderer.rb
|
341
|
+
- spec/app/bootstrap/assets/js/bootstrap.js
|
339
342
|
- spec/app/main/assets/js/test1.js
|
340
343
|
- spec/app/main/config/dependencies.rb
|
341
344
|
- spec/app/shared/assets/js/test2.js
|
342
345
|
- spec/app/shared/config/dependencies.rb
|
346
|
+
- spec/app/slideshow/assets/js/test3.js
|
343
347
|
- spec/models/event_chain_spec.rb
|
344
348
|
- spec/models/model_spec.rb
|
345
349
|
- spec/models/old_model_spec.rb
|
@@ -385,8 +389,6 @@ files:
|
|
385
389
|
- templates/project/app/home/views/index/index.html
|
386
390
|
- templates/project/config.ru
|
387
391
|
- templates/project/public/index.html
|
388
|
-
- templates/project/public/js/jquery-2.0.3.js
|
389
|
-
- templates/project/public/js/sockjs-0.2.1.min.js
|
390
392
|
- templates/project/spec/spec_helper.rb
|
391
393
|
- volt.gemspec
|
392
394
|
homepage: http://voltframework.com
|
@@ -415,10 +417,12 @@ specification_version: 4
|
|
415
417
|
summary: A ruby web framework where your ruby runs on both server and client (via
|
416
418
|
Opal)
|
417
419
|
test_files:
|
420
|
+
- spec/app/bootstrap/assets/js/bootstrap.js
|
418
421
|
- spec/app/main/assets/js/test1.js
|
419
422
|
- spec/app/main/config/dependencies.rb
|
420
423
|
- spec/app/shared/assets/js/test2.js
|
421
424
|
- spec/app/shared/config/dependencies.rb
|
425
|
+
- spec/app/slideshow/assets/js/test3.js
|
422
426
|
- spec/models/event_chain_spec.rb
|
423
427
|
- spec/models/model_spec.rb
|
424
428
|
- spec/models/old_model_spec.rb
|