hyper-mesh 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -13
- data/docs/action_cable_quickstart.md +9 -7
- data/docs/activerecord_api.md +73 -0
- data/docs/client_side_scoping.md +5 -5
- data/docs/configuration_details.md +11 -0
- data/docs/pusher_faker_quickstart.md +95 -6
- data/docs/pusher_quickstart.md +96 -8
- data/docs/simple_poller_quickstart.md +21 -55
- data/docs/todo-example.md +2 -0
- data/docs/words-example.md +3 -0
- data/examples/action-cable/Gemfile +7 -8
- data/examples/action-cable/Gemfile.lock +28 -46
- data/examples/{simple-poller/app/assets/javascripts/channels → action-cable/app/assets/images}/.keep +0 -0
- data/examples/action-cable/app/assets/javascripts/application.js +5 -3
- data/examples/action-cable/app/assets/javascripts/cable.js +13 -0
- data/examples/{simple-poller/app/controllers/concerns → action-cable/app/assets/javascripts/channels}/.keep +0 -0
- data/examples/{simple-poller → action-cable}/app/channels/application_cable/channel.rb +0 -0
- data/examples/{simple-poller → action-cable}/app/channels/application_cable/connection.rb +0 -0
- data/examples/action-cable/app/controllers/test_controller.rb +0 -1
- data/examples/{simple-poller/app/models/concerns → action-cable/app/models/public}/.keep +0 -0
- data/examples/action-cable/app/policies/application_policy.rb +9 -1
- data/examples/action-cable/app/views/components.rb +2 -3
- data/examples/action-cable/bin/spring +4 -3
- data/examples/action-cable/config/application.rb +1 -11
- data/examples/action-cable/config/environments/development.rb +12 -1
- data/examples/action-cable/config/initializers/hyper_mesh.rb +4 -0
- data/examples/action-cable/config/routes.rb +1 -1
- data/examples/action-cable/config/secrets.yml +2 -2
- data/examples/action-cable/db/migrate/{20160921223808_create_words.rb → 20161114213840_create_words.rb} +0 -0
- data/examples/action-cable/db/schema.rb +14 -1
- data/examples/action-cable/db/seeds.rb +7 -0
- data/examples/{simple-poller/app/views/components → action-cable/lib/assets}/.keep +0 -0
- data/examples/action-cable/lib/tasks/.keep +0 -0
- data/examples/action-cable/test/controllers/.keep +0 -0
- data/examples/action-cable/test/fixtures/.keep +0 -0
- data/examples/action-cable/test/fixtures/files/.keep +0 -0
- data/examples/action-cable/test/fixtures/words.yml +7 -0
- data/examples/action-cable/test/helpers/.keep +0 -0
- data/examples/action-cable/test/integration/.keep +0 -0
- data/examples/action-cable/test/mailers/.keep +0 -0
- data/examples/action-cable/test/models/.keep +0 -0
- data/examples/action-cable/test/models/word_test.rb +7 -0
- data/examples/action-cable/test/test_helper.rb +10 -0
- data/examples/pusher-fake/.gitignore +21 -0
- data/examples/pusher-fake/Gemfile +59 -0
- data/examples/pusher-fake/Gemfile.lock +262 -0
- data/examples/pusher-fake/README.md +24 -0
- data/examples/pusher-fake/Rakefile +6 -0
- data/examples/pusher-fake/app/assets/config/manifest.js +3 -0
- data/examples/pusher-fake/app/assets/images/.keep +0 -0
- data/examples/pusher-fake/app/assets/javascripts/application.js +21 -0
- data/examples/pusher-fake/app/assets/stylesheets/application.css +15 -0
- data/examples/pusher-fake/app/controllers/application_controller.rb +3 -0
- data/examples/pusher-fake/app/controllers/test_controller.rb +5 -0
- data/examples/pusher-fake/app/models/models.rb +2 -0
- data/examples/pusher-fake/app/models/public/.keep +0 -0
- data/examples/pusher-fake/app/models/public/application_record.rb +3 -0
- data/examples/pusher-fake/app/models/public/word.rb +2 -0
- data/examples/pusher-fake/app/policies/application_policy.rb +14 -0
- data/examples/pusher-fake/app/views/components.rb +16 -0
- data/examples/pusher-fake/app/views/components/app.rb +18 -0
- data/examples/pusher-fake/app/views/layouts/application.html.erb +14 -0
- data/examples/pusher-fake/app/views/layouts/mailer.html.erb +13 -0
- data/examples/pusher-fake/app/views/layouts/mailer.text.erb +1 -0
- data/examples/pusher-fake/bin/bundle +3 -0
- data/examples/pusher-fake/bin/rails +9 -0
- data/examples/pusher-fake/bin/rake +9 -0
- data/examples/pusher-fake/bin/setup +34 -0
- data/examples/pusher-fake/bin/spring +16 -0
- data/examples/pusher-fake/bin/update +29 -0
- data/examples/pusher-fake/config.ru +5 -0
- data/examples/pusher-fake/config/application.rb +20 -0
- data/examples/pusher-fake/config/boot.rb +3 -0
- data/examples/pusher-fake/config/database.yml +25 -0
- data/examples/pusher-fake/config/environment.rb +5 -0
- data/examples/pusher-fake/config/environments/development.rb +56 -0
- data/examples/pusher-fake/config/environments/production.rb +86 -0
- data/examples/pusher-fake/config/environments/test.rb +42 -0
- data/examples/pusher-fake/config/initializers/application_controller_renderer.rb +6 -0
- data/examples/pusher-fake/config/initializers/assets.rb +11 -0
- data/examples/pusher-fake/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/pusher-fake/config/initializers/cookies_serializer.rb +5 -0
- data/examples/pusher-fake/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/pusher-fake/config/initializers/hyper_mesh.rb +21 -0
- data/examples/pusher-fake/config/initializers/inflections.rb +16 -0
- data/examples/pusher-fake/config/initializers/mime_types.rb +4 -0
- data/examples/pusher-fake/config/initializers/new_framework_defaults.rb +24 -0
- data/examples/pusher-fake/config/initializers/session_store.rb +3 -0
- data/examples/pusher-fake/config/initializers/wrap_parameters.rb +14 -0
- data/examples/pusher-fake/config/locales/en.yml +23 -0
- data/examples/pusher-fake/config/puma.rb +47 -0
- data/examples/pusher-fake/config/routes.rb +5 -0
- data/examples/pusher-fake/config/secrets.yml +22 -0
- data/examples/pusher-fake/config/spring.rb +6 -0
- data/examples/{simple-poller/db/migrate/20161013220135_create_words.rb → pusher-fake/db/migrate/20161114213840_create_words.rb} +0 -0
- data/examples/pusher-fake/db/schema.rb +34 -0
- data/examples/pusher-fake/db/seeds.rb +7 -0
- data/examples/pusher-fake/lib/assets/.keep +0 -0
- data/examples/pusher-fake/lib/tasks/.keep +0 -0
- data/examples/pusher-fake/log/.keep +0 -0
- data/examples/pusher-fake/public/404.html +67 -0
- data/examples/pusher-fake/public/422.html +67 -0
- data/examples/pusher-fake/public/500.html +66 -0
- data/examples/pusher-fake/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/pusher-fake/public/apple-touch-icon.png +0 -0
- data/examples/pusher-fake/public/favicon.ico +0 -0
- data/examples/pusher-fake/public/robots.txt +5 -0
- data/examples/pusher-fake/test/controllers/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/files/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/words.yml +7 -0
- data/examples/pusher-fake/test/helpers/.keep +0 -0
- data/examples/pusher-fake/test/integration/.keep +0 -0
- data/examples/pusher-fake/test/mailers/.keep +0 -0
- data/examples/pusher-fake/test/models/.keep +0 -0
- data/examples/pusher-fake/test/models/word_test.rb +7 -0
- data/examples/pusher-fake/test/test_helper.rb +10 -0
- data/examples/pusher-fake/tmp/.keep +0 -0
- data/examples/pusher-fake/vendor/assets/javascripts/.keep +0 -0
- data/examples/pusher-fake/vendor/assets/stylesheets/.keep +0 -0
- data/examples/pusher/.gitignore +21 -0
- data/examples/pusher/Gemfile +58 -0
- data/examples/pusher/Gemfile.lock +236 -0
- data/examples/pusher/README.md +24 -0
- data/examples/pusher/Rakefile +6 -0
- data/examples/pusher/app/assets/config/manifest.js +3 -0
- data/examples/pusher/app/assets/images/.keep +0 -0
- data/examples/pusher/app/assets/javascripts/application.js +21 -0
- data/examples/pusher/app/assets/stylesheets/application.css +15 -0
- data/examples/pusher/app/controllers/application_controller.rb +3 -0
- data/examples/pusher/app/controllers/test_controller.rb +5 -0
- data/examples/pusher/app/models/models.rb +2 -0
- data/examples/pusher/app/models/public/.keep +0 -0
- data/examples/pusher/app/models/public/application_record.rb +3 -0
- data/examples/pusher/app/models/public/word.rb +2 -0
- data/examples/pusher/app/policies/application_policy.rb +14 -0
- data/examples/pusher/app/views/components.rb +16 -0
- data/examples/pusher/app/views/components/app.rb +18 -0
- data/examples/pusher/app/views/layouts/application.html.erb +14 -0
- data/examples/pusher/app/views/layouts/mailer.html.erb +13 -0
- data/examples/pusher/app/views/layouts/mailer.text.erb +1 -0
- data/examples/pusher/bin/bundle +3 -0
- data/examples/pusher/bin/rails +9 -0
- data/examples/pusher/bin/rake +9 -0
- data/examples/pusher/bin/setup +34 -0
- data/examples/pusher/bin/spring +16 -0
- data/examples/pusher/bin/update +29 -0
- data/examples/pusher/config.ru +5 -0
- data/examples/pusher/config/application.rb +20 -0
- data/examples/pusher/config/boot.rb +3 -0
- data/examples/pusher/config/database.yml +25 -0
- data/examples/pusher/config/environment.rb +5 -0
- data/examples/pusher/config/environments/development.rb +56 -0
- data/examples/pusher/config/environments/production.rb +86 -0
- data/examples/pusher/config/environments/test.rb +42 -0
- data/examples/pusher/config/initializers/application_controller_renderer.rb +6 -0
- data/examples/pusher/config/initializers/assets.rb +11 -0
- data/examples/pusher/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/pusher/config/initializers/cookies_serializer.rb +5 -0
- data/examples/pusher/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/pusher/config/initializers/hyper_mesh.rb +10 -0
- data/examples/pusher/config/initializers/inflections.rb +16 -0
- data/examples/pusher/config/initializers/mime_types.rb +4 -0
- data/examples/pusher/config/initializers/new_framework_defaults.rb +24 -0
- data/examples/pusher/config/initializers/session_store.rb +3 -0
- data/examples/pusher/config/initializers/wrap_parameters.rb +14 -0
- data/examples/pusher/config/locales/en.yml +23 -0
- data/examples/pusher/config/puma.rb +47 -0
- data/examples/pusher/config/routes.rb +5 -0
- data/examples/pusher/config/secrets.yml +22 -0
- data/examples/pusher/config/spring.rb +6 -0
- data/examples/pusher/db/migrate/20161114213840_create_words.rb +9 -0
- data/examples/pusher/db/schema.rb +34 -0
- data/examples/pusher/db/seeds.rb +7 -0
- data/examples/pusher/lib/assets/.keep +0 -0
- data/examples/pusher/lib/tasks/.keep +0 -0
- data/examples/pusher/log/.keep +0 -0
- data/examples/pusher/public/404.html +67 -0
- data/examples/pusher/public/422.html +67 -0
- data/examples/pusher/public/500.html +66 -0
- data/examples/pusher/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/pusher/public/apple-touch-icon.png +0 -0
- data/examples/pusher/public/favicon.ico +0 -0
- data/examples/pusher/public/robots.txt +5 -0
- data/examples/pusher/test/controllers/.keep +0 -0
- data/examples/pusher/test/fixtures/.keep +0 -0
- data/examples/pusher/test/fixtures/files/.keep +0 -0
- data/examples/pusher/test/fixtures/words.yml +7 -0
- data/examples/pusher/test/helpers/.keep +0 -0
- data/examples/pusher/test/integration/.keep +0 -0
- data/examples/pusher/test/mailers/.keep +0 -0
- data/examples/pusher/test/models/.keep +0 -0
- data/examples/pusher/test/models/word_test.rb +7 -0
- data/examples/pusher/test/test_helper.rb +10 -0
- data/examples/pusher/tmp/.keep +0 -0
- data/examples/pusher/vendor/assets/javascripts/.keep +0 -0
- data/examples/pusher/vendor/assets/stylesheets/.keep +0 -0
- data/examples/simple-poller/Gemfile +7 -14
- data/examples/simple-poller/Gemfile.lock +23 -66
- data/examples/simple-poller/app/assets/javascripts/application.js +5 -4
- data/examples/simple-poller/app/controllers/test_controller.rb +0 -1
- data/examples/simple-poller/app/policies/application_policy.rb +10 -1
- data/examples/simple-poller/app/views/components.rb +4 -6
- data/examples/simple-poller/app/views/components/app.rb +2 -24
- data/examples/simple-poller/app/views/layouts/application.html.erb +1 -1
- data/examples/simple-poller/bin/bundle +0 -0
- data/examples/simple-poller/bin/rails +0 -0
- data/examples/simple-poller/bin/rake +0 -0
- data/examples/simple-poller/bin/setup +0 -0
- data/examples/simple-poller/bin/spring +0 -0
- data/examples/simple-poller/bin/update +0 -0
- data/examples/simple-poller/config/application.rb +1 -1
- data/examples/simple-poller/config/environments/development.rb +13 -1
- data/examples/simple-poller/config/environments/production.rb +1 -1
- data/examples/simple-poller/config/initializers/hyper_mesh.rb +9 -0
- data/examples/simple-poller/config/initializers/session_store.rb +1 -1
- data/examples/simple-poller/config/routes.rb +1 -1
- data/examples/simple-poller/config/secrets.yml +2 -2
- data/examples/simple-poller/db/migrate/20161114213840_create_words.rb +9 -0
- data/examples/simple-poller/db/schema.rb +14 -1
- data/lib/hypermesh/version.rb +1 -1
- data/lib/reactive_record/active_record/reactive_record/dummy_value.rb +2 -0
- data/spec/synchromesh/{connection_spec.rb → unit_tests/connection_spec.rb} +0 -0
- data/spec/synchromesh/unit_tests/dummy_value_spec.rb +26 -0
- metadata +184 -20
- data/examples/action-cable/config/initializers/synchromesh.rb +0 -5
- data/examples/action-cable/rails_cache_dir2/C91/480/synchromesh_active_connections +0 -0
- data/examples/simple-poller/app/helpers/application_helper.rb +0 -2
- data/examples/simple-poller/app/jobs/application_job.rb +0 -2
- data/examples/simple-poller/app/mailers/application_mailer.rb +0 -4
- data/examples/simple-poller/config/cable.yml +0 -9
- data/examples/simple-poller/config/initializers/synchromesh.rb +0 -15
- data/hyper-mesh-0.4.0.gem +0 -0
@@ -1,82 +1,48 @@
|
|
1
1
|
### Simple Poller Quickstart
|
2
2
|
|
3
|
-
The easiest
|
3
|
+
The easiest push transport is the built-in simple poller. This is great for demos or trying out HyperMesh but because it is constantly polling it is not suitable for production systems or any kind of real debug or test activities.
|
4
4
|
|
5
|
-
#### 1
|
5
|
+
#### 1 Add the HyperLoop gems to your Rails app
|
6
6
|
|
7
|
-
|
7
|
+
If you have not already installed the `hyper-react` and `hyper-mesh` gems, then do so now using the [hyper-rails](https://github.com/ruby-hyperloop/hyper-rails) gem.
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
If you have not already installed the `hyper-react` and `reactive-record` gems, then do so now using the [reactrb-rails-generator](https://github.com/hyper-react/reactrb-rails-generator) gem.
|
12
|
-
|
13
|
-
- add `gem 'reactrb-rails-generator'` to your gem file (in the development section)
|
9
|
+
- add `gem 'hyper-rails'` to your gem file (in the development section)
|
14
10
|
- run `bundle install`
|
15
|
-
- run `
|
11
|
+
- run `rails g hyperloop:install --all` (make sure to use the --all option)
|
16
12
|
- run `bundle update`
|
17
13
|
|
18
|
-
####
|
19
|
-
|
20
|
-
- add `gem 'synchromesh', git: 'https://github.com/hyper-react/synchromesh', branch: 'authorization-policies'`
|
21
|
-
- then `bundle install`
|
22
|
-
- and in `app/views/components.rb` add `require 'hyper-mesh'`
|
23
|
-
immediately below`require 'reactive-record'`
|
14
|
+
#### 2 Set the transport
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
Once you have hyper-react installed then add this initializer:
|
16
|
+
Once you have HyperMesh installed then add this initializer:
|
28
17
|
```ruby
|
29
18
|
#config/initializers/synchromesh.rb
|
30
19
|
HyperMesh.configuration do |config|
|
31
20
|
config.transport = :simple_poller
|
32
21
|
# options
|
33
|
-
config.opts = {
|
34
|
-
|
35
|
-
|
36
|
-
}
|
22
|
+
# config.opts = {
|
23
|
+
# seconds_between_poll: 5, # default is 0.5 you may need to increase if testing with Selenium
|
24
|
+
# seconds_polled_data_will_be_retained: 1.hour # clears channel data after this time, default is 5 minutes
|
25
|
+
# }
|
37
26
|
end
|
38
27
|
```
|
39
28
|
|
40
|
-
####
|
41
|
-
|
42
|
-
HyperMesh uses the rails cache to keep track of what connections are alive in a transport independent fashion. Rails 5 by default will have caching off in development mode.
|
43
|
-
|
44
|
-
Check in `config/development.rb` and make sure that `cache_store` is never being set to `:null_store`.
|
45
|
-
|
46
|
-
If you would like to be able to interact via
|
47
|
-
the `rails console` you should set the store to be something like this:
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
# config/development.rb
|
51
|
-
Rails.application.configure do
|
52
|
-
config.cache_store = :file_store, './rails_cache_dir'
|
53
|
-
end
|
54
|
-
```
|
29
|
+
#### 3 Try It Out
|
55
30
|
|
56
|
-
|
57
|
-
|
58
|
-
To start just open everything up by adding a policies directory and defining a policy file like this:
|
59
|
-
|
60
|
-
```ruby
|
61
|
-
# app/policies/application_policy.rb
|
62
|
-
class ApplicationPolicy
|
63
|
-
always_allow_connection
|
64
|
-
regulate_all_broadcasts { |policy| policy.send_all }
|
65
|
-
allow_change(to: :all, on: [:create, :update, :destroy]) { true }
|
66
|
-
end
|
67
|
-
```
|
68
|
-
|
69
|
-
#### 8 Try It Out
|
70
|
-
|
71
|
-
If you don't already have a model to play with, add one now:
|
31
|
+
If you don't already have a model to play with add one now:
|
72
32
|
|
73
33
|
`bundle exec rails generate model Word text:string`
|
74
34
|
|
75
35
|
`bundle exec rake db:migrate`
|
76
36
|
|
37
|
+
Move `app/models/word.rb` to `app/models/public/word.rb`
|
38
|
+
|
39
|
+
**Leave** `app/models/model.rb` where it is. This is your models client side manifest file.
|
40
|
+
|
77
41
|
Whatever model(s) you will plan to access on the client need to moved to the `app/models/public` directory. This allows reactive-record to build a client side proxy for the models. Models not moved will be completely invisible on the client side.
|
78
42
|
|
79
|
-
|
43
|
+
**Important** in rails 5 there is also a base `ApplicationRecord` class, that all other models are built from. This class must be moved to the public directory as well.
|
44
|
+
|
45
|
+
If you don't already have a component to play with, here is a simple one (make sure you added the Word model):
|
80
46
|
|
81
47
|
```ruby
|
82
48
|
# app/views/components/app.rb
|
@@ -123,4 +89,4 @@ Fire up rails with `bundle exec rails s` and open your app in a couple of browse
|
|
123
89
|
|
124
90
|
You can also fire up a rails console, and then for example do a `Word.new(text: "Hello").save` and again see any browsers updating.
|
125
91
|
|
126
|
-
If you want to go into more details with example check out [words-example](/docs/words-example.md)
|
92
|
+
If you want to go into more details with the example check out [words-example](/docs/words-example.md)
|
data/docs/todo-example.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# ![](/work-in-progress-drinking.png) WARNING DOCS AND EXAMPLES ARE BEING REWRITTEN MANY LINKS MAY BE BROKEN STAY TUNED OR CHECK IN AT [![Join the chat at https://gitter.im/reactrb/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/reactrb/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) FOR MORE INFO
|
2
|
+
|
1
3
|
Lets look at part of a very simple Todo application with one model:
|
2
4
|
|
3
5
|
```ruby
|
data/docs/words-example.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# ![](/work-in-progress-drinking.png) WARNING DOCS AND EXAMPLES ARE BEING REWRITTEN MANY LINKS MAY BE BROKEN STAY TUNED OR CHECK IN AT [![Join the chat at https://gitter.im/reactrb/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/reactrb/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) FOR MORE INFO
|
2
|
+
|
3
|
+
|
1
4
|
## Random Words example
|
2
5
|
|
3
6
|
This is the example app used by the quick start guides, and if you want to dive deeper this is the place to be.
|
@@ -33,7 +33,6 @@ gem 'jbuilder', '~> 2.5'
|
|
33
33
|
group :development, :test do
|
34
34
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
35
35
|
gem 'byebug', platform: :mri
|
36
|
-
gem 'reactrb-rails-generator'
|
37
36
|
end
|
38
37
|
|
39
38
|
group :development do
|
@@ -41,18 +40,18 @@ group :development do
|
|
41
40
|
gem 'web-console'
|
42
41
|
gem 'listen', '~> 3.0.5'
|
43
42
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
44
|
-
gem 'spring'
|
45
|
-
gem 'spring-watcher-listen', '~> 2.0.0'
|
43
|
+
#gem 'spring'
|
44
|
+
#gem 'spring-watcher-listen', '~> 2.0.0'
|
45
|
+
gem 'hyper-rails'
|
46
46
|
end
|
47
47
|
|
48
48
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
49
49
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
50
50
|
|
51
|
+
gem 'opal-rails'
|
52
|
+
gem 'opal-browser'
|
51
53
|
gem 'hyper-react'
|
52
|
-
gem 'react-rails', '>= 1.3.0'
|
53
|
-
gem 'opal-rails', '>= 0.8.1'
|
54
54
|
gem 'therubyracer', platforms: :ruby
|
55
55
|
gem 'react-router-rails', '~> 0.13.3'
|
56
|
-
gem '
|
57
|
-
gem '
|
58
|
-
gem 'synchromesh', path: '../..'
|
56
|
+
gem 'hyper-router'
|
57
|
+
gem 'hyper-mesh'
|
@@ -1,10 +1,3 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ../..
|
3
|
-
specs:
|
4
|
-
synchromesh (0.4.0)
|
5
|
-
activerecord (>= 0.3.0)
|
6
|
-
reactive-record (>= 0.7.43)
|
7
|
-
|
8
1
|
GEM
|
9
2
|
remote: https://rubygems.org/
|
10
3
|
specs:
|
@@ -45,13 +38,13 @@ GEM
|
|
45
38
|
i18n (~> 0.7)
|
46
39
|
minitest (~> 5.1)
|
47
40
|
tzinfo (~> 1.1)
|
48
|
-
arel (7.1.
|
41
|
+
arel (7.1.4)
|
49
42
|
babel-source (5.8.35)
|
50
43
|
babel-transpiler (0.7.0)
|
51
44
|
babel-source (>= 4.0, < 6)
|
52
45
|
execjs (~> 2.0)
|
53
46
|
builder (3.2.2)
|
54
|
-
byebug (9.0.
|
47
|
+
byebug (9.0.6)
|
55
48
|
coffee-rails (4.2.1)
|
56
49
|
coffee-script (>= 2.2.0)
|
57
50
|
railties (>= 4.0.0, < 5.2.x)
|
@@ -60,7 +53,7 @@ GEM
|
|
60
53
|
execjs
|
61
54
|
coffee-script-source (1.10.0)
|
62
55
|
concurrent-ruby (1.0.2)
|
63
|
-
connection_pool (2.2.
|
56
|
+
connection_pool (2.2.1)
|
64
57
|
debug_inspector (0.0.2)
|
65
58
|
erubis (2.7.0)
|
66
59
|
execjs (2.7.0)
|
@@ -68,6 +61,18 @@ GEM
|
|
68
61
|
globalid (0.3.7)
|
69
62
|
activesupport (>= 4.1.0)
|
70
63
|
hike (1.2.3)
|
64
|
+
hyper-mesh (0.5.0)
|
65
|
+
activerecord (>= 0.3.0)
|
66
|
+
hyper-react (>= 0.10.0)
|
67
|
+
hyper-rails (0.4.0)
|
68
|
+
rails (>= 4.0.0)
|
69
|
+
hyper-react (0.10.0)
|
70
|
+
opal (>= 0.8.0)
|
71
|
+
opal-activesupport (>= 0.2.0)
|
72
|
+
react-rails
|
73
|
+
hyper-router (2.4.0)
|
74
|
+
hyper-react
|
75
|
+
opal-browser
|
71
76
|
i18n (0.7.0)
|
72
77
|
jbuilder (2.6.0)
|
73
78
|
activesupport (>= 3.0.0, < 5.1)
|
@@ -89,13 +94,12 @@ GEM
|
|
89
94
|
mime-types-data (~> 3.2015)
|
90
95
|
mime-types-data (3.2016.0521)
|
91
96
|
mini_portile2 (2.1.0)
|
92
|
-
minitest (5.9.
|
97
|
+
minitest (5.9.1)
|
93
98
|
multi_json (1.12.1)
|
94
99
|
nio4r (1.2.1)
|
95
|
-
nokogiri (1.6.8)
|
100
|
+
nokogiri (1.6.8.1)
|
96
101
|
mini_portile2 (~> 2.1.0)
|
97
|
-
|
98
|
-
opal (0.10.2)
|
102
|
+
opal (0.10.3)
|
99
103
|
hike (~> 1.2)
|
100
104
|
sourcemap (~> 0.1.0)
|
101
105
|
sprockets (~> 3.1)
|
@@ -115,7 +119,6 @@ GEM
|
|
115
119
|
rails (>= 4.0, < 6.0)
|
116
120
|
sprockets-rails (< 3.0)
|
117
121
|
paggio (0.2.6)
|
118
|
-
pkg-config (1.1.7)
|
119
122
|
puma (3.6.0)
|
120
123
|
rack (2.0.1)
|
121
124
|
rack-test (0.6.3)
|
@@ -144,7 +147,7 @@ GEM
|
|
144
147
|
rake (>= 0.8.7)
|
145
148
|
thor (>= 0.18.1, < 2.0)
|
146
149
|
rake (11.3.0)
|
147
|
-
rb-fsevent (0.9.
|
150
|
+
rb-fsevent (0.9.8)
|
148
151
|
rb-inotify (0.9.7)
|
149
152
|
ffi (>= 0.5.0)
|
150
153
|
react-rails (1.4.2)
|
@@ -157,20 +160,6 @@ GEM
|
|
157
160
|
react-router-rails (0.13.3.2)
|
158
161
|
rails (>= 3.1)
|
159
162
|
react-rails (~> 1.4.0)
|
160
|
-
reactive-record (0.8.3)
|
161
|
-
opal-browser
|
162
|
-
opal-rails
|
163
|
-
rails (>= 3.2.13)
|
164
|
-
react-rails
|
165
|
-
hyper-react
|
166
|
-
hyper-react (0.8.8)
|
167
|
-
opal (>= 0.8.0)
|
168
|
-
opal-activesupport (>= 0.2.0)
|
169
|
-
opal-browser (= 0.2.0)
|
170
|
-
reactrb-rails-generator (0.2.0)
|
171
|
-
rails (>= 4.0.0)
|
172
|
-
reactrb-router (0.8.2)
|
173
|
-
hyper-react
|
174
163
|
ref (2.0.0)
|
175
164
|
sass (3.4.22)
|
176
165
|
sass-rails (5.0.6)
|
@@ -180,10 +169,6 @@ GEM
|
|
180
169
|
sprockets-rails (>= 2.0, < 4.0)
|
181
170
|
tilt (>= 1.1, < 3)
|
182
171
|
sourcemap (0.1.1)
|
183
|
-
spring (1.7.2)
|
184
|
-
spring-watcher-listen (2.0.0)
|
185
|
-
listen (>= 2.7, < 4.0)
|
186
|
-
spring (~> 1.2)
|
187
172
|
sprockets (3.7.0)
|
188
173
|
concurrent-ruby (~> 1.0)
|
189
174
|
rack (> 1, < 3)
|
@@ -191,7 +176,7 @@ GEM
|
|
191
176
|
actionpack (>= 3.0)
|
192
177
|
activesupport (>= 3.0)
|
193
178
|
sprockets (>= 2.8, < 4.0)
|
194
|
-
sqlite3 (1.3.
|
179
|
+
sqlite3 (1.3.12)
|
195
180
|
therubyracer (0.12.2)
|
196
181
|
libv8 (~> 3.16.14.0)
|
197
182
|
ref
|
@@ -203,9 +188,9 @@ GEM
|
|
203
188
|
turbolinks-source (5.0.0)
|
204
189
|
tzinfo (1.2.2)
|
205
190
|
thread_safe (~> 0.1)
|
206
|
-
uglifier (3.0.
|
191
|
+
uglifier (3.0.3)
|
207
192
|
execjs (>= 0.3.0, < 3)
|
208
|
-
web-console (3.
|
193
|
+
web-console (3.4.0)
|
209
194
|
actionview (>= 5.0)
|
210
195
|
activemodel (>= 5.0)
|
211
196
|
debug_inspector
|
@@ -220,23 +205,20 @@ PLATFORMS
|
|
220
205
|
DEPENDENCIES
|
221
206
|
byebug
|
222
207
|
coffee-rails (~> 4.2)
|
208
|
+
hyper-mesh
|
209
|
+
hyper-rails
|
210
|
+
hyper-react
|
211
|
+
hyper-router
|
223
212
|
jbuilder (~> 2.5)
|
224
213
|
jquery-rails
|
225
214
|
listen (~> 3.0.5)
|
226
|
-
opal-
|
215
|
+
opal-browser
|
216
|
+
opal-rails
|
227
217
|
puma (~> 3.0)
|
228
218
|
rails (~> 5.0.0, >= 5.0.0.1)
|
229
|
-
react-rails (>= 1.3.0)
|
230
219
|
react-router-rails (~> 0.13.3)
|
231
|
-
reactive-record (>= 0.8.0)
|
232
|
-
hyper-react
|
233
|
-
reactrb-rails-generator
|
234
|
-
reactrb-router
|
235
220
|
sass-rails (~> 5.0)
|
236
|
-
spring
|
237
|
-
spring-watcher-listen (~> 2.0.0)
|
238
221
|
sqlite3
|
239
|
-
synchromesh!
|
240
222
|
therubyracer
|
241
223
|
turbolinks (~> 5)
|
242
224
|
tzinfo-data
|
data/examples/{simple-poller/app/assets/javascripts/channels → action-cable/app/assets/images}/.keep
RENAMED
File without changes
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// added by hyper-rails: These lines must preceed other requires especially turbo_links
|
2
|
+
//= require 'components'
|
3
|
+
//= require 'react_ujs'
|
1
4
|
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
5
|
// listed below.
|
3
6
|
//
|
@@ -9,10 +12,9 @@
|
|
9
12
|
//
|
10
13
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
14
|
// about supported directives.
|
12
|
-
//= require 'components'
|
13
|
-
//= require 'react_ujs'
|
14
15
|
//
|
15
16
|
//= require jquery
|
16
17
|
//= require jquery_ujs
|
17
|
-
//= require
|
18
|
+
//= require turbolinks
|
19
|
+
//= require_tree .
|
18
20
|
Opal.load('components');
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the rails generate channel command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,14 @@
|
|
1
1
|
# app/policies/application_policy
|
2
|
+
|
3
|
+
# Policies regulate access to your public models
|
4
|
+
# The following policy will open up full access (but only in development)
|
5
|
+
# The policy system is very flexible and powerful. See the documentation
|
6
|
+
# for complete details.
|
2
7
|
class ApplicationPolicy
|
8
|
+
# Allow any session to connect:
|
3
9
|
always_allow_connection
|
10
|
+
# Send all attributes from all public models
|
4
11
|
regulate_all_broadcasts { |policy| policy.send_all }
|
12
|
+
# Allow all changes to public models
|
5
13
|
allow_change(to: :all, on: [:create, :update, :destroy]) { true }
|
6
|
-
end
|
14
|
+
end if Rails.env.development?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# app/views/components.rb
|
2
2
|
require 'opal'
|
3
|
-
require 'react'
|
3
|
+
require 'react/react-source'
|
4
4
|
require 'hyper-react'
|
5
5
|
if React::IsomorphicHelpers.on_opal_client?
|
6
6
|
require 'opal-jquery'
|
@@ -9,9 +9,8 @@ if React::IsomorphicHelpers.on_opal_client?
|
|
9
9
|
require 'browser/delay'
|
10
10
|
# add any additional requires that can ONLY run on client here
|
11
11
|
end
|
12
|
-
require '
|
12
|
+
require 'hyper-router'
|
13
13
|
require 'react_router'
|
14
|
-
require 'reactive-record'
|
15
14
|
require 'hyper-mesh'
|
16
15
|
require 'models'
|
17
16
|
require_tree './components'
|
@@ -7,9 +7,10 @@ unless defined?(Spring)
|
|
7
7
|
require 'rubygems'
|
8
8
|
require 'bundler'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
|
12
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
13
|
+
gem 'spring', spring.version
|
13
14
|
require 'spring/binstub'
|
14
15
|
end
|
15
16
|
end
|
@@ -1,16 +1,6 @@
|
|
1
1
|
require_relative 'boot'
|
2
2
|
|
3
|
-
require
|
4
|
-
# Pick the frameworks you want:
|
5
|
-
require "active_model/railtie"
|
6
|
-
require "active_job/railtie"
|
7
|
-
require "active_record/railtie"
|
8
|
-
require "action_controller/railtie"
|
9
|
-
require "action_mailer/railtie"
|
10
|
-
require "action_view/railtie"
|
11
|
-
require "action_cable/engine"
|
12
|
-
require "sprockets/railtie"
|
13
|
-
# require "rails/test_unit/railtie"
|
3
|
+
require 'rails/all'
|
14
4
|
|
15
5
|
# Require the gems listed in Gemfile, including any gems
|
16
6
|
# you've limited to :test, :development, or :production.
|
@@ -15,7 +15,18 @@ Rails.application.configure do
|
|
15
15
|
config.consider_all_requests_local = true
|
16
16
|
|
17
17
|
# Enable/disable caching. By default caching is disabled.
|
18
|
-
|
18
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
19
|
+
config.action_controller.perform_caching = true
|
20
|
+
|
21
|
+
config.cache_store = :memory_store
|
22
|
+
config.public_file_server.headers = {
|
23
|
+
'Cache-Control' => 'public, max-age=172800'
|
24
|
+
}
|
25
|
+
else
|
26
|
+
config.action_controller.perform_caching = false
|
27
|
+
|
28
|
+
config.cache_store = :null_store
|
29
|
+
end
|
19
30
|
|
20
31
|
# Don't care if the mailer can't send.
|
21
32
|
config.action_mailer.raise_delivery_errors = false
|