rsence-pre 2.2.0.14 → 2.2.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +2 -0
- data/README.rdoc +22 -21
- data/VERSION +1 -1
- data/js/core/rsence_ns/rsence_ns.coffee +19 -0
- data/js/core/rsence_ns/rsence_ns.js +4 -6
- data/js/no_pkg/no_pkg.js +2 -0
- data/lib/plugins/guiparser.rb +2 -0
- data/lib/session/msg.rb +6 -0
- data/plugins/client_pkg/client_pkg.rb +4 -0
- data/plugins/client_pkg/lib/client_pkg_build.rb +34 -8
- metadata +24 -18
- data/bin/rsence +0 -25
data/INSTALL.rdoc
CHANGED
@@ -120,6 +120,8 @@ This not only enables SessionStorage (persistent sessions between RSence restart
|
|
120
120
|
* *rake*[http://rake.rubyforge.org]
|
121
121
|
* Ruby build tool
|
122
122
|
* Not necessarily required via ruby gems, if installed via a system-level package
|
123
|
+
* *coffee-script*[https://github.com/josh/ruby-coffee-script]
|
124
|
+
* Ruby library for .coffee -> .js compliation
|
123
125
|
* *rack*[http://rack.rubyforge.org]
|
124
126
|
* Abstract ruby web server interface
|
125
127
|
* A rack handler is also required. One of the following is suggested:
|
data/README.rdoc
CHANGED
@@ -3,19 +3,28 @@
|
|
3
3
|
|
4
4
|
== Introduction
|
5
5
|
|
6
|
-
RSence is a
|
6
|
+
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.
|
7
7
|
|
8
|
-
|
8
|
+
RSence could be classified as a thin server - thick client system.
|
9
9
|
|
10
|
-
|
10
|
+
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.
|
11
11
|
|
12
|
+
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.
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
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.
|
15
|
+
|
16
|
+
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.
|
17
|
+
Client sessions are selectively connected to other client sessions and legacy back-ends via the server by using the data framework.
|
18
|
+
|
19
|
+
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.
|
20
|
+
|
21
|
+
|
22
|
+
== Installing RSence
|
23
|
+
Just run this command in the shell, if you have functioning ruby environment installed. Otherwise, read the {file:INSTALL Install Guide} for full installation instructions.
|
15
24
|
gem install rsence
|
16
25
|
|
17
26
|
|
18
|
-
== Initializing a new
|
27
|
+
== Initializing a new RSence environment
|
19
28
|
|
20
29
|
The +init+ command will create a directory called `env_dir` in this example. It asks a few questions about the environment. Use a path and project name that matches your purposes.
|
21
30
|
rsence init /home/me/rsence_projects/env_dir
|
@@ -89,26 +98,18 @@ For more detailed installation and usage instructions, read the {file:INSTALL In
|
|
89
98
|
|
90
99
|
=== The bleeding edge (for developers)
|
91
100
|
RSence comes in two varieties:
|
92
|
-
1. rsence : The stable
|
93
|
-
2. rsence-pre : The active development snapshot
|
94
|
-
|
95
|
-
Both varieties can be installed simultaneously and it's suggested to use
|
96
|
-
the stable "rsence" package for production installations and to use the
|
97
|
-
"rsence-pre" package for development purposes, because the RSence crew
|
98
|
-
can't possibly test each and every application available. It's your
|
99
|
-
responsibility as a developer to report any RSence issues effecting your
|
100
|
-
software. The sooner reported, the better; it ensures better release
|
101
|
-
versions.
|
101
|
+
1. rsence : The stable release intended for running in production environments.
|
102
|
+
2. rsence-pre : The active development snapshot intended for develoment environments. Runtime-wise, it's nearly as stable as the stable version, but features are constantly added and sometimes changed.
|
102
103
|
|
103
|
-
To use "rsence-pre", install the "rsence-pre" gem and use the "rsence-pre"
|
104
|
-
command instead of the "rsence" command.
|
104
|
+
To use "rsence-pre", install the "rsence-pre" gem and use the "rsence-pre" instead of "rsence" command-line tool.
|
105
105
|
|
106
106
|
=== Licensing and commercial support options
|
107
107
|
* {file:LICENSE.txt *GPL*} version 3 by default.
|
108
108
|
* Riassence[http://riassence.com/] Inc. provides commercial support, custom licensing arrangements and various other services.
|
109
109
|
|
110
110
|
=== Community support
|
111
|
-
* http://rsence.org
|
112
|
-
* IRC channel +#rsence+ on the
|
113
|
-
|
111
|
+
* http://rsence.org/
|
112
|
+
* IRC channel +#rsence+ on the FreeNode IRC network
|
114
113
|
|
114
|
+
=== Keywords:
|
115
|
+
HTML5 Javascript CoffeeScript Ruby RIA Server Client Data-Driven Event-Driven Web Framework
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.0.
|
1
|
+
2.2.0.15.pre
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
# The RSence namespace
|
3
|
+
RSence =
|
4
|
+
|
5
|
+
# Call this method from the index page to
|
6
|
+
# setup the environment variables and to
|
7
|
+
# start synchronizing immediately afterwards.
|
8
|
+
serverConf: (_clientPrefix, _helloUrl) ->
|
9
|
+
COMM.ClientPrefix = _clientPrefix
|
10
|
+
COMM.Transporter.HelloUrl = _helloUrl
|
11
|
+
HThemeManager.themePath = _clientPrefix+'/themes'
|
12
|
+
HThemeManager._start()
|
13
|
+
COMM.AutoSyncStarter.start()
|
14
|
+
null
|
15
|
+
|
16
|
+
# Storage for guiTrees, cantains
|
17
|
+
# JSONRenderer instances by plugin name.
|
18
|
+
guiTrees: {}
|
19
|
+
|
@@ -6,12 +6,10 @@
|
|
6
6
|
* with this software package. If not, contact licensing@riassence.com
|
7
7
|
*/
|
8
8
|
|
9
|
-
// RSence namespace
|
10
|
-
//
|
11
|
-
|
12
|
-
|
13
|
-
// Additional logic for handling the namespaces will however be required.
|
14
|
-
var RSence = {
|
9
|
+
// RSence client-side namespace initialization.
|
10
|
+
// Current contents are a store for guiTrees and the serverConf method for setting up variables before starting.
|
11
|
+
var
|
12
|
+
RSence = {
|
15
13
|
|
16
14
|
// Configuration method for the html document of the server
|
17
15
|
serverConf: function(_clientPrefix,_helloUrl){
|
data/js/no_pkg/no_pkg.js
ADDED
data/lib/plugins/guiparser.rb
CHANGED
@@ -112,6 +112,8 @@ module RSence
|
|
112
112
|
return get_params( sym_arr, params )
|
113
113
|
elsif data_class == String and gui_data.strip.start_with?('function(')
|
114
114
|
return @parent.plugins[:client_pkg].squeeze( "a="+json_fun( gui_data.to_json ) )[2..-1]
|
115
|
+
elsif data_class == String and gui_data.strip.start_with?('coffee:')
|
116
|
+
return @parent.plugins[:client_pkg].coffee( gui_data.strip[7..-1], true )
|
115
117
|
end
|
116
118
|
return gui_data
|
117
119
|
end
|
data/lib/session/msg.rb
CHANGED
@@ -286,6 +286,12 @@ module RSence
|
|
286
286
|
puts data if @config[:trace]
|
287
287
|
@buffer.push( data )
|
288
288
|
end
|
289
|
+
|
290
|
+
# Same as #reply, but with CoffeeScript instead of JS
|
291
|
+
def coffee(data)
|
292
|
+
puts data if @config[:trace]
|
293
|
+
@buffer.push( @plugins[:client_pkg].coffee( data ) )
|
294
|
+
end
|
289
295
|
|
290
296
|
# @private For value manager; insert changed values BEFORE other js.
|
291
297
|
def reply_value( operation_type, value_id, data=nil )
|
@@ -12,8 +12,10 @@ require 'jscompress'
|
|
12
12
|
require 'html_min'
|
13
13
|
begin
|
14
14
|
require 'coffee-script'
|
15
|
+
RSence.config[:client_pkg][:coffee_supported] = true
|
15
16
|
rescue LoadError
|
16
17
|
warn "CoffeeScript not installed. Install the 'coffee-script' gem to enable."
|
18
|
+
RSence.config[:client_pkg][:coffee_supported] = false
|
17
19
|
end
|
18
20
|
|
19
21
|
|
@@ -124,12 +126,11 @@ class ClientPkgBuild
|
|
124
126
|
end
|
125
127
|
tgt_hash_gfx = tgt_hash_theme[:gfx]
|
126
128
|
gfx_size = read_gfx( src_path_theme, tgt_hash_gfx )
|
127
|
-
puts "gfx size of #{bundle_name}: #{gfx_size.inspect}"
|
128
129
|
@theme_sizes[ theme_name ][:gfx] += gfx_size
|
129
130
|
end
|
130
131
|
end
|
131
132
|
|
132
|
-
def add_bundle( bundle_name, bundle_path, entries, has_coffee=false )
|
133
|
+
def add_bundle( bundle_name, bundle_path, entries, has_js=false, has_coffee=false )
|
133
134
|
has_themes = entries.include?( 'themes' ) and File.directory?( File.join( bundle_path, 'themes' ) )
|
134
135
|
if @bundles_found.has_key?( bundle_name )
|
135
136
|
@logger.log( "JSBuilder ERROR: duplicate bundles with the name #{bundle_name.inspect} found." )
|
@@ -142,8 +143,21 @@ class ClientPkgBuild
|
|
142
143
|
warn "JSBuilder WARNING: bundle name #{bundle_name.inspect} does not belong to any package, skipping.." if ARGV.include?('-d')
|
143
144
|
return true
|
144
145
|
end
|
145
|
-
if has_coffee
|
146
|
-
|
146
|
+
if has_coffee and @coffee_supported
|
147
|
+
begin
|
148
|
+
coffee_path = File.join( bundle_path, bundle_name+'.coffee' )
|
149
|
+
coffee_src = read_file( coffee_path )
|
150
|
+
js_data = CoffeeScript.compile( coffee_src, :bare => true )
|
151
|
+
rescue CoffeeScript::CompilationError
|
152
|
+
if has_js
|
153
|
+
js_data = %{console.log( "WARNING: CoffeeScript complilation failed for source file #{coffee_path}, using the js variant instead." );}
|
154
|
+
js_data += read_file( File.join( bundle_path, bundle_name+'.js' ) )
|
155
|
+
else
|
156
|
+
js_data = %{console.log( "WARNING: CoffeeScript complilation failed for source file #{coffee_path}" );}
|
157
|
+
end
|
158
|
+
end
|
159
|
+
elsif not has_js
|
160
|
+
js_data = %{console.log( "ERROR: CoffeeScript not suuported and no JS source available for #{bundle_path}" );}
|
147
161
|
else
|
148
162
|
js_data = read_file( File.join( bundle_path, bundle_name+'.js' ) )
|
149
163
|
end
|
@@ -168,12 +182,12 @@ class ClientPkgBuild
|
|
168
182
|
dir_name = File.split( src_dir )[1]
|
169
183
|
# bundles are defined as directories with a js file of the same name plus the 'js.inc' tagfile
|
170
184
|
not_disabled = ( not dir_entries.include?( 'disabled' ) )
|
171
|
-
has_js = dir_entries.include?( dir_name+'.js' )
|
172
|
-
has_coffee = dir_entries.include?( dir_name+'.coffee' )
|
185
|
+
has_js = dir_entries.include?( dir_name+'.js' )
|
186
|
+
has_coffee = dir_entries.include?( dir_name+'.coffee' )
|
173
187
|
is_bundle = not_disabled and ( has_js or has_coffee )
|
174
188
|
# if src_dir is detected as a bundle, handle it in add_bundle
|
175
189
|
if is_bundle
|
176
|
-
add_bundle( dir_name, src_dir, dir_entries, has_coffee )
|
190
|
+
add_bundle( dir_name, src_dir, dir_entries, has_js, has_coffee )
|
177
191
|
end
|
178
192
|
# descend into the sub-directory:
|
179
193
|
dir_entries.each do | dir_entry |
|
@@ -225,7 +239,7 @@ class ClientPkgBuild
|
|
225
239
|
end
|
226
240
|
end
|
227
241
|
|
228
|
-
def squeeze( js )
|
242
|
+
def squeeze( js, is_coffee=false )
|
229
243
|
unless @no_whitespace_removal
|
230
244
|
begin
|
231
245
|
js = @jsmin.minimize( js )#.strip
|
@@ -240,6 +254,16 @@ class ClientPkgBuild
|
|
240
254
|
return js.strip
|
241
255
|
end
|
242
256
|
|
257
|
+
def coffee( src )
|
258
|
+
begin
|
259
|
+
js = CoffeeScript.compile( src, :bare => true )
|
260
|
+
rescue CoffeeScript::CompilationError
|
261
|
+
warn "Invalid CoffeeScript supplied:\n----\n#{src}----\n"
|
262
|
+
js = "function(){console.log('ERROR; invalid CoffeeScript supplied: #{src.to_json}');}"
|
263
|
+
end
|
264
|
+
return squeeze( js )
|
265
|
+
end
|
266
|
+
|
243
267
|
def process_js( src_in )
|
244
268
|
if @debug
|
245
269
|
return src_in
|
@@ -494,6 +518,8 @@ class ClientPkgBuild
|
|
494
518
|
|
495
519
|
def initialize( config, logger )
|
496
520
|
|
521
|
+
@coffee_supported = config[:coffee_supported]
|
522
|
+
|
497
523
|
@logger = logger
|
498
524
|
|
499
525
|
# src_dirs is supposed to be an array of js source directories
|
metadata
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsence-pre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 97
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 2.2.0.
|
10
|
+
- 15
|
11
|
+
version: 2.2.0.15
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Riassence Inc.
|
15
|
+
- Juha-Jarmo Heinonen
|
15
16
|
autorequire:
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2011-07-
|
20
|
+
date: 2011-07-27 00:00:00 Z
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
23
|
name: rsence-deps
|
@@ -26,23 +27,27 @@ dependencies:
|
|
26
27
|
requirements:
|
27
28
|
- - "="
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
30
|
+
hash: 1931
|
30
31
|
segments:
|
31
|
-
-
|
32
|
-
version: "
|
32
|
+
- 964
|
33
|
+
version: "964"
|
33
34
|
type: :runtime
|
34
35
|
version_requirements: *id001
|
35
|
-
description:
|
36
|
-
RSence is a
|
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.
|
37
38
|
|
38
|
-
RSence
|
39
|
+
RSence could be classified as a thin server - thick client system.
|
39
40
|
|
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.
|
41
42
|
|
42
|
-
The
|
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.
|
43
44
|
|
44
|
-
RSence is
|
45
|
-
|
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.
|
46
51
|
email: info@rsence.org
|
47
52
|
executables:
|
48
53
|
- rsence-pre
|
@@ -51,7 +56,6 @@ extensions: []
|
|
51
56
|
extra_rdoc_files: []
|
52
57
|
|
53
58
|
files:
|
54
|
-
- bin/rsence
|
55
59
|
- lib/conf/argv.rb
|
56
60
|
- lib/conf/default.rb
|
57
61
|
- lib/daemon/daemon.rb
|
@@ -236,6 +240,7 @@ files:
|
|
236
240
|
- js/core/iefix/ie_css_element.htc
|
237
241
|
- js/core/iefix/ie_css_style.htc
|
238
242
|
- js/core/iefix/iefix.js
|
243
|
+
- js/core/rsence_ns/rsence_ns.coffee
|
239
244
|
- js/core/rsence_ns/rsence_ns.js
|
240
245
|
- js/datetime/calendar/calendar.js
|
241
246
|
- js/datetime/calendar/themes/default/calendar.css
|
@@ -302,6 +307,7 @@ files:
|
|
302
307
|
- js/menus/popupmenu/themes/default/popupmenu.css
|
303
308
|
- js/menus/popupmenu/themes/default/popupmenu.html
|
304
309
|
- js/menus/popupmenu/themes/default/popupmenu.png
|
310
|
+
- js/no_pkg/no_pkg.js
|
305
311
|
- js/util/reloadapp/reloadapp.js
|
306
312
|
- js/util/reloadapp/themes/default/reloadapp_warning-ie6.gif
|
307
313
|
- js/util/reloadapp/themes/default/reloadapp_warning.png
|
@@ -321,8 +327,8 @@ files:
|
|
321
327
|
- .yardopts
|
322
328
|
- bin/rsence-pre
|
323
329
|
homepage: http://www.rsence.org/
|
324
|
-
licenses:
|
325
|
-
|
330
|
+
licenses:
|
331
|
+
- GPL-3
|
326
332
|
post_install_message:
|
327
333
|
rdoc_options: []
|
328
334
|
|
@@ -356,6 +362,6 @@ rubyforge_project: rsence-
|
|
356
362
|
rubygems_version: 1.8.5
|
357
363
|
signing_key:
|
358
364
|
specification_version: 3
|
359
|
-
summary: Pre-Release 2.2 version of
|
365
|
+
summary: Pre-Release 2.2 version of RSence.
|
360
366
|
test_files: []
|
361
367
|
|
data/bin/rsence
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
## RSence
|
3
|
-
# Copyright 2010 Riassence Inc.
|
4
|
-
# http://riassence.com/
|
5
|
-
#
|
6
|
-
# You should have received a copy of the GNU General Public License along
|
7
|
-
# with this software package. If not, contact licensing@riassence.com
|
8
|
-
##
|
9
|
-
|
10
|
-
|
11
|
-
require 'profile' if ARGV.include?('--profile')
|
12
|
-
|
13
|
-
# @private Auto-construct paths using this file as the waypoint
|
14
|
-
SERVER_PATH = File.split( File.expand_path(File.dirname(__FILE__)) )[0]
|
15
|
-
|
16
|
-
# Include server & lib in the search path
|
17
|
-
$LOAD_PATH << SERVER_PATH
|
18
|
-
$LOAD_PATH << File.join( SERVER_PATH, 'lib' )
|
19
|
-
|
20
|
-
require 'rsence'
|
21
|
-
|
22
|
-
# Start RSence, if the command supplied was one of the ones
|
23
|
-
# triggering a start and the environment is ok.
|
24
|
-
RSence.startup if RSence.startable?
|
25
|
-
|