rsence-pre 2.2.0.28 → 2.2.0.29
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.
- data/VERSION +1 -1
- data/conf/default_conf.yaml +8 -6
- data/conf/rsence_command_strings.yaml +8 -6
- data/lib/rsence.rb +4 -4
- data/lib/rsence/argv.rb +218 -0
- data/lib/rsence/argv/argv_util.rb +58 -0
- data/lib/rsence/argv/env_check.rb +58 -0
- data/lib/rsence/argv/help_argv.rb +15 -0
- data/lib/rsence/argv/initenv_argv.rb +218 -0
- data/lib/rsence/argv/save_argv.rb +92 -0
- data/lib/rsence/argv/startup_argv.rb +118 -0
- data/lib/rsence/argv/status_argv.rb +132 -0
- data/lib/rsence/argv/test_port.rb +32 -0
- data/lib/{daemon → rsence}/daemon.rb +21 -6
- data/lib/{conf/default.rb → rsence/default_config.rb} +0 -1
- data/lib/{plugins → rsence}/dependencies.rb +0 -0
- data/lib/{util → rsence}/gzstring.rb +0 -0
- data/lib/rsence/http.rb +3 -0
- data/lib/{http → rsence/http}/broker.rb +12 -3
- data/lib/{http → rsence/http}/rackup.rb +0 -0
- data/lib/{http → rsence/http}/request.rb +0 -4
- data/lib/{http → rsence/http}/response.rb +0 -1
- data/lib/{session → rsence}/msg.rb +1 -1
- data/lib/{plugins → rsence}/pluginmanager.rb +2 -2
- data/lib/{plugins → rsence}/plugins.rb +7 -7
- data/lib/{plugins → rsence/plugins}/gui_plugin.rb +0 -0
- data/lib/{plugins → rsence/plugins}/guiparser.rb +0 -0
- data/lib/{plugins → rsence/plugins}/plugin.rb +0 -0
- data/lib/{plugins → rsence/plugins}/plugin_base.rb +0 -0
- data/lib/{plugins → rsence/plugins}/plugin_plugins.rb +0 -0
- data/lib/{plugins → rsence/plugins}/plugin_sqlite_db.rb +0 -0
- data/lib/{plugins → rsence/plugins}/servlet.rb +0 -0
- data/lib/{session → rsence}/sessionmanager.rb +2 -2
- data/lib/{session → rsence}/sessionstorage.rb +1 -1
- data/lib/{daemon → rsence}/sigcomm.rb +0 -0
- data/lib/{transporter → rsence}/transporter.rb +3 -3
- data/lib/{values/hvalue.rb → rsence/value.rb} +0 -0
- data/lib/{values → rsence}/valuemanager.rb +1 -1
- metadata +100 -91
- data/lib/conf/argv.rb +0 -842
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
module RSence
|
3
|
+
module ArgvUtil
|
4
|
+
|
5
|
+
# Tests, if the port on addr responds or refuses the connection.
|
6
|
+
# Automatically replaces '0.0.0.0' with '127.0.0.1'
|
7
|
+
def test_port( port, addr='127.0.0.1' )
|
8
|
+
require 'socket'
|
9
|
+
begin
|
10
|
+
addr = '127.0.0.1' if addr == '0.0.0.0'
|
11
|
+
if RUBY_VERSION.to_f >= 1.9
|
12
|
+
sock = TCPSocket.open( addr, port )
|
13
|
+
else
|
14
|
+
begin
|
15
|
+
sock = TCPsocket.open( addr, port )
|
16
|
+
rescue NameError => e
|
17
|
+
warn "TCPsocket not available, trying TCPSocket.."
|
18
|
+
sock = TCPSocket.open( addr, port )
|
19
|
+
end
|
20
|
+
end
|
21
|
+
sock.close
|
22
|
+
return true
|
23
|
+
rescue Errno::ECONNREFUSED
|
24
|
+
return false
|
25
|
+
rescue => e
|
26
|
+
warn e.inspect
|
27
|
+
return false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -11,10 +11,10 @@
|
|
11
11
|
require 'rubygems'
|
12
12
|
|
13
13
|
# Transporter is the top-level handler for calls coming from the javascript COMM.Transporter.
|
14
|
-
require '
|
14
|
+
require 'rsence/transporter'
|
15
15
|
|
16
16
|
# Broker routes requests to the correct handler
|
17
|
-
require 'http
|
17
|
+
require 'rsence/http'
|
18
18
|
|
19
19
|
|
20
20
|
module RSence
|
@@ -327,6 +327,7 @@ module RSence
|
|
327
327
|
Daemon.start_logging( self )
|
328
328
|
end
|
329
329
|
|
330
|
+
autosave_loop if RSence.config[:daemon][:autosave_interval] > 0
|
330
331
|
start_broker( conf )
|
331
332
|
|
332
333
|
end
|
@@ -350,6 +351,20 @@ module RSence
|
|
350
351
|
def port
|
351
352
|
RSence.config[:http_server][:port]
|
352
353
|
end
|
354
|
+
|
355
|
+
# Saves plugin and session state periodically
|
356
|
+
def autosave_loop
|
357
|
+
Thread.new do
|
358
|
+
Thread.pass
|
359
|
+
sleep RSence.config[:daemon][:autosave_interval]
|
360
|
+
while true
|
361
|
+
if @transporter.online?
|
362
|
+
save
|
363
|
+
end
|
364
|
+
sleep RSence.config[:daemon][:autosave_interval]
|
365
|
+
end
|
366
|
+
end
|
367
|
+
end
|
353
368
|
|
354
369
|
# Called by Controller#start, contains RSence-specific operations
|
355
370
|
def start
|
@@ -368,8 +383,8 @@ module RSence
|
|
368
383
|
|
369
384
|
Process.setsid
|
370
385
|
|
386
|
+
autosave_loop if RSence.config[:daemon][:autosave_interval] > 0
|
371
387
|
start_broker( conf )
|
372
|
-
|
373
388
|
yield @broker
|
374
389
|
|
375
390
|
end
|
@@ -410,11 +425,11 @@ module RSence
|
|
410
425
|
# Save state
|
411
426
|
def save
|
412
427
|
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- Saving state..."
|
413
|
-
transporter_state = @transporter.online?
|
414
|
-
@transporter.online = false
|
428
|
+
# transporter_state = @transporter.online?
|
429
|
+
# @transporter.online = false
|
415
430
|
@transporter.plugins.delegate(:flush)
|
416
431
|
@transporter.sessions.store_sessions
|
417
|
-
@transporter.online = transporter_state
|
432
|
+
# @transporter.online = transporter_state
|
418
433
|
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- State saved."
|
419
434
|
end
|
420
435
|
|
File without changes
|
File without changes
|
data/lib/rsence/http.rb
ADDED
@@ -10,10 +10,10 @@ require 'rubygems'
|
|
10
10
|
require 'rack'
|
11
11
|
|
12
12
|
## Minimally WEBrick -compatible response object
|
13
|
-
require 'http/response'
|
13
|
+
require 'rsence/http/response'
|
14
14
|
|
15
15
|
## Minimally WEBrick -compatible request object
|
16
|
-
require 'http/request'
|
16
|
+
require 'rsence/http/request'
|
17
17
|
|
18
18
|
module RSence
|
19
19
|
|
@@ -95,7 +95,16 @@ class Broker
|
|
95
95
|
sleep 0.2
|
96
96
|
end
|
97
97
|
puts "..#{host}:#{port} responds!" if ::RSence.args[:debug]
|
98
|
-
|
98
|
+
if host == '0.0.0.0' and Socket.respond_to?(:ip_address_list)
|
99
|
+
puts "RSence is online and responds on the addresses:"
|
100
|
+
Socket.ip_address_list.each do |if_addr|
|
101
|
+
if RSence.argv.test_port( port, if_addr.ip_address )
|
102
|
+
puts " http://#{if_addr.ip_address}:#{port}#{::RSence.config[:base_url]}"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
else
|
106
|
+
puts "RSence is online on the address http://#{host}:#{port}#{::RSence.config[:base_url]}"
|
107
|
+
end
|
99
108
|
@@transporter.online = true
|
100
109
|
end
|
101
110
|
|
File without changes
|
@@ -15,24 +15,24 @@ module RSence
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Contains the PluginBase module which has common methods for the bundle classes
|
18
|
-
require 'plugins/plugin_base'
|
18
|
+
require 'rsence/plugins/plugin_base'
|
19
19
|
|
20
20
|
# guiparser.rb contains the Yaml serializer for gui trees.
|
21
21
|
# It uses JSONRenderer on the client to build user interfaces.
|
22
|
-
require 'plugins/guiparser'
|
22
|
+
require 'rsence/plugins/guiparser'
|
23
23
|
|
24
24
|
# plugin_sqlite_db.rb contains automatic local sqlite database
|
25
25
|
# creation for a plugin that includes it.
|
26
|
-
require 'plugins/plugin_sqlite_db'
|
26
|
+
require 'rsence/plugins/plugin_sqlite_db'
|
27
27
|
|
28
28
|
# Interface for plugins in a plugin bundle
|
29
|
-
require 'plugins/plugin_plugins'
|
29
|
+
require 'rsence/plugins/plugin_plugins'
|
30
30
|
|
31
31
|
|
32
32
|
# Templates for the main plugin classes.
|
33
|
-
require 'plugins/plugin'
|
34
|
-
require 'plugins/gui_plugin'
|
35
|
-
require 'plugins/servlet'
|
33
|
+
require 'rsence/plugins/plugin'
|
34
|
+
require 'rsence/plugins/gui_plugin'
|
35
|
+
require 'rsence/plugins/servlet'
|
36
36
|
|
37
37
|
|
38
38
|
module RSence
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -14,13 +14,13 @@ module RSence
|
|
14
14
|
require 'json'
|
15
15
|
|
16
16
|
## Shared messaging-object:
|
17
|
-
require '
|
17
|
+
require 'rsence/msg'
|
18
18
|
|
19
19
|
## Unique random number generator:
|
20
20
|
require 'randgen'
|
21
21
|
|
22
22
|
## SessionStorage is the superclass of SessionManager
|
23
|
-
require '
|
23
|
+
require 'rsence/sessionstorage'
|
24
24
|
|
25
25
|
require 'digest/sha1'
|
26
26
|
|
@@ -14,7 +14,7 @@ module RSence
|
|
14
14
|
require 'sequel'
|
15
15
|
|
16
16
|
## HValue class for session restoration
|
17
|
-
require '
|
17
|
+
require 'rsence/value'
|
18
18
|
|
19
19
|
# SessionStorage doesn't do anything by itself, it's simply
|
20
20
|
# the superclass for SessionManager that does all the boring
|
File without changes
|
@@ -8,13 +8,13 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
# ValueManager synchronizes value objects
|
11
|
-
require '
|
11
|
+
require 'rsence/valuemanager'
|
12
12
|
|
13
13
|
# SessionManager creates, validates, stores and expires sessions
|
14
|
-
require '
|
14
|
+
require 'rsence/sessionmanager'
|
15
15
|
|
16
16
|
# PluginManager handles all the plugins
|
17
|
-
require '
|
17
|
+
require 'rsence/pluginmanager'
|
18
18
|
|
19
19
|
|
20
20
|
module RSence
|
File without changes
|
metadata
CHANGED
@@ -1,87 +1,110 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsence-pre
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.2.0.29
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
- 28
|
11
|
-
version: 2.2.0.28
|
12
6
|
platform: ruby
|
13
|
-
authors:
|
7
|
+
authors:
|
14
8
|
- Riassence Inc.
|
15
9
|
- Juha-Jarmo Heinonen
|
16
10
|
autorequire:
|
17
11
|
bindir: bin
|
18
12
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2011-11-30 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: rsence-deps
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70283801667420 !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 964
|
33
|
-
version: "964"
|
19
|
+
requirements:
|
20
|
+
- - =
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '965'
|
34
23
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70283801667420
|
26
|
+
description: ! 'RSence is a different and unique development model and software frameworks
|
27
|
+
designed first-hand for real-time web applications. RSence consists of separate,
|
28
|
+
but tigtly integrated data- and user interface frameworks.
|
29
|
+
|
30
|
+
|
39
31
|
RSence could be classified as a thin server - thick client system.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
The
|
48
|
-
|
49
|
-
|
50
|
-
|
32
|
+
|
33
|
+
|
34
|
+
Applications and submobules are installed as indepenent plugin bundles into the
|
35
|
+
plugins folder of a RSence environment, which in itself is a self-contained bundle.
|
36
|
+
A big part of RSence itself is implemented as shared plugin bundles.
|
37
|
+
|
38
|
+
|
39
|
+
The user interface framework of RSence is implemented in high-level user interface
|
40
|
+
widget classes. The widget classes share a common foundation API and access the
|
41
|
+
browser''s native API''s using an abstracted event- and element layer, which provides
|
42
|
+
exceptional cross-browser compatibility.
|
43
|
+
|
44
|
+
|
45
|
+
The data framework of RSence is a event-driven system, which synchronized shared
|
46
|
+
values between the client and server. It''s like a realtime bidirectional form-submission
|
47
|
+
engine that handles data changes intelligently. On the client, changed values trigger
|
48
|
+
events on user interface widgets. On the server, changed values trigger events on
|
49
|
+
value responder methods of server plugin modules. It doesn''t matter if the change
|
50
|
+
originates on client or server, it''s all synchronized and propagated automatically.
|
51
|
+
|
52
|
+
|
53
|
+
The server framework is implemented as a high-level, modular data-event-driven system,
|
54
|
+
which handles delegation of tasks impossible to implement using a client-only approach.
|
55
|
+
|
56
|
+
Client sessions are selectively connected to other client sessions and legacy back-ends
|
57
|
+
via the server by using the data framework.
|
58
|
+
|
59
|
+
|
60
|
+
The client is written in Javascript and the server is written in Ruby. The client
|
61
|
+
also supports CoffeeScript for custom logic. In many cases, no custom client logic
|
62
|
+
is needed; the user interfaces can be defined in tree-like data models. By default,
|
63
|
+
the models are parsed from YAML files, and other structured data formats are possible,
|
64
|
+
including XML, JSON, databases or any custom logic capable of producing similar
|
65
|
+
objects. The server can connect to custom environments and legacy backends accessible
|
66
|
+
on the server, including software written in other languages.'
|
51
67
|
email: info@rsence.org
|
52
|
-
executables:
|
68
|
+
executables:
|
53
69
|
- rsence-pre
|
54
70
|
extensions: []
|
55
|
-
|
56
71
|
extra_rdoc_files: []
|
57
|
-
|
58
|
-
|
59
|
-
- lib/
|
60
|
-
- lib/
|
61
|
-
- lib/
|
62
|
-
- lib/
|
63
|
-
- lib/
|
64
|
-
- lib/
|
65
|
-
- lib/
|
66
|
-
- lib/
|
67
|
-
- lib/
|
68
|
-
- lib/
|
69
|
-
- lib/
|
70
|
-
- lib/
|
71
|
-
- lib/
|
72
|
-
- lib/
|
73
|
-
- lib/
|
74
|
-
- lib/
|
75
|
-
- lib/
|
76
|
-
- lib/
|
72
|
+
files:
|
73
|
+
- lib/rsence/argv/argv_util.rb
|
74
|
+
- lib/rsence/argv/env_check.rb
|
75
|
+
- lib/rsence/argv/help_argv.rb
|
76
|
+
- lib/rsence/argv/initenv_argv.rb
|
77
|
+
- lib/rsence/argv/save_argv.rb
|
78
|
+
- lib/rsence/argv/startup_argv.rb
|
79
|
+
- lib/rsence/argv/status_argv.rb
|
80
|
+
- lib/rsence/argv/test_port.rb
|
81
|
+
- lib/rsence/argv.rb
|
82
|
+
- lib/rsence/daemon.rb
|
83
|
+
- lib/rsence/default_config.rb
|
84
|
+
- lib/rsence/dependencies.rb
|
85
|
+
- lib/rsence/gzstring.rb
|
86
|
+
- lib/rsence/http/broker.rb
|
87
|
+
- lib/rsence/http/rackup.rb
|
88
|
+
- lib/rsence/http/request.rb
|
89
|
+
- lib/rsence/http/response.rb
|
90
|
+
- lib/rsence/http.rb
|
91
|
+
- lib/rsence/msg.rb
|
92
|
+
- lib/rsence/pluginmanager.rb
|
93
|
+
- lib/rsence/plugins/gui_plugin.rb
|
94
|
+
- lib/rsence/plugins/guiparser.rb
|
95
|
+
- lib/rsence/plugins/plugin.rb
|
96
|
+
- lib/rsence/plugins/plugin_base.rb
|
97
|
+
- lib/rsence/plugins/plugin_plugins.rb
|
98
|
+
- lib/rsence/plugins/plugin_sqlite_db.rb
|
99
|
+
- lib/rsence/plugins/servlet.rb
|
100
|
+
- lib/rsence/plugins.rb
|
101
|
+
- lib/rsence/sessionmanager.rb
|
102
|
+
- lib/rsence/sessionstorage.rb
|
103
|
+
- lib/rsence/sigcomm.rb
|
104
|
+
- lib/rsence/transporter.rb
|
105
|
+
- lib/rsence/value.rb
|
106
|
+
- lib/rsence/valuemanager.rb
|
77
107
|
- lib/rsence.rb
|
78
|
-
- lib/session/msg.rb
|
79
|
-
- lib/session/sessionmanager.rb
|
80
|
-
- lib/session/sessionstorage.rb
|
81
|
-
- lib/transporter/transporter.rb
|
82
|
-
- lib/util/gzstring.rb
|
83
|
-
- lib/values/hvalue.rb
|
84
|
-
- lib/values/valuemanager.rb
|
85
108
|
- setup/welcome/gui/welcome.yaml
|
86
109
|
- setup/welcome/info.yaml
|
87
110
|
- setup/welcome/text/welcome.html
|
@@ -333,42 +356,28 @@ files:
|
|
333
356
|
- .yardopts
|
334
357
|
- bin/rsence-pre
|
335
358
|
homepage: http://www.rsence.org/
|
336
|
-
licenses:
|
359
|
+
licenses:
|
337
360
|
- GPL-3
|
338
361
|
post_install_message:
|
339
362
|
rdoc_options: []
|
340
|
-
|
341
|
-
require_paths:
|
363
|
+
require_paths:
|
342
364
|
- lib
|
343
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
365
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
344
366
|
none: false
|
345
|
-
requirements:
|
346
|
-
- -
|
347
|
-
- !ruby/object:Gem::Version
|
348
|
-
hash: 57
|
349
|
-
segments:
|
350
|
-
- 1
|
351
|
-
- 8
|
352
|
-
- 7
|
367
|
+
requirements:
|
368
|
+
- - ! '>='
|
369
|
+
- !ruby/object:Gem::Version
|
353
370
|
version: 1.8.7
|
354
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
371
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
355
372
|
none: false
|
356
|
-
requirements:
|
357
|
-
- -
|
358
|
-
- !ruby/object:Gem::Version
|
359
|
-
hash: 25
|
360
|
-
segments:
|
361
|
-
- 1
|
362
|
-
- 3
|
363
|
-
- 1
|
373
|
+
requirements:
|
374
|
+
- - ! '>'
|
375
|
+
- !ruby/object:Gem::Version
|
364
376
|
version: 1.3.1
|
365
377
|
requirements: []
|
366
|
-
|
367
378
|
rubyforge_project: rsence-
|
368
379
|
rubygems_version: 1.8.10
|
369
380
|
signing_key:
|
370
381
|
specification_version: 3
|
371
382
|
summary: Pre-Release 2.2 version of RSence.
|
372
383
|
test_files: []
|
373
|
-
|
374
|
-
has_rdoc:
|