hyper-operation 0.5.4 → 0.5.5

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: 55a51f0f00f835cad841e22e4134a1aad3941e4e
4
- data.tar.gz: ecf9e3ca605a6ba2e8e4457072c1da89ceb08508
3
+ metadata.gz: 4dacf1ed20bb743bdc16a16d878ae69dc0874785
4
+ data.tar.gz: bb7f4751eb7cfd129a582439f2ab35943964b807
5
5
  SHA512:
6
- metadata.gz: cdca326bc1be10ae50cd7d4c57baa7d1e4cf8491a0627bb493be74e33298c4f5d063066ad2807e401b628eb1934f6d1a7965673d3672633af90785cb2f507e2c
7
- data.tar.gz: 40d8425a7370b54b69c4f1b49ec98104c0d93169fee556d80b4c020610c48386b8695b43fb2137bb5936cde2a3c251e9c9615a7b8ec59f4988445ab29e15132e
6
+ metadata.gz: 29ba5548455e8e6416ca2f9eb987f198e0dcb7a17b858533d5439c9e12b1125bab96aef502d5a590b0e7217b0dae47b603eb534a2fe6f32909d6d3ef711d3d6f
7
+ data.tar.gz: 20e810d8072873308c08d5b2db5affd173a7ab15ee274a9a41c87fa366d0cb0e8c1f99290ed78e8e94a8b7b613247f4c09aef07a7f9a8cc3adb213387914c0a1
@@ -7,9 +7,11 @@ end
7
7
 
8
8
 
9
9
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
- gem 'rails', '~> 5.0.1'
10
+ #gem 'rails', '~> 5.0.1'
11
+ gem 'rails', '=5.1.0.rc1'
11
12
  # Use sqlite3 as the database for Active Record
12
- gem 'sqlite3'
13
+ #gem 'sqlite3'
14
+ gem 'mysql2'
13
15
  # Use Puma as the app server
14
16
  gem 'puma', '~> 3.0'
15
17
  # Use SCSS for stylesheets
@@ -35,9 +37,12 @@ gem 'jbuilder', '~> 2.5'
35
37
  # Use Capistrano for deployment
36
38
  # gem 'capistrano-rails', group: :development
37
39
 
40
+ gem 'hyper-operation', path: '../..' # normally just get this from ruby gems
41
+
38
42
  group :development, :test do
39
43
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
40
44
  gem 'byebug', platform: :mri
45
+ gem 'hyper-console'
41
46
  end
42
47
 
43
48
  group :development do
@@ -47,7 +52,7 @@ group :development do
47
52
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
48
53
  gem 'spring'
49
54
  gem 'spring-watcher-listen', '~> 2.0.0'
50
- gem 'hyper-operation', path: '../..' # normally just get this from ruby gems
55
+ gem 'opal_hot_reloader'
51
56
  end
52
57
 
53
58
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- hyper-operation (0.5.1)
4
+ hyper-operation (0.5.5)
5
5
  activerecord (>= 0.3.0)
6
6
  hyper-component (>= 0.12.2)
7
- hyperloop-config (>= 0.9.2)
7
+ hyperloop-config (>= 0.9.7)
8
8
  mutations
9
9
  opal-activesupport
10
10
  pusher
@@ -13,46 +13,46 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- actioncable (5.0.1)
17
- actionpack (= 5.0.1)
18
- nio4r (~> 1.2)
16
+ actioncable (5.1.0.rc1)
17
+ actionpack (= 5.1.0.rc1)
18
+ nio4r (~> 2.0)
19
19
  websocket-driver (~> 0.6.1)
20
- actionmailer (5.0.1)
21
- actionpack (= 5.0.1)
22
- actionview (= 5.0.1)
23
- activejob (= 5.0.1)
20
+ actionmailer (5.1.0.rc1)
21
+ actionpack (= 5.1.0.rc1)
22
+ actionview (= 5.1.0.rc1)
23
+ activejob (= 5.1.0.rc1)
24
24
  mail (~> 2.5, >= 2.5.4)
25
25
  rails-dom-testing (~> 2.0)
26
- actionpack (5.0.1)
27
- actionview (= 5.0.1)
28
- activesupport (= 5.0.1)
26
+ actionpack (5.1.0.rc1)
27
+ actionview (= 5.1.0.rc1)
28
+ activesupport (= 5.1.0.rc1)
29
29
  rack (~> 2.0)
30
30
  rack-test (~> 0.6.3)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
33
- actionview (5.0.1)
34
- activesupport (= 5.0.1)
33
+ actionview (5.1.0.rc1)
34
+ activesupport (= 5.1.0.rc1)
35
35
  builder (~> 3.1)
36
- erubis (~> 2.7.0)
36
+ erubi (~> 1.4)
37
37
  rails-dom-testing (~> 2.0)
38
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
39
- activejob (5.0.1)
40
- activesupport (= 5.0.1)
38
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
39
+ activejob (5.1.0.rc1)
40
+ activesupport (= 5.1.0.rc1)
41
41
  globalid (>= 0.3.6)
42
- activemodel (5.0.1)
43
- activesupport (= 5.0.1)
44
- activerecord (5.0.1)
45
- activemodel (= 5.0.1)
46
- activesupport (= 5.0.1)
47
- arel (~> 7.0)
48
- activesupport (5.0.1)
42
+ activemodel (5.1.0.rc1)
43
+ activesupport (= 5.1.0.rc1)
44
+ activerecord (5.1.0.rc1)
45
+ activemodel (= 5.1.0.rc1)
46
+ activesupport (= 5.1.0.rc1)
47
+ arel (~> 8.0)
48
+ activesupport (5.1.0.rc1)
49
49
  concurrent-ruby (~> 1.0, >= 1.0.2)
50
50
  i18n (~> 0.7)
51
51
  minitest (~> 5.1)
52
52
  tzinfo (~> 1.1)
53
- addressable (2.5.0)
53
+ addressable (2.5.1)
54
54
  public_suffix (~> 2.0, >= 2.0.2)
55
- arel (7.1.4)
55
+ arel (8.0.0)
56
56
  babel-source (5.8.35)
57
57
  babel-transpiler (0.7.0)
58
58
  babel-source (>= 4.0, < 6)
@@ -66,7 +66,7 @@ GEM
66
66
  coffee-script-source
67
67
  execjs
68
68
  coffee-script-source (1.12.2)
69
- concurrent-ruby (1.0.4)
69
+ concurrent-ruby (1.0.5)
70
70
  connection_pool (2.2.1)
71
71
  cookiejar (0.3.3)
72
72
  daemons (1.2.4)
@@ -82,34 +82,37 @@ GEM
82
82
  em-websocket (0.5.1)
83
83
  eventmachine (>= 0.12.9)
84
84
  http_parser.rb (~> 0.6.0)
85
- erubis (2.7.0)
85
+ erubi (1.6.0)
86
86
  eventmachine (1.2.3)
87
87
  execjs (2.7.0)
88
88
  ffi (1.9.17)
89
- globalid (0.3.7)
90
- activesupport (>= 4.1.0)
89
+ globalid (0.4.0)
90
+ activesupport (>= 4.2.0)
91
91
  hike (1.2.3)
92
92
  http_parser.rb (0.6.0)
93
93
  httpclient (2.8.3)
94
- hyper-component (0.12.2)
95
- hyper-react (>= 0.12.0)
94
+ hyper-component (0.12.3)
95
+ hyper-react (>= 0.12.3)
96
96
  hyperloop-config (>= 0.9.2)
97
97
  opal-rails (~> 0.9.0)
98
98
  react-rails (< 1.10.0)
99
- hyper-react (0.12.2)
99
+ hyper-console (0.1.0)
100
+ hyper-operation
101
+ hyper-react (0.12.5)
100
102
  hyper-store (>= 0.2.1)
101
- hyperloop-config (>= 0.9.2)
103
+ hyperloop-config (>= 0.9.7)
102
104
  opal (>= 0.8.0)
103
105
  opal-activesupport (>= 0.2.0)
104
- hyper-store (0.2.1)
106
+ hyper-store (0.2.3)
105
107
  hyperloop-config (>= 0.9.2)
106
- hyperloop-config (0.9.2)
108
+ hyperloop-config (0.9.8)
107
109
  opal
110
+ opal-browser
108
111
  i18n (0.8.1)
109
112
  jbuilder (2.6.3)
110
113
  activesupport (>= 3.0.0, < 5.2)
111
114
  multi_json (~> 1.2)
112
- jquery-rails (4.2.2)
115
+ jquery-rails (4.3.1)
113
116
  rails-dom-testing (>= 1, < 3)
114
117
  railties (>= 4.2.0)
115
118
  thor (>= 0.14, < 2.0)
@@ -130,8 +133,9 @@ GEM
130
133
  multi_json (1.12.1)
131
134
  mutations (0.8.1)
132
135
  activesupport
133
- nio4r (1.2.1)
134
- nokogiri (1.7.0.1)
136
+ mysql2 (0.4.5)
137
+ nio4r (2.0.0)
138
+ nokogiri (1.7.1)
135
139
  mini_portile2 (~> 2.1.0)
136
140
  opal (0.10.3)
137
141
  hike (~> 1.2)
@@ -145,21 +149,24 @@ GEM
145
149
  paggio
146
150
  opal-jquery (0.4.2)
147
151
  opal (>= 0.7.0, < 0.11.0)
148
- opal-rails (0.9.1)
152
+ opal-rails (0.9.2)
149
153
  jquery-rails
150
154
  opal (>= 0.8.0, < 0.11)
151
155
  opal-activesupport (>= 0.0.5)
152
156
  opal-jquery (~> 0.4.0)
153
157
  opal-sprockets (~> 0.4.0)
154
- rails (>= 4.0, < 6.0)
155
- sprockets-rails (< 3.0)
158
+ rails (>= 4.1, < 6.0)
159
+ sprockets-rails (>= 2.3.3, < 4.0)
156
160
  opal-sprockets (0.4.0.0.10.0.3.0.0)
157
161
  opal (~> 0.10.0)
158
162
  sprockets (~> 3.0)
159
163
  tilt (>= 1.4)
164
+ opal_hot_reloader (0.1.4)
165
+ listen (~> 3.0)
166
+ websocket
160
167
  paggio (0.2.6)
161
168
  public_suffix (2.0.5)
162
- puma (3.7.1)
169
+ puma (3.8.2)
163
170
  pusher (1.3.1)
164
171
  httpclient (~> 2.7)
165
172
  multi_json (~> 1.0)
@@ -173,26 +180,26 @@ GEM
173
180
  rack (2.0.1)
174
181
  rack-test (0.6.3)
175
182
  rack (>= 1.0)
176
- rails (5.0.1)
177
- actioncable (= 5.0.1)
178
- actionmailer (= 5.0.1)
179
- actionpack (= 5.0.1)
180
- actionview (= 5.0.1)
181
- activejob (= 5.0.1)
182
- activemodel (= 5.0.1)
183
- activerecord (= 5.0.1)
184
- activesupport (= 5.0.1)
183
+ rails (5.1.0.rc1)
184
+ actioncable (= 5.1.0.rc1)
185
+ actionmailer (= 5.1.0.rc1)
186
+ actionpack (= 5.1.0.rc1)
187
+ actionview (= 5.1.0.rc1)
188
+ activejob (= 5.1.0.rc1)
189
+ activemodel (= 5.1.0.rc1)
190
+ activerecord (= 5.1.0.rc1)
191
+ activesupport (= 5.1.0.rc1)
185
192
  bundler (>= 1.3.0, < 2.0)
186
- railties (= 5.0.1)
193
+ railties (= 5.1.0.rc1)
187
194
  sprockets-rails (>= 2.0.0)
188
195
  rails-dom-testing (2.0.2)
189
196
  activesupport (>= 4.2.0, < 6.0)
190
197
  nokogiri (~> 1.6)
191
198
  rails-html-sanitizer (1.0.3)
192
199
  loofah (~> 2.0)
193
- railties (5.0.1)
194
- actionpack (= 5.0.1)
195
- activesupport (= 5.0.1)
200
+ railties (5.1.0.rc1)
201
+ actionpack (= 5.1.0.rc1)
202
+ activesupport (= 5.1.0.rc1)
196
203
  method_source
197
204
  rake (>= 0.8.7)
198
205
  thor (>= 0.18.1, < 2.0)
@@ -224,11 +231,10 @@ GEM
224
231
  sprockets (3.7.1)
225
232
  concurrent-ruby (~> 1.0)
226
233
  rack (> 1, < 3)
227
- sprockets-rails (2.3.3)
228
- actionpack (>= 3.0)
229
- activesupport (>= 3.0)
230
- sprockets (>= 2.8, < 4.0)
231
- sqlite3 (1.3.13)
234
+ sprockets-rails (3.2.0)
235
+ actionpack (>= 4.0)
236
+ activesupport (>= 4.0)
237
+ sprockets (>= 3.0.0)
232
238
  therubyracer (0.12.3)
233
239
  libv8 (~> 3.16.14.15)
234
240
  ref
@@ -238,11 +244,11 @@ GEM
238
244
  rack (>= 1, < 3)
239
245
  thor (0.19.4)
240
246
  thread_safe (0.3.6)
241
- tilt (2.0.6)
247
+ tilt (2.0.7)
242
248
  turbolinks (5.0.1)
243
249
  turbolinks-source (~> 5)
244
250
  turbolinks-source (5.0.0)
245
- tzinfo (1.2.2)
251
+ tzinfo (1.2.3)
246
252
  thread_safe (~> 0.1)
247
253
  uglifier (3.0.4)
248
254
  execjs (>= 0.3.0, < 3)
@@ -251,6 +257,7 @@ GEM
251
257
  activemodel (>= 5.0)
252
258
  debug_inspector
253
259
  railties (>= 5.0)
260
+ websocket (1.2.4)
254
261
  websocket-driver (0.6.5)
255
262
  websocket-extensions (>= 0.1.0)
256
263
  websocket-extensions (0.1.2)
@@ -261,17 +268,19 @@ PLATFORMS
261
268
  DEPENDENCIES
262
269
  byebug
263
270
  coffee-rails (~> 4.2)
271
+ hyper-console
264
272
  hyper-operation!
265
273
  jbuilder (~> 2.5)
266
274
  jquery-rails
267
275
  listen (~> 3.0.5)
276
+ mysql2
268
277
  opal-browser
278
+ opal_hot_reloader
269
279
  puma (~> 3.0)
270
- rails (~> 5.0.1)
280
+ rails (= 5.1.0.rc1)
271
281
  sass-rails (~> 5.0)
272
282
  spring
273
283
  spring-watcher-listen (~> 2.0.0)
274
- sqlite3
275
284
  therubyracer
276
285
  turbolinks (~> 5)
277
286
  tzinfo-data
@@ -1,3 +1,4 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
3
  //= require hyperloop-loader
4
+ Opal.OpalHotReloader.$listen(25222)
@@ -23,11 +23,11 @@ class App < React::Component::Base
23
23
  end
24
24
 
25
25
  def waiting_for_your_guess
26
- InputWord label: 'guess a word', button: 'guess', operation: Ops::Guess
26
+ InputWord label: 'Guess a word', button: 'guess', operation: Ops::Guess
27
27
  end
28
28
 
29
29
  def waiting_for_their_guess
30
- SPAN { 'waiting for the other player to guess...' }
30
+ SPAN { 'waiting for the other player to guess a word...' }
31
31
  end
32
32
 
33
33
  def waiting_for_a_clue_from_them
@@ -0,0 +1,3 @@
1
+ class Hyperloop::ApplicationPolicy
2
+ always_allow_connection unless Rails.env.production?
3
+ end
@@ -4,22 +4,43 @@
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
6
  #
7
+ # default: &default
8
+ # adapter: sqlite3
9
+ # pool: 5
10
+ # timeout: 5000
11
+ #
12
+ # development:
13
+ # <<: *default
14
+ # database: db/development.sqlite3
15
+ #
16
+ # # Warning: The database defined as "test" will be erased and
17
+ # # re-generated from your development database when you run "rake".
18
+ # # Do not set this db to the same as development or production.
19
+ # test:
20
+ # <<: *default
21
+ # database: db/test.sqlite3
22
+ #
23
+ # production:
24
+ # <<: *default
25
+ # database: db/production.sqlite3
26
+
27
+
7
28
  default: &default
8
- adapter: sqlite3
9
- pool: 5
10
- timeout: 5000
29
+ adapter: mysql2
30
+ encoding: utf8
31
+ username: root
32
+ password:
33
+ host: 127.0.0.1
34
+ port: 3306
11
35
 
12
36
  development:
13
37
  <<: *default
14
- database: db/development.sqlite3
38
+ database: development_five_letter_word_game
15
39
 
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
40
  test:
20
41
  <<: *default
21
- database: db/test.sqlite3
42
+ database: test_five_letter_word_game
22
43
 
23
44
  production:
24
45
  <<: *default
25
- database: db/production.sqlite3
46
+ database: production_five_letter_word_game
@@ -9,3 +9,7 @@ Rails.application.config.assets.version = '1.0'
9
9
  # Precompile additional assets.
10
10
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
11
  # Rails.application.config.assets.precompile += %w( search.js )
12
+
13
+ Rails.application.config.assets.precompile += %w( hyper-console-client.css )
14
+ Rails.application.config.assets.precompile += %w( hyper-console-client.min.js )
15
+ Rails.application.config.assets.precompile += %w( action_cable.js )
@@ -1,3 +1,19 @@
1
1
  Hyperloop.configuration do |config|
2
2
  config.transport = :action_cable
3
+ config.import 'opal_hot_reloader'
3
4
  end
5
+ # require 'pusher'
6
+ # require 'pusher-fake'
7
+ # Pusher.app_id = "MY_TEST_ID"
8
+ # Pusher.key = "MY_TEST_KEY"
9
+ # Pusher.secret = "MY_TEST_SECRET"
10
+ # require "pusher-fake/support/base"
11
+ #
12
+ # Hyperloop.configuration do |config|
13
+ # config.transport = :pusher
14
+ # config.opts = {
15
+ # app_id: Pusher.app_id,
16
+ # key: Pusher.key,
17
+ # secret: Pusher.secret
18
+ # }.merge(PusherFake.configuration.web_options)
19
+ # end
@@ -12,16 +12,16 @@
12
12
 
13
13
  ActiveRecord::Schema.define(version: 0) do
14
14
 
15
- create_table "hyperloop_connections", force: :cascade do |t|
16
- t.string "channel"
17
- t.string "session"
15
+ create_table "hyperloop_connections", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
+ t.string "channel"
17
+ t.string "session"
18
18
  t.datetime "created_at"
19
19
  t.datetime "expires_at"
20
20
  t.datetime "refresh_at"
21
21
  end
22
22
 
23
- create_table "hyperloop_queued_messages", force: :cascade do |t|
24
- t.text "data"
23
+ create_table "hyperloop_queued_messages", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
24
+ t.text "data"
25
25
  t.integer "connection_id"
26
26
  end
27
27
 
@@ -101,6 +101,7 @@ module Hyperloop
101
101
  # will remove the session from the list.
102
102
 
103
103
  prerender_footer do |controller|
104
+ next if Hyperloop.transport == :none
104
105
  if defined?(PusherFake)
105
106
  path = ::Rails.application.routes.routes.detect do |route|
106
107
  route.app == Hyperloop::Engine ||
@@ -145,16 +146,11 @@ module Hyperloop
145
146
  def self.get_queued_data(operation, channel = nil, opts = {})
146
147
  HTTP.get(polling_path(operation, channel), opts).then do |response|
147
148
  response.json.each do |data|
148
- #send "sync_#{update[0]}", update[1]
149
149
  sync_dispatch(data[1])
150
150
  end
151
151
  end
152
152
  end
153
153
 
154
- # called from ReactiveRecord::Base before_first_mount hook
155
- # to insure this is done first.
156
-
157
- ####### TODO TODO TODO make sure to provide a hook that calls reactive record base AFTER this.. (hey use the boot hook)
158
154
  def self.initialize_client_drivers_on_boot
159
155
 
160
156
  if RUBY_ENGINE == 'opal'
@@ -1,6 +1,7 @@
1
1
  module Hyperloop
2
2
  module AutoCreate
3
3
  def needs_init?
4
+ return false if Hyperloop.transport == :none
4
5
  return true unless connection.tables.include?(table_name)
5
6
  return false unless Hyperloop.on_server?
6
7
  return true if defined?(Rails::Server)
@@ -28,7 +28,7 @@ module Hyperloop
28
28
  application = begin
29
29
  Object.const_get('Application')
30
30
  rescue LoadError
31
- rescue NameError
31
+ rescue NameError => e
32
32
  raise e unless e.message =~ /uninitialized constant Application/
33
33
  end if policy
34
34
  if policy && !application
@@ -1,5 +1,5 @@
1
1
  module Hyperloop
2
2
  class Operation
3
- VERSION = '0.5.4'
3
+ VERSION = '0.5.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyper-operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - catmando
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mutations
@@ -429,6 +429,7 @@ files:
429
429
  - examples/five-letter-word-game/app/mailers/application_mailer.rb
430
430
  - examples/five-letter-word-game/app/models/application_record.rb
431
431
  - examples/five-letter-word-game/app/models/concerns/.keep
432
+ - examples/five-letter-word-game/app/policies/hyperloop/application_policy.rb
432
433
  - examples/five-letter-word-game/app/policies/user_policy.rb
433
434
  - examples/five-letter-word-game/app/views/layouts/application.html.erb
434
435
  - examples/five-letter-word-game/app/views/layouts/mailer.html.erb