volt 0.9.3.pre1 → 0.9.3.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +15 -1
- data/Gemfile +30 -3
- data/README.md +7 -2
- data/Rakefile +17 -0
- data/app/volt/models/user.rb +1 -1
- data/app/volt/tasks/live_query/live_query.rb +0 -1
- data/app/volt/tasks/live_query/live_query_pool.rb +8 -2
- data/app/volt/tasks/live_query/query_tracker.rb +2 -2
- data/app/volt/tasks/query_tasks.rb +10 -27
- data/app/volt/tasks/store_tasks.rb +6 -5
- data/app/volt/tasks/user_tasks.rb +2 -2
- data/docs/UPGRADE_GUIDE.md +14 -0
- data/lib/volt/boot.rb +1 -0
- data/lib/volt/cli/asset_compile.rb +25 -7
- data/lib/volt/cli/console.rb +6 -5
- data/lib/volt/cli/generate.rb +2 -2
- data/lib/volt/config.rb +2 -1
- data/lib/volt/controllers/http_controller.rb +4 -3
- data/lib/volt/controllers/model_controller.rb +41 -19
- data/lib/volt/controllers/template_helpers.rb +19 -0
- data/lib/volt/extra_core/array.rb +6 -0
- data/lib/volt/extra_core/hash.rb +8 -26
- data/lib/volt/extra_core/string.rb +1 -1
- data/lib/volt/models/array_model.rb +12 -4
- data/lib/volt/models/associations.rb +11 -13
- data/lib/volt/models/buffer.rb +1 -1
- data/lib/volt/models/model.rb +22 -13
- data/lib/volt/models/model_helpers/model_change_helpers.rb +0 -1
- data/lib/volt/models/model_helpers/model_helpers.rb +11 -0
- data/lib/volt/models/permissions.rb +9 -12
- data/lib/volt/models/persistors/array_store.rb +7 -7
- data/lib/volt/models/persistors/base.rb +9 -0
- data/lib/volt/models/persistors/cookies.rb +0 -4
- data/lib/volt/models/persistors/flash.rb +0 -4
- data/lib/volt/models/persistors/local_store.rb +0 -4
- data/lib/volt/models/persistors/model_store.rb +13 -21
- data/lib/volt/models/persistors/page.rb +22 -0
- data/lib/volt/models/persistors/params.rb +0 -4
- data/lib/volt/models/persistors/query/query_listener.rb +3 -2
- data/lib/volt/models/url.rb +2 -2
- data/lib/volt/models/validators/unique_validator.rb +1 -1
- data/lib/volt/models.rb +1 -0
- data/lib/volt/page/bindings/attribute_binding.rb +2 -2
- data/lib/volt/page/bindings/base_binding.rb +7 -3
- data/lib/volt/page/bindings/bindings.rb +9 -0
- data/lib/volt/page/bindings/content_binding.rb +2 -2
- data/lib/volt/page/bindings/each_binding.rb +16 -12
- data/lib/volt/page/bindings/event_binding.rb +4 -4
- data/lib/volt/page/bindings/if_binding.rb +3 -3
- data/lib/volt/page/bindings/view_binding.rb +4 -4
- data/lib/volt/page/bindings/yield_binding.rb +3 -3
- data/lib/volt/page/channel.rb +6 -0
- data/lib/volt/page/channel_stub.rb +1 -1
- data/lib/volt/page/page.rb +20 -54
- data/lib/volt/page/path_string_renderer.rb +5 -6
- data/lib/volt/page/string_template_renderer.rb +2 -2
- data/lib/volt/page/targets/attribute_section.rb +47 -0
- data/lib/volt/page/targets/base_section.rb +5 -5
- data/lib/volt/page/targets/binding_document/component_node.rb +6 -1
- data/lib/volt/page/template_renderer.rb +4 -4
- data/lib/volt/reactive/computation.rb +32 -3
- data/lib/volt/router/routes.rb +5 -5
- data/lib/volt/server/component_templates.rb +30 -2
- data/lib/volt/server/forking_server.rb +2 -2
- data/lib/volt/server/message_bus/base_message_bus.rb +52 -0
- data/lib/volt/server/message_bus/message_encoder.rb +64 -0
- data/lib/volt/server/message_bus/peer_to_peer/peer_connection.rb +186 -0
- data/lib/volt/server/message_bus/peer_to_peer/peer_server.rb +78 -0
- data/lib/volt/server/message_bus/peer_to_peer/server_tracker.rb +57 -0
- data/lib/volt/server/message_bus/peer_to_peer/socket_with_timeout.rb +27 -0
- data/lib/volt/server/message_bus/peer_to_peer.rb +198 -0
- data/lib/volt/server/message_bus/redis.rb +1 -0
- data/lib/volt/server/rack/asset_files.rb +2 -2
- data/lib/volt/server/rack/component_paths.rb +1 -1
- data/lib/volt/server/rack/http_resource.rb +3 -2
- data/lib/volt/server/rack/opal_files.rb +6 -9
- data/lib/volt/server/websocket/websocket_handler.rb +0 -3
- data/lib/volt/server.rb +5 -3
- data/lib/volt/spec/setup.rb +11 -12
- data/lib/volt/tasks/dispatcher.rb +8 -12
- data/lib/volt/tasks/task_handler.rb +3 -2
- data/lib/volt/utils/csso_patch.rb +24 -0
- data/lib/volt/utils/promise_patch.rb +2 -0
- data/lib/volt/version.rb +1 -1
- data/lib/volt/volt/app.rb +73 -36
- data/lib/volt/volt/server_setup/app.rb +81 -0
- data/lib/volt.rb +22 -1
- data/spec/apps/kitchen_sink/Gemfile +1 -1
- data/spec/controllers/http_controller_spec.rb +5 -3
- data/spec/controllers/model_controller_spec.rb +2 -2
- data/spec/extra_core/hash_spec.rb +9 -0
- data/spec/integration/list_spec.rb +3 -3
- data/spec/models/associations_spec.rb +10 -2
- data/spec/models/dirty_spec.rb +7 -7
- data/spec/models/model_spec.rb +10 -2
- data/spec/models/permissions_spec.rb +9 -0
- data/spec/models/persistors/store_spec.rb +8 -0
- data/spec/page/bindings/content_binding_spec.rb +6 -2
- data/spec/page/bindings/each_binding_spec.rb +59 -0
- data/spec/page/bindings/if_binding_spec.rb +57 -0
- data/spec/page/path_string_renderer_spec.rb +5 -5
- data/spec/reactive/computation_spec.rb +65 -1
- data/spec/router/routes_spec.rb +1 -1
- data/spec/server/html_parser/sandlebars_parser_spec.rb +12 -22
- data/spec/server/message_bus/message_encoder_spec.rb +49 -0
- data/spec/server/message_bus/peer_to_peer/peer_connection_spec.rb +108 -0
- data/spec/server/message_bus/peer_to_peer/peer_server_spec.rb +66 -0
- data/spec/server/message_bus/peer_to_peer/socket_with_timeout_spec.rb +11 -0
- data/spec/server/message_bus/peer_to_peer_spec.rb +11 -0
- data/spec/server/rack/asset_files_spec.rb +1 -1
- data/spec/server/rack/http_resource_spec.rb +4 -4
- data/spec/spec_helper.rb +16 -3
- data/spec/tasks/dispatcher_spec.rb +17 -5
- data/spec/tasks/live_query_spec.rb +1 -1
- data/spec/tasks/query_tracker_spec.rb +34 -34
- data/spec/tasks/user_tasks_spec.rb +4 -2
- data/templates/project/Gemfile.tt +14 -3
- data/templates/project/config/app.rb.tt +27 -2
- data/volt.gemspec +3 -8
- metadata +32 -101
- data/docs/FAQ.md +0 -7
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
require 'volt/spec/setup'
|
3
3
|
|
4
4
|
unless RUBY_PLATFORM == 'opal'
|
5
|
-
|
5
|
+
begin
|
6
|
+
require 'pry-byebug'
|
7
|
+
rescue LoadError => e
|
8
|
+
# Ignore if not installed
|
9
|
+
end
|
6
10
|
require 'coveralls'
|
7
11
|
Coveralls.wear!
|
8
12
|
|
@@ -13,7 +17,16 @@ unless RUBY_PLATFORM == 'opal'
|
|
13
17
|
|
14
18
|
SimpleCov.start do
|
15
19
|
add_filter 'spec/'
|
16
|
-
|
20
|
+
|
21
|
+
# all Opal / Front end stuff.
|
22
|
+
add_filter 'lib/volt/page/bindings'
|
23
|
+
add_filter 'lib/volt/page/document_events'
|
24
|
+
add_filter 'lib/volt/page/targets/dom_template'
|
25
|
+
add_filter 'lib/volt/utils/local_storage'
|
26
|
+
add_filter 'lib/volt/benchmark'
|
27
|
+
|
28
|
+
# Copied in from concurrent-ruby, waiting for gem release
|
29
|
+
add_filter 'lib/volt/utils/read_write_lock.rb'
|
17
30
|
end
|
18
31
|
end
|
19
32
|
|
@@ -31,7 +44,7 @@ unless RUBY_PLATFORM == 'opal'
|
|
31
44
|
# the seed, which is printed after each run.
|
32
45
|
# --seed 1234
|
33
46
|
config.order = 'random'
|
34
|
-
|
47
|
+
config.seed = '45091'
|
35
48
|
end
|
36
49
|
|
37
50
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
1
3
|
if RUBY_PLATFORM != 'opal'
|
2
4
|
class TestTask < Volt::Task
|
3
5
|
def allowed_method(arg1, arg2)
|
@@ -10,6 +12,8 @@ if RUBY_PLATFORM != 'opal'
|
|
10
12
|
Volt.logger = spy('Volt::VoltLogger')
|
11
13
|
end
|
12
14
|
|
15
|
+
let(:dispatcher) { Volt::Dispatcher.new(Volt.current_app) }
|
16
|
+
|
13
17
|
after do
|
14
18
|
# Cleanup, make volt make a new logger. Otherwise this will leak out.
|
15
19
|
Volt.logger = nil
|
@@ -20,7 +24,7 @@ if RUBY_PLATFORM != 'opal'
|
|
20
24
|
|
21
25
|
expect(channel).to receive(:send_message).with('response', 0, 'yes it works', nil)
|
22
26
|
|
23
|
-
|
27
|
+
dispatcher.dispatch(channel, [0, 'TestTask', :allowed_method, {}, ' it', ' works'])
|
24
28
|
end
|
25
29
|
|
26
30
|
it 'should not allow eval' do
|
@@ -28,7 +32,7 @@ if RUBY_PLATFORM != 'opal'
|
|
28
32
|
|
29
33
|
expect(channel).to receive(:send_message).with('response', 0, nil, RuntimeError.new('unsafe method: eval'))
|
30
34
|
|
31
|
-
|
35
|
+
dispatcher.dispatch(channel, [0, 'TestTask', :eval, '5 + 10'])
|
32
36
|
end
|
33
37
|
|
34
38
|
it 'should not allow instance_eval' do
|
@@ -36,7 +40,7 @@ if RUBY_PLATFORM != 'opal'
|
|
36
40
|
|
37
41
|
expect(channel).to receive(:send_message).with('response', 0, nil, RuntimeError.new('unsafe method: instance_eval'))
|
38
42
|
|
39
|
-
|
43
|
+
dispatcher.dispatch(channel, [0, 'TestTask', :instance_eval, '5 + 10'])
|
40
44
|
end
|
41
45
|
|
42
46
|
it 'should not allow #methods' do
|
@@ -44,7 +48,7 @@ if RUBY_PLATFORM != 'opal'
|
|
44
48
|
|
45
49
|
expect(channel).to receive(:send_message).with('response', 0, nil, RuntimeError.new('unsafe method: methods'))
|
46
50
|
|
47
|
-
|
51
|
+
dispatcher.dispatch(channel, [0, 'TestTask', :methods])
|
48
52
|
end
|
49
53
|
|
50
54
|
it 'should log an info message before and after the dispatch' do
|
@@ -53,7 +57,15 @@ if RUBY_PLATFORM != 'opal'
|
|
53
57
|
allow(channel).to receive(:send_message).with('response', 0, 'yes it works', nil)
|
54
58
|
expect(Volt.logger).to receive(:log_dispatch)
|
55
59
|
|
56
|
-
|
60
|
+
dispatcher.dispatch(channel, [0, 'TestTask', :allowed_method, {}, ' it', ' works'])
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'closes the channel' do
|
64
|
+
disp = dispatcher
|
65
|
+
channel = Volt::ChannelStub.new
|
66
|
+
# This doesn't do much except find typos, which is the only reason
|
67
|
+
# I haven't deleted it. Work in progress -@RickCarlino
|
68
|
+
this_spec_needs_improvement = disp.close_channel(channel)
|
57
69
|
end
|
58
70
|
end
|
59
71
|
end
|
@@ -9,7 +9,7 @@ if RUBY_PLATFORM != 'opal'
|
|
9
9
|
data_store = double('volt/data store')
|
10
10
|
|
11
11
|
expect(data_store).to receive(:query).with('_items', {}).and_return([
|
12
|
-
{ '
|
12
|
+
{ 'id' => 0, '_name' => 'one' }
|
13
13
|
])
|
14
14
|
|
15
15
|
live_query = LiveQuery.new(pool, data_store, '_items', {})
|
@@ -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[
|
21
|
+
@items.reject! { |item| ids.include?(item[:id]) }
|
22
22
|
end
|
23
23
|
|
24
24
|
def notify_added(index, data, skip_channel)
|
@@ -26,14 +26,14 @@ if RUBY_PLATFORM != 'opal'
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def notify_moved(id, index, skip_channel)
|
29
|
-
item = @items.find { |item| item[
|
29
|
+
item = @items.find { |item| item[:id] == id }
|
30
30
|
@items.delete(item)
|
31
31
|
|
32
32
|
@items.insert(index, item)
|
33
33
|
end
|
34
34
|
|
35
35
|
def notify_changed(id, data, skip_channel)
|
36
|
-
item = @items.find { |item| item[
|
36
|
+
item = @items.find { |item| item[:id] == id }
|
37
37
|
idx = @items.index(item)
|
38
38
|
@items.delete(item)
|
39
39
|
@items.insert(idx, data)
|
@@ -55,7 +55,7 @@ if RUBY_PLATFORM != 'opal'
|
|
55
55
|
|
56
56
|
it 'should add items' do
|
57
57
|
@items = [
|
58
|
-
{
|
58
|
+
{ id: 1, name: 'one' }
|
59
59
|
]
|
60
60
|
|
61
61
|
expect(@live_query.items).to eq([])
|
@@ -67,14 +67,14 @@ if RUBY_PLATFORM != 'opal'
|
|
67
67
|
|
68
68
|
it 'should remove items' do
|
69
69
|
@items = [
|
70
|
-
{
|
71
|
-
{
|
70
|
+
{ id: 1, name: 'one' },
|
71
|
+
{ id: 2, name: 'two' }
|
72
72
|
]
|
73
73
|
@query_tracker.run
|
74
74
|
expect(@live_query.items).to eq(@items)
|
75
75
|
|
76
76
|
@items = [
|
77
|
-
{
|
77
|
+
{ id: 2, name: 'two' }
|
78
78
|
]
|
79
79
|
@query_tracker.run
|
80
80
|
expect(@live_query.items).to eq(@items)
|
@@ -82,17 +82,17 @@ if RUBY_PLATFORM != 'opal'
|
|
82
82
|
|
83
83
|
it 'should move items' do
|
84
84
|
@items = [
|
85
|
-
{
|
86
|
-
{
|
87
|
-
{
|
85
|
+
{ id: 1, name: 'one' },
|
86
|
+
{ id: 2, name: 'two' },
|
87
|
+
{ id: 3, name: 'three' }
|
88
88
|
]
|
89
89
|
@query_tracker.run
|
90
90
|
expect(@live_query.items).to eq(@items)
|
91
91
|
|
92
92
|
@items = [
|
93
|
-
{
|
94
|
-
{
|
95
|
-
{
|
93
|
+
{ id: 2, name: 'two' },
|
94
|
+
{ id: 3, name: 'three' },
|
95
|
+
{ id: 1, name: 'one' }
|
96
96
|
]
|
97
97
|
@query_tracker.run
|
98
98
|
expect(@live_query.items).to eq(@items)
|
@@ -100,22 +100,22 @@ if RUBY_PLATFORM != 'opal'
|
|
100
100
|
|
101
101
|
it 'should handle complex transforms' do
|
102
102
|
@items = [
|
103
|
-
{
|
104
|
-
{
|
105
|
-
{
|
106
|
-
{
|
107
|
-
{
|
103
|
+
{ id: 1, name: 'one' },
|
104
|
+
{ id: 2, name: 'two' },
|
105
|
+
{ id: 3, name: 'three' },
|
106
|
+
{ id: 4, name: 'four' },
|
107
|
+
{ id: 5, name: 'five' }
|
108
108
|
]
|
109
109
|
@query_tracker.run
|
110
110
|
expect(@live_query.items).to eq(@items)
|
111
111
|
|
112
112
|
@items = [
|
113
|
-
{
|
114
|
-
{
|
115
|
-
{
|
116
|
-
{
|
117
|
-
{
|
118
|
-
{
|
113
|
+
{ id: 7, name: 'seven' },
|
114
|
+
{ id: 4, name: 'four' },
|
115
|
+
{ id: 1, name: 'one' },
|
116
|
+
{ id: 5, name: 'five' },
|
117
|
+
{ id: 3, name: 'three' },
|
118
|
+
{ id: 6, name: 'five' }
|
119
119
|
]
|
120
120
|
@query_tracker.run
|
121
121
|
expect(@live_query.items).to eq(@items)
|
@@ -123,19 +123,19 @@ if RUBY_PLATFORM != 'opal'
|
|
123
123
|
|
124
124
|
it 'should notify data hash has changed' do
|
125
125
|
@items = [
|
126
|
-
{
|
127
|
-
{
|
128
|
-
{
|
129
|
-
{
|
130
|
-
{
|
126
|
+
{ id: 1, name: 'one' },
|
127
|
+
{ id: 2, name: 'two' },
|
128
|
+
{ id: 3, name: 'three' },
|
129
|
+
{ id: 4, name: 'four' },
|
130
|
+
{ id: 5, name: 'five' }
|
131
131
|
]
|
132
132
|
@query_tracker.run
|
133
133
|
@items = [
|
134
|
-
{
|
135
|
-
{
|
136
|
-
{
|
137
|
-
{
|
138
|
-
{
|
134
|
+
{ id: 1, name: 'some' },
|
135
|
+
{ id: 2, name: 'values' },
|
136
|
+
{ id: 3, name: 'have' },
|
137
|
+
{ id: 4, name: 'changed' },
|
138
|
+
{ id: 5, name: 'other' }
|
139
139
|
]
|
140
140
|
expect(@live_query.items).to_not eq(@items)
|
141
141
|
@query_tracker.run
|
@@ -18,6 +18,8 @@ if RUBY_PLATFORM != 'opal'
|
|
18
18
|
allow(fake_response).to receive(:fetch_first).and_yield(user)
|
19
19
|
end
|
20
20
|
|
21
|
+
subject { UserTasks.new(Volt.current_app) }
|
22
|
+
|
21
23
|
describe '#login' do
|
22
24
|
context 'with no matching user' do
|
23
25
|
let(:user) { false }
|
@@ -30,7 +32,7 @@ if RUBY_PLATFORM != 'opal'
|
|
30
32
|
|
31
33
|
context 'with a matching user' do
|
32
34
|
let(:password) { BCrypt::Password.create(login_info['password']) }
|
33
|
-
let(:user) { double('User',
|
35
|
+
let(:user) { double('User', id: 1, _hashed_password: password) }
|
34
36
|
|
35
37
|
it 'fails on bad password' do
|
36
38
|
expect { subject.login(login_info.merge 'password' => 'Not McFly') }.
|
@@ -50,7 +52,7 @@ if RUBY_PLATFORM != 'opal'
|
|
50
52
|
subject.login(login_info)
|
51
53
|
|
52
54
|
expect(Digest::SHA256).to have_received(:hexdigest).with(
|
53
|
-
"#{Volt.config.app_secret}::#{user.
|
55
|
+
"#{Volt.config.app_secret}::#{user.id}"
|
54
56
|
)
|
55
57
|
end
|
56
58
|
end
|
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
|
|
3
3
|
gem 'volt', '<%= config[:version] %>'
|
4
4
|
|
5
5
|
# volt uses mongo as the default data store.
|
6
|
-
gem 'volt-mongo', '~> 0.0.
|
6
|
+
gem 'volt-mongo', '~> 0.0.2'
|
7
7
|
|
8
8
|
# The following gem's are optional for themeing
|
9
9
|
# Twitter bootstrap
|
@@ -13,10 +13,19 @@ gem 'volt-bootstrap', '~> 0.0.10'
|
|
13
13
|
gem 'volt-bootstrap_jumbotron_theme', '~> 0.1.0'
|
14
14
|
|
15
15
|
# User templates for login, signup, and logout menu.
|
16
|
-
gem 'volt-user_templates', '~> 0.
|
16
|
+
gem 'volt-user_templates', '~> 0.3.0'
|
17
17
|
|
18
18
|
# Add ability to send e-mail from apps.
|
19
|
-
gem 'volt-mailer', '~> 0.0
|
19
|
+
gem 'volt-mailer', '~> 0.1.0'
|
20
|
+
|
21
|
+
# Use rbnacl for message bus encrpytion
|
22
|
+
# (optional, if you don't need encryption, disable in app.rb and remove)
|
23
|
+
gem 'rbnacl', require: false
|
24
|
+
gem 'rbnacl-libsodium', require: false
|
25
|
+
|
26
|
+
# Asset compilation gems, they will be required when needed.
|
27
|
+
gem 'csso-rails', '~> 0.3.4', require: false
|
28
|
+
gem 'uglifier', '>= 2.4.0', require: false
|
20
29
|
|
21
30
|
group :test do
|
22
31
|
# Testing dependencies
|
@@ -32,6 +41,8 @@ end
|
|
32
41
|
platform :mri do
|
33
42
|
# The implementation of ReadWriteLock in Volt uses concurrent ruby and ext helps performance.
|
34
43
|
gem 'concurrent-ruby-ext', '~> 0.8.0'
|
44
|
+
|
45
|
+
# Thin is the default volt server, you Puma is also supported
|
35
46
|
gem 'thin', '~> 1.6.0'
|
36
47
|
gem 'bson_ext', '~> 1.9.0'
|
37
48
|
end
|
@@ -84,6 +84,31 @@ Volt.configure do |config|
|
|
84
84
|
# :domain => "localhost.localdomain" # the HELO domain provided by the client to the server
|
85
85
|
# }
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
#############
|
88
|
+
# Message Bus
|
89
|
+
#############
|
90
|
+
# Volt provides a "Message Bus" out of the box. The message bus provides
|
91
|
+
# a pub/sub service between any volt instance (server, client, runner, etc..)
|
92
|
+
# that share the same database. The message bus can be used by app code. It
|
93
|
+
# is also used internally to push data to any listening clients.
|
94
|
+
#
|
95
|
+
# The default message bus (called "peer_to_peer") uses the database to sync
|
96
|
+
# socket ip's/ports.
|
97
|
+
# config.message_bus.bus_name = 'peer_to_peer'
|
98
|
+
#
|
99
|
+
# Encrypt message bus - messages on the message bus are encrypted by default
|
100
|
+
# using rbnacl.
|
101
|
+
# config.message_bus.disable_encryption = true
|
102
|
+
#
|
103
|
+
# ## MessageBus Server -- the message bus binds to a port and ip which the
|
104
|
+
# other volt instances need to be able to connect to. You can customize
|
105
|
+
# the server below:
|
106
|
+
#
|
107
|
+
# Port range - you can specify a range of ports that an instance can bind the
|
108
|
+
# message bus on. You can specify a range, an array of Integers, or an array
|
109
|
+
# of ranges.
|
110
|
+
# config.message_bus.bind_port_ranges = (58000..61000)
|
111
|
+
#
|
112
|
+
# Bind Ip - specifies the ip address the message bus server should bind on.
|
113
|
+
# config.message_bus.bind_ip = '127.0.0.1'
|
89
114
|
end
|
data/volt.gemspec
CHANGED
@@ -25,9 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'sprockets-sass', '~> 1.0.0'
|
26
26
|
spec.add_dependency 'sass', '~> 3.2.5'
|
27
27
|
spec.add_dependency 'listen', '~> 2.8.0'
|
28
|
-
spec.add_dependency 'uglifier', '>= 2.4.0'
|
29
28
|
spec.add_dependency 'configurations', '~> 2.0.0.pre'
|
30
|
-
spec.add_dependency 'ruby-clean-css', '~> 1.0.0'
|
31
29
|
spec.add_dependency 'opal', '~> 0.7.2'
|
32
30
|
spec.add_dependency 'bundler', '>= 1.5'
|
33
31
|
spec.add_dependency 'faye-websocket', '~> 0.9.2'
|
@@ -55,12 +53,9 @@ Gem::Specification.new do |spec|
|
|
55
53
|
|
56
54
|
# Yard and formatting
|
57
55
|
spec.add_development_dependency 'yard', '~> 0.8.7.0'
|
58
|
-
spec.add_development_dependency 'redcarpet', '~> 3.2.2'
|
59
|
-
spec.add_development_dependency 'github-markup', '~> 1.3.1'
|
60
|
-
|
61
|
-
spec.add_development_dependency 'sauce', '~> 3.5.3'
|
62
|
-
spec.add_development_dependency 'sauce-connect', '~> 3.5.0'
|
63
|
-
spec.add_development_dependency 'pry-byebug', '~> 2.0.0'
|
64
56
|
|
65
57
|
spec.add_development_dependency 'rubocop', '~> 0.31.0'
|
58
|
+
|
59
|
+
# NOTE: Some development dependencies are specified in the Gemfile because
|
60
|
+
# bundler has platform support.
|
66
61
|
end
|
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.9.3.
|
4
|
+
version: 0.9.3.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 2.8.0
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: uglifier
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 2.4.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 2.4.0
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: configurations
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,20 +108,6 @@ dependencies:
|
|
122
108
|
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: 2.0.0.pre
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: ruby-clean-css
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.0
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.0
|
139
111
|
- !ruby/object:Gem::Dependency
|
140
112
|
name: opal
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -374,76 +346,6 @@ dependencies:
|
|
374
346
|
- - "~>"
|
375
347
|
- !ruby/object:Gem::Version
|
376
348
|
version: 0.8.7.0
|
377
|
-
- !ruby/object:Gem::Dependency
|
378
|
-
name: redcarpet
|
379
|
-
requirement: !ruby/object:Gem::Requirement
|
380
|
-
requirements:
|
381
|
-
- - "~>"
|
382
|
-
- !ruby/object:Gem::Version
|
383
|
-
version: 3.2.2
|
384
|
-
type: :development
|
385
|
-
prerelease: false
|
386
|
-
version_requirements: !ruby/object:Gem::Requirement
|
387
|
-
requirements:
|
388
|
-
- - "~>"
|
389
|
-
- !ruby/object:Gem::Version
|
390
|
-
version: 3.2.2
|
391
|
-
- !ruby/object:Gem::Dependency
|
392
|
-
name: github-markup
|
393
|
-
requirement: !ruby/object:Gem::Requirement
|
394
|
-
requirements:
|
395
|
-
- - "~>"
|
396
|
-
- !ruby/object:Gem::Version
|
397
|
-
version: 1.3.1
|
398
|
-
type: :development
|
399
|
-
prerelease: false
|
400
|
-
version_requirements: !ruby/object:Gem::Requirement
|
401
|
-
requirements:
|
402
|
-
- - "~>"
|
403
|
-
- !ruby/object:Gem::Version
|
404
|
-
version: 1.3.1
|
405
|
-
- !ruby/object:Gem::Dependency
|
406
|
-
name: sauce
|
407
|
-
requirement: !ruby/object:Gem::Requirement
|
408
|
-
requirements:
|
409
|
-
- - "~>"
|
410
|
-
- !ruby/object:Gem::Version
|
411
|
-
version: 3.5.3
|
412
|
-
type: :development
|
413
|
-
prerelease: false
|
414
|
-
version_requirements: !ruby/object:Gem::Requirement
|
415
|
-
requirements:
|
416
|
-
- - "~>"
|
417
|
-
- !ruby/object:Gem::Version
|
418
|
-
version: 3.5.3
|
419
|
-
- !ruby/object:Gem::Dependency
|
420
|
-
name: sauce-connect
|
421
|
-
requirement: !ruby/object:Gem::Requirement
|
422
|
-
requirements:
|
423
|
-
- - "~>"
|
424
|
-
- !ruby/object:Gem::Version
|
425
|
-
version: 3.5.0
|
426
|
-
type: :development
|
427
|
-
prerelease: false
|
428
|
-
version_requirements: !ruby/object:Gem::Requirement
|
429
|
-
requirements:
|
430
|
-
- - "~>"
|
431
|
-
- !ruby/object:Gem::Version
|
432
|
-
version: 3.5.0
|
433
|
-
- !ruby/object:Gem::Dependency
|
434
|
-
name: pry-byebug
|
435
|
-
requirement: !ruby/object:Gem::Requirement
|
436
|
-
requirements:
|
437
|
-
- - "~>"
|
438
|
-
- !ruby/object:Gem::Version
|
439
|
-
version: 2.0.0
|
440
|
-
type: :development
|
441
|
-
prerelease: false
|
442
|
-
version_requirements: !ruby/object:Gem::Requirement
|
443
|
-
requirements:
|
444
|
-
- - "~>"
|
445
|
-
- !ruby/object:Gem::Version
|
446
|
-
version: 2.0.0
|
447
349
|
- !ruby/object:Gem::Dependency
|
448
350
|
name: rubocop
|
449
351
|
requirement: !ruby/object:Gem::Requirement
|
@@ -494,7 +396,7 @@ files:
|
|
494
396
|
- app/volt/tasks/user_tasks.rb
|
495
397
|
- app/volt/views/notices/index.html
|
496
398
|
- bin/volt
|
497
|
-
- docs/
|
399
|
+
- docs/UPGRADE_GUIDE.md
|
498
400
|
- docs/volt-logo.jpg
|
499
401
|
- lib/volt.rb
|
500
402
|
- lib/volt/assets/test.rb
|
@@ -510,6 +412,7 @@ files:
|
|
510
412
|
- lib/volt/controllers/actions.rb
|
511
413
|
- lib/volt/controllers/http_controller.rb
|
512
414
|
- lib/volt/controllers/model_controller.rb
|
415
|
+
- lib/volt/controllers/template_helpers.rb
|
513
416
|
- lib/volt/data_stores/base_adaptor_client.rb
|
514
417
|
- lib/volt/data_stores/base_adaptor_server.rb
|
515
418
|
- lib/volt/data_stores/data_store.rb
|
@@ -550,6 +453,7 @@ files:
|
|
550
453
|
- lib/volt/models/persistors/local_store.rb
|
551
454
|
- lib/volt/models/persistors/model_identity_map.rb
|
552
455
|
- lib/volt/models/persistors/model_store.rb
|
456
|
+
- lib/volt/models/persistors/page.rb
|
553
457
|
- lib/volt/models/persistors/params.rb
|
554
458
|
- lib/volt/models/persistors/query/normalizer.rb
|
555
459
|
- lib/volt/models/persistors/query/query_listener.rb
|
@@ -572,6 +476,7 @@ files:
|
|
572
476
|
- lib/volt/models/validators/user_validation.rb
|
573
477
|
- lib/volt/page/bindings/attribute_binding.rb
|
574
478
|
- lib/volt/page/bindings/base_binding.rb
|
479
|
+
- lib/volt/page/bindings/bindings.rb
|
575
480
|
- lib/volt/page/bindings/component_binding.rb
|
576
481
|
- lib/volt/page/bindings/content_binding.rb
|
577
482
|
- lib/volt/page/bindings/each_binding.rb
|
@@ -627,6 +532,14 @@ files:
|
|
627
532
|
- lib/volt/server/html_parser/view_handler.rb
|
628
533
|
- lib/volt/server/html_parser/view_parser.rb
|
629
534
|
- lib/volt/server/html_parser/view_scope.rb
|
535
|
+
- lib/volt/server/message_bus/base_message_bus.rb
|
536
|
+
- lib/volt/server/message_bus/message_encoder.rb
|
537
|
+
- lib/volt/server/message_bus/peer_to_peer.rb
|
538
|
+
- lib/volt/server/message_bus/peer_to_peer/peer_connection.rb
|
539
|
+
- lib/volt/server/message_bus/peer_to_peer/peer_server.rb
|
540
|
+
- lib/volt/server/message_bus/peer_to_peer/server_tracker.rb
|
541
|
+
- lib/volt/server/message_bus/peer_to_peer/socket_with_timeout.rb
|
542
|
+
- lib/volt/server/message_bus/redis.rb
|
630
543
|
- lib/volt/server/rack/asset_files.rb
|
631
544
|
- lib/volt/server/rack/component_code.rb
|
632
545
|
- lib/volt/server/rack/component_paths.rb
|
@@ -650,6 +563,7 @@ files:
|
|
650
563
|
- lib/volt/tasks/dispatcher.rb
|
651
564
|
- lib/volt/tasks/task_handler.rb
|
652
565
|
- lib/volt/utils/boolean_patch.rb
|
566
|
+
- lib/volt/utils/csso_patch.rb
|
653
567
|
- lib/volt/utils/ejson.rb
|
654
568
|
- lib/volt/utils/event_counter.rb
|
655
569
|
- lib/volt/utils/generic_counting_pool.rb
|
@@ -668,6 +582,7 @@ files:
|
|
668
582
|
- lib/volt/volt/app.rb
|
669
583
|
- lib/volt/volt/core.rb
|
670
584
|
- lib/volt/volt/environment.rb
|
585
|
+
- lib/volt/volt/server_setup/app.rb
|
671
586
|
- lib/volt/volt/users.rb
|
672
587
|
- spec/apps/file_loading/app/bootstrap/assets/js/bootstrap.js
|
673
588
|
- spec/apps/file_loading/app/main/assets/js/test1.js
|
@@ -713,6 +628,7 @@ files:
|
|
713
628
|
- spec/extra_core/array_spec.rb
|
714
629
|
- spec/extra_core/blank_spec.rb
|
715
630
|
- spec/extra_core/class_spec.rb
|
631
|
+
- spec/extra_core/hash_spec.rb
|
716
632
|
- spec/extra_core/inflector_spec.rb
|
717
633
|
- spec/extra_core/logger_spec.rb
|
718
634
|
- spec/extra_core/object_spec.rb
|
@@ -755,6 +671,8 @@ files:
|
|
755
671
|
- spec/models/validators/shared_examples_for_validators.rb
|
756
672
|
- spec/models/validators/unique_validator_spec.rb
|
757
673
|
- spec/page/bindings/content_binding_spec.rb
|
674
|
+
- spec/page/bindings/each_binding_spec.rb
|
675
|
+
- spec/page/bindings/if_binding_spec.rb
|
758
676
|
- spec/page/bindings/template_binding/view_lookup_for_path_spec.rb
|
759
677
|
- spec/page/bindings/template_binding_spec.rb
|
760
678
|
- spec/page/path_string_renderer_spec.rb
|
@@ -771,6 +689,11 @@ files:
|
|
771
689
|
- spec/server/html_parser/sandlebars_parser_spec.rb
|
772
690
|
- spec/server/html_parser/view_handler_spec.rb
|
773
691
|
- spec/server/html_parser/view_parser_spec.rb
|
692
|
+
- spec/server/message_bus/message_encoder_spec.rb
|
693
|
+
- spec/server/message_bus/peer_to_peer/peer_connection_spec.rb
|
694
|
+
- spec/server/message_bus/peer_to_peer/peer_server_spec.rb
|
695
|
+
- spec/server/message_bus/peer_to_peer/socket_with_timeout_spec.rb
|
696
|
+
- spec/server/message_bus/peer_to_peer_spec.rb
|
774
697
|
- spec/server/rack/asset_files_spec.rb
|
775
698
|
- spec/server/rack/component_paths_spec.rb
|
776
699
|
- spec/server/rack/http_request_spec.rb
|
@@ -937,6 +860,7 @@ test_files:
|
|
937
860
|
- spec/extra_core/array_spec.rb
|
938
861
|
- spec/extra_core/blank_spec.rb
|
939
862
|
- spec/extra_core/class_spec.rb
|
863
|
+
- spec/extra_core/hash_spec.rb
|
940
864
|
- spec/extra_core/inflector_spec.rb
|
941
865
|
- spec/extra_core/logger_spec.rb
|
942
866
|
- spec/extra_core/object_spec.rb
|
@@ -979,6 +903,8 @@ test_files:
|
|
979
903
|
- spec/models/validators/shared_examples_for_validators.rb
|
980
904
|
- spec/models/validators/unique_validator_spec.rb
|
981
905
|
- spec/page/bindings/content_binding_spec.rb
|
906
|
+
- spec/page/bindings/each_binding_spec.rb
|
907
|
+
- spec/page/bindings/if_binding_spec.rb
|
982
908
|
- spec/page/bindings/template_binding/view_lookup_for_path_spec.rb
|
983
909
|
- spec/page/bindings/template_binding_spec.rb
|
984
910
|
- spec/page/path_string_renderer_spec.rb
|
@@ -995,6 +921,11 @@ test_files:
|
|
995
921
|
- spec/server/html_parser/sandlebars_parser_spec.rb
|
996
922
|
- spec/server/html_parser/view_handler_spec.rb
|
997
923
|
- spec/server/html_parser/view_parser_spec.rb
|
924
|
+
- spec/server/message_bus/message_encoder_spec.rb
|
925
|
+
- spec/server/message_bus/peer_to_peer/peer_connection_spec.rb
|
926
|
+
- spec/server/message_bus/peer_to_peer/peer_server_spec.rb
|
927
|
+
- spec/server/message_bus/peer_to_peer/socket_with_timeout_spec.rb
|
928
|
+
- spec/server/message_bus/peer_to_peer_spec.rb
|
998
929
|
- spec/server/rack/asset_files_spec.rb
|
999
930
|
- spec/server/rack/component_paths_spec.rb
|
1000
931
|
- spec/server/rack/http_request_spec.rb
|
data/docs/FAQ.md
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# FAQ
|
2
|
-
|
3
|
-
## How do I include/call JavaScript from Volt?
|
4
|
-
|
5
|
-
1. If you have a url outside of your project you want to include with a component, see dependencies under https://github.com/voltrb/volt/blob/master/Readme.md#Dependencies. This is useful for including assets from a shared CDN and will place a script tag on the page.
|
6
|
-
2. You can also place script tags in public/index.html (though it's better to put them in the components). Any JS files in app/{component_name}/assets/js will be loaded automatically.
|
7
|
-
3. Lastly, you can also embed javascript inline in any controllers since they run in opal (see opalrb.org for info on that)
|