rsence-pre 2.2.0.28 → 2.2.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/VERSION +1 -1
  2. data/conf/default_conf.yaml +8 -6
  3. data/conf/rsence_command_strings.yaml +8 -6
  4. data/lib/rsence.rb +4 -4
  5. data/lib/rsence/argv.rb +218 -0
  6. data/lib/rsence/argv/argv_util.rb +58 -0
  7. data/lib/rsence/argv/env_check.rb +58 -0
  8. data/lib/rsence/argv/help_argv.rb +15 -0
  9. data/lib/rsence/argv/initenv_argv.rb +218 -0
  10. data/lib/rsence/argv/save_argv.rb +92 -0
  11. data/lib/rsence/argv/startup_argv.rb +118 -0
  12. data/lib/rsence/argv/status_argv.rb +132 -0
  13. data/lib/rsence/argv/test_port.rb +32 -0
  14. data/lib/{daemon → rsence}/daemon.rb +21 -6
  15. data/lib/{conf/default.rb → rsence/default_config.rb} +0 -1
  16. data/lib/{plugins → rsence}/dependencies.rb +0 -0
  17. data/lib/{util → rsence}/gzstring.rb +0 -0
  18. data/lib/rsence/http.rb +3 -0
  19. data/lib/{http → rsence/http}/broker.rb +12 -3
  20. data/lib/{http → rsence/http}/rackup.rb +0 -0
  21. data/lib/{http → rsence/http}/request.rb +0 -4
  22. data/lib/{http → rsence/http}/response.rb +0 -1
  23. data/lib/{session → rsence}/msg.rb +1 -1
  24. data/lib/{plugins → rsence}/pluginmanager.rb +2 -2
  25. data/lib/{plugins → rsence}/plugins.rb +7 -7
  26. data/lib/{plugins → rsence/plugins}/gui_plugin.rb +0 -0
  27. data/lib/{plugins → rsence/plugins}/guiparser.rb +0 -0
  28. data/lib/{plugins → rsence/plugins}/plugin.rb +0 -0
  29. data/lib/{plugins → rsence/plugins}/plugin_base.rb +0 -0
  30. data/lib/{plugins → rsence/plugins}/plugin_plugins.rb +0 -0
  31. data/lib/{plugins → rsence/plugins}/plugin_sqlite_db.rb +0 -0
  32. data/lib/{plugins → rsence/plugins}/servlet.rb +0 -0
  33. data/lib/{session → rsence}/sessionmanager.rb +2 -2
  34. data/lib/{session → rsence}/sessionstorage.rb +1 -1
  35. data/lib/{daemon → rsence}/sigcomm.rb +0 -0
  36. data/lib/{transporter → rsence}/transporter.rb +3 -3
  37. data/lib/{values/hvalue.rb → rsence/value.rb} +0 -0
  38. data/lib/{values → rsence}/valuemanager.rb +1 -1
  39. metadata +100 -91
  40. 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 'transporter/transporter'
14
+ require 'rsence/transporter'
15
15
 
16
16
  # Broker routes requests to the correct handler
17
- require 'http/broker'
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
 
@@ -12,7 +12,6 @@ require 'rack'
12
12
  require 'yaml'
13
13
 
14
14
 
15
-
16
15
  module RSence
17
16
 
18
17
 
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+
2
+ require 'rsence/http/broker'
3
+
@@ -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
- puts "RSence is online on the address http://#{host}:#{port}#{::RSence.config[:base_url]}"
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
@@ -7,10 +7,6 @@
7
7
  ##
8
8
 
9
9
 
10
-
11
- require 'rubygems'
12
- require 'rack'
13
-
14
10
  module RSence
15
11
 
16
12
  # Simple Request class, slightly more involved
@@ -7,7 +7,6 @@
7
7
  ##
8
8
 
9
9
 
10
-
11
10
  module RSence
12
11
 
13
12
  # Classic WEBrick -compatible Response object for Rack.
@@ -7,7 +7,7 @@
7
7
  ##
8
8
 
9
9
 
10
- require 'util/gzstring'
10
+ require 'rsence/gzstring'
11
11
 
12
12
 
13
13
  module RSence
@@ -7,8 +7,8 @@
7
7
  ##
8
8
 
9
9
 
10
- require 'plugins/plugins'
11
- require 'plugins/dependencies'
10
+ require 'rsence/plugins'
11
+ require 'rsence/dependencies'
12
12
 
13
13
  module RSence
14
14
 
@@ -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 'session/msg'
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 'session/sessionstorage'
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 'values/hvalue'
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 'values/valuemanager'
11
+ require 'rsence/valuemanager'
12
12
 
13
13
  # SessionManager creates, validates, stores and expires sessions
14
- require 'session/sessionmanager'
14
+ require 'rsence/sessionmanager'
15
15
 
16
16
  # PluginManager handles all the plugins
17
- require 'plugins/pluginmanager'
17
+ require 'rsence/pluginmanager'
18
18
 
19
19
 
20
20
  module RSence
File without changes
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
  # Require needed value types (hvalue supports bool/float/int/string)
12
- require 'values/hvalue'
12
+ require 'rsence/value'
13
13
 
14
14
  # RandomGenerator produces unique, random values
15
15
  require 'randgen'
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
- hash: 71
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
- date: 2011-11-29 00:00:00 Z
21
- dependencies:
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
- prerelease: false
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
- hash: 1931
31
- segments:
32
- - 964
33
- version: "964"
19
+ requirements:
20
+ - - =
21
+ - !ruby/object:Gem::Version
22
+ version: '965'
34
23
  type: :runtime
35
- version_requirements: *id001
36
- description: |-
37
- RSence is a different and unique development model and software frameworks designed first-hand for real-time web applications. RSence consists of separate, but tigtly integrated data- and user interface frameworks.
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
- Applications and submobules are installed as indepenent plugin bundles into the plugins folder of a RSence environment, which in itself is a self-contained bundle. A big part of RSence itself is implemented as shared plugin bundles.
42
-
43
- The user interface framework of RSence is implemented in high-level user interface widget classes. The widget classes share a common foundation API and access the browser's native API's using an abstracted event- and element layer, which provides exceptional cross-browser compatibility.
44
-
45
- The data framework of RSence is a event-driven system, which synchronized shared values between the client and server. It's like a realtime bidirectional form-submission engine that handles data changes intelligently. On the client, changed values trigger events on user interface widgets. On the server, changed values trigger events on value responder methods of server plugin modules. It doesn't matter if the change originates on client or server, it's all synchronized and propagated automatically.
46
-
47
- The server framework is implemented as a high-level, modular data-event-driven system, which handles delegation of tasks impossible to implement using a client-only approach.
48
- Client sessions are selectively connected to other client sessions and legacy back-ends via the server by using the data framework.
49
-
50
- The client is written in Javascript and the server is written in Ruby. The client also supports CoffeeScript for custom logic. In many cases, no custom client logic is needed; the user interfaces can be defined in tree-like data models. By default, the models are parsed from YAML files, and other structured data formats are possible, including XML, JSON, databases or any custom logic capable of producing similar objects. The server can connect to custom environments and legacy backends accessible on the server, including software written in other languages.
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
- files:
59
- - lib/conf/argv.rb
60
- - lib/conf/default.rb
61
- - lib/daemon/daemon.rb
62
- - lib/daemon/sigcomm.rb
63
- - lib/http/broker.rb
64
- - lib/http/rackup.rb
65
- - lib/http/request.rb
66
- - lib/http/response.rb
67
- - lib/plugins/dependencies.rb
68
- - lib/plugins/gui_plugin.rb
69
- - lib/plugins/guiparser.rb
70
- - lib/plugins/plugin.rb
71
- - lib/plugins/plugin_base.rb
72
- - lib/plugins/plugin_plugins.rb
73
- - lib/plugins/plugin_sqlite_db.rb
74
- - lib/plugins/pluginmanager.rb
75
- - lib/plugins/plugins.rb
76
- - lib/plugins/servlet.rb
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: