rsence 2.0.0.0.pre → 2.0.0.1.pre
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/INSTALL.rdoc +15 -15
- data/README.rdoc +66 -3
- data/VERSION +1 -1
- data/bin/rsence +5 -101
- data/conf/config.yaml +4 -0
- data/conf/default_conf.yaml +5 -3
- data/conf/{local_conf.yaml → local_conf.yaml.devel} +0 -0
- data/lib/conf/argv.rb +664 -0
- data/lib/conf/default.rb +51 -52
- data/lib/daemon/daemon.rb +281 -195
- data/lib/plugins/pluginmanager.rb +5 -6
- data/lib/transporter/transporter.rb +5 -7
- data/plugins/client_pkg/client_pkg.rb +12 -9
- data/plugins/client_pkg/lib/client_pkg_build.rb +1 -1
- metadata +6 -18
- data/bin/build_client.rb +0 -254
- data/bin/help +0 -6
- data/bin/launch.rb +0 -120
- data/bin/rdoc.sh +0 -2
- data/bin/restart +0 -6
- data/bin/run +0 -6
- data/bin/run.rb +0 -6
- data/bin/save +0 -6
- data/bin/start +0 -6
- data/bin/status +0 -6
- data/bin/stop +0 -6
- data/var/db/.git_include +0 -0
- data/var/log/.git_include +0 -0
- data/var/run/.git_include +0 -0
metadata
CHANGED
@@ -6,9 +6,9 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 2
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
9
|
+
- 1
|
10
10
|
- pre
|
11
|
-
version: 2.0.0.
|
11
|
+
version: 2.0.0.1.pre
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Riassence Inc.
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-05-08 00:00:00 +03:00
|
20
20
|
default_executable: rsence
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -42,18 +42,8 @@ extensions: []
|
|
42
42
|
extra_rdoc_files: []
|
43
43
|
|
44
44
|
files:
|
45
|
-
- bin/build_client.rb
|
46
|
-
- bin/help
|
47
|
-
- bin/launch.rb
|
48
|
-
- bin/rdoc.sh
|
49
|
-
- bin/restart
|
50
45
|
- bin/rsence
|
51
|
-
-
|
52
|
-
- bin/run.rb
|
53
|
-
- bin/save
|
54
|
-
- bin/start
|
55
|
-
- bin/status
|
56
|
-
- bin/stop
|
46
|
+
- lib/conf/argv.rb
|
57
47
|
- lib/conf/default.rb
|
58
48
|
- lib/conf/wizard.rb
|
59
49
|
- lib/daemon/daemon.rb
|
@@ -77,9 +67,10 @@ files:
|
|
77
67
|
- lib/values/hvalue.rb
|
78
68
|
- lib/values/valuemanager.rb
|
79
69
|
- conf/config.ru
|
70
|
+
- conf/config.yaml
|
80
71
|
- conf/default_conf.yaml
|
81
72
|
- conf/default_strings.yaml
|
82
|
-
- conf/local_conf.yaml
|
73
|
+
- conf/local_conf.yaml.devel
|
83
74
|
- conf/unicorn.conf
|
84
75
|
- plugins/client_pkg/client_pkg.rb
|
85
76
|
- plugins/client_pkg/info.yaml
|
@@ -349,9 +340,6 @@ files:
|
|
349
340
|
- INSTALL.rdoc
|
350
341
|
- LICENSE
|
351
342
|
- VERSION
|
352
|
-
- var/run/.git_include
|
353
|
-
- var/log/.git_include
|
354
|
-
- var/db/.git_include
|
355
343
|
has_rdoc: true
|
356
344
|
homepage: http://www.rsence.org/
|
357
345
|
licenses: []
|
data/bin/build_client.rb
DELETED
@@ -1,254 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#--
|
3
|
-
## Riassence Framework
|
4
|
-
# Copyright 2010 Riassence Inc.
|
5
|
-
# http://riassence.com/
|
6
|
-
#
|
7
|
-
# You should have received a copy of the GNU General Public License along
|
8
|
-
# with this software package. If not, contact licensing@riassence.com
|
9
|
-
##
|
10
|
-
#++
|
11
|
-
|
12
|
-
if ARGV.include?('--help') or ARGV.include?('-h')
|
13
|
-
puts %{
|
14
|
-
|
15
|
-
Riassence Framework Client Builder
|
16
|
-
This script builds the client into the DESTINATION_PATH that defaults to ./client
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
#{__FILE__} [DESTINATION_PATH] [params]
|
20
|
-
|
21
|
-
Params:
|
22
|
-
-d Debug/Development mode
|
23
|
-
--config <PATH> Optional config override file
|
24
|
-
--auto Checks if the source has changed every 3 seconds
|
25
|
-
--help This message
|
26
|
-
-h This message
|
27
|
-
|
28
|
-
Examples:
|
29
|
-
#{__FILE__} /web/sites/my_site/rsence/client -d
|
30
|
-
|
31
|
-
Further information:
|
32
|
-
http://riassence.org/
|
33
|
-
|
34
|
-
}
|
35
|
-
exit
|
36
|
-
end
|
37
|
-
|
38
|
-
require 'profile' if ARGV.include?('--profile')
|
39
|
-
|
40
|
-
## Auto-construct paths using this file as the waypoint
|
41
|
-
SERVER_PATH = ARGV.include?('--root-path')?(ARGV[ARGV.index('--root-path')+1]):File.split(File.expand_path(File.dirname(__FILE__)))[0]
|
42
|
-
|
43
|
-
## Include server & lib in the search path
|
44
|
-
$LOAD_PATH << SERVER_PATH
|
45
|
-
$LOAD_PATH << File.join( SERVER_PATH, 'lib' )
|
46
|
-
|
47
|
-
require 'rubygems'
|
48
|
-
require 'yaml'
|
49
|
-
require 'json'
|
50
|
-
|
51
|
-
config = YAML.load( File.read( File.join( SERVER_PATH, 'conf', 'default_conf.yaml' ) ) )
|
52
|
-
|
53
|
-
## Create default local configuratation override file, if it does not exist:
|
54
|
-
local_config_file_paths = [
|
55
|
-
File.join(SERVER_PATH,'conf','local_conf.yaml'),
|
56
|
-
File.join( File.split( SERVER_PATH )[0], 'conf', 'local_conf.yaml' ),
|
57
|
-
File.join( Dir.pwd, 'conf', 'local_conf.yaml' ),
|
58
|
-
File.join(SERVER_PATH,'conf','client-build-config.rb'),
|
59
|
-
File.join( File.split( SERVER_PATH )[0], 'conf', 'client-build-config.rb' ),
|
60
|
-
File.join( Dir.pwd, 'conf', 'client-build-config.rb' ),
|
61
|
-
]
|
62
|
-
if ARGV.include?('--config')
|
63
|
-
argv_conf_file = ARGV[ARGV.index('--config')+1]
|
64
|
-
if not argv_conf_file.begin_with? '/'
|
65
|
-
argv_conf_file = File.join( Dir.pwd, conf_file )
|
66
|
-
end
|
67
|
-
local_config_file_paths.push( argv_conf_file )
|
68
|
-
end
|
69
|
-
|
70
|
-
def array_merge( target, source )
|
71
|
-
source.each do |item|
|
72
|
-
unless target.include?(item)
|
73
|
-
if item.class == Array
|
74
|
-
sub_arr = []
|
75
|
-
array_merge( sub_arr, item )
|
76
|
-
target.push( sub_arr )
|
77
|
-
elsif item.class == Hash
|
78
|
-
sub_hash = {}
|
79
|
-
hash_merge( sub_hash, item )
|
80
|
-
target.push( sub_hash )
|
81
|
-
else
|
82
|
-
target.push( item )
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
def hash_merge( target, source )
|
88
|
-
source.each do |key,item|
|
89
|
-
if not target.has_key?key or target[key] != item
|
90
|
-
if item.class == Array
|
91
|
-
target[key] = [] unless target.has_key?(key)
|
92
|
-
array_merge( target[key], item )
|
93
|
-
# if key == :plugin_paths
|
94
|
-
# puts target[key].inspect
|
95
|
-
# end
|
96
|
-
elsif item.class == Hash
|
97
|
-
target[key] = {} unless target.has_key?key
|
98
|
-
hash_merge( target[key], item )
|
99
|
-
else
|
100
|
-
target[key] = item
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
local_config_file_path_found = false
|
107
|
-
local_config_file_paths.each do |local_config_file_path|
|
108
|
-
if File.exists? local_config_file_path and File.file? local_config_file_path
|
109
|
-
if local_config_file_path.end_with? '.yaml'
|
110
|
-
local_conf = YAML.load( File.read( local_config_file_path ) )
|
111
|
-
hash_merge( config, local_conf )
|
112
|
-
local_config_file_path_found = true
|
113
|
-
else
|
114
|
-
warn "Only Yaml configuration files are allowed at this time."
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
|
120
|
-
require 'plugins/client_pkg/lib/client_pkg_build'
|
121
|
-
|
122
|
-
class JSBuilder < ClientPkgBuild
|
123
|
-
def initialize( conf, logger )
|
124
|
-
super
|
125
|
-
@conf = conf
|
126
|
-
@debug = ARGV.include?('-d')
|
127
|
-
@quiet = false
|
128
|
-
end
|
129
|
-
def flush
|
130
|
-
@jscompress.free_indexes
|
131
|
-
end
|
132
|
-
def ensure_client_dir
|
133
|
-
dst_dir = @conf[:dst_dir]
|
134
|
-
Dir.mkdir( dst_dir ) unless File.exist?( dst_dir )
|
135
|
-
js_dir = File.join( dst_dir, 'js' )
|
136
|
-
Dir.mkdir( js_dir ) unless File.exist?( js_dir )
|
137
|
-
themes_dir = File.join( dst_dir, 'themes' )
|
138
|
-
Dir.mkdir( themes_dir ) unless File.exist?( themes_dir )
|
139
|
-
@themes.each_key do |theme_name|
|
140
|
-
theme_dir = File.join( themes_dir, theme_name )
|
141
|
-
Dir.mkdir( theme_dir ) unless File.exist?( theme_dir )
|
142
|
-
['gfx','css','html'].each do |theme_part|
|
143
|
-
theme_part_dir = File.join( theme_dir, theme_part )
|
144
|
-
Dir.mkdir( theme_part_dir ) unless File.exist?( theme_part_dir )
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
def store_client_files
|
149
|
-
dst_dir = @conf[:dst_dir]
|
150
|
-
js_dir = File.join( dst_dir, 'js' )
|
151
|
-
@js.each_key do |js_name|
|
152
|
-
js_path = File.join( js_dir, "#{js_name}.js" )
|
153
|
-
js_file = File.open( js_path, 'wb' )
|
154
|
-
js_file.write( @js[js_name] )
|
155
|
-
js_file.close
|
156
|
-
end
|
157
|
-
@gz.each_key do |gz_name|
|
158
|
-
gz_path = File.join( js_dir, "#{gz_name}.gz" )
|
159
|
-
gz_file = File.open( gz_path, 'wb' )
|
160
|
-
gz_file.write( @gz[gz_name] )
|
161
|
-
gz_file.close
|
162
|
-
end
|
163
|
-
themes_dir = File.join( dst_dir, 'themes' )
|
164
|
-
@themes.each_key do |theme_name|
|
165
|
-
theme_dir = File.join( themes_dir, theme_name )
|
166
|
-
gfx_dir = File.join( theme_dir, 'gfx' )
|
167
|
-
@themes[theme_name][:gfx].each do | img_name, file_data |
|
168
|
-
img_path = File.join( gfx_dir, img_name )
|
169
|
-
img_file = File.open( img_path, 'wb' )
|
170
|
-
img_file.write( file_data )
|
171
|
-
img_file.close
|
172
|
-
end
|
173
|
-
css_dir = File.join( theme_dir, 'css' )
|
174
|
-
@themes[theme_name][:css].each do | css_name, file_data |
|
175
|
-
css_path = File.join( css_dir, "#{css_name}.css" )
|
176
|
-
css_file = File.open( css_path, 'wb' )
|
177
|
-
css_file.write( file_data )
|
178
|
-
css_file.close
|
179
|
-
css_path += '.gz'
|
180
|
-
css_file = File.open( css_path, 'wb' )
|
181
|
-
css_file.write( gzip_string( file_data ) )
|
182
|
-
css_file.close
|
183
|
-
end
|
184
|
-
html_dir = File.join( theme_dir, 'html' )
|
185
|
-
@themes[theme_name][:html].each do | html_name, file_data |
|
186
|
-
html_path = File.join( html_dir, "#{html_name}.html" )
|
187
|
-
html_file = File.open( html_path, 'wb' )
|
188
|
-
html_file.write( file_data )
|
189
|
-
html_file.close
|
190
|
-
html_path += '.gz'
|
191
|
-
html_file = File.open( html_path, 'wb' )
|
192
|
-
html_file.write( gzip_string( file_data ) )
|
193
|
-
html_file.close
|
194
|
-
end
|
195
|
-
end
|
196
|
-
built_path = File.join( js_dir, 'built' )
|
197
|
-
built_file = File.open( built_path, 'w' )
|
198
|
-
built_file.write( Time.now.to_i.to_s )
|
199
|
-
built_file.close
|
200
|
-
end
|
201
|
-
def run
|
202
|
-
ensure_client_dir
|
203
|
-
super
|
204
|
-
store_client_files
|
205
|
-
end
|
206
|
-
end
|
207
|
-
class Logger
|
208
|
-
def log( str )
|
209
|
-
puts str
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
conf = config[:client_pkg]
|
214
|
-
dst_dir = File.join( SERVER_PATH, 'client' )
|
215
|
-
if ARGV.length > 0
|
216
|
-
unless ['-d','-auto','--auto','-say','--config','--root-path'].include?( ARGV[0] )
|
217
|
-
dst_dir = ARGV[0]
|
218
|
-
unless dst_dir.start_with?('/')
|
219
|
-
dst_dir = File.join( SERVER_PATH, dst_dir )
|
220
|
-
end
|
221
|
-
end
|
222
|
-
end
|
223
|
-
puts "Client build destination directory: #{dst_dir}"
|
224
|
-
conf[:dst_dir] = dst_dir
|
225
|
-
|
226
|
-
conf[:compound_packages].each do | pkg_name, js_order |
|
227
|
-
pkg_files = []
|
228
|
-
js_order.each do |js_pkg|
|
229
|
-
unless conf[:packages].has_key?(js_pkg)
|
230
|
-
pkg_files.push( js_pkg )
|
231
|
-
next
|
232
|
-
end
|
233
|
-
conf[:packages][js_pkg].each do |js_file|
|
234
|
-
pkg_files.push( js_file )
|
235
|
-
end
|
236
|
-
end
|
237
|
-
conf[:packages][ pkg_name ] = pkg_files
|
238
|
-
end
|
239
|
-
|
240
|
-
js_builder = JSBuilder.new( conf, Logger.new )
|
241
|
-
js_builder.run
|
242
|
-
if ARGV.include? '-auto' or ARGV.include? '--auto'
|
243
|
-
last_change = Time.now.to_i
|
244
|
-
while true
|
245
|
-
if js_builder.bundle_changes( last_change )
|
246
|
-
last_change = Time.now.to_i
|
247
|
-
js_builder.run
|
248
|
-
# client_cache.set_cache( @client_build.js, @client_build.gz, @client_build.themes )
|
249
|
-
`say "Autobuild complete!"` if ARGV.include?('-say')
|
250
|
-
end
|
251
|
-
sleep 3
|
252
|
-
end
|
253
|
-
end
|
254
|
-
js_builder.flush
|
data/bin/help
DELETED
data/bin/launch.rb
DELETED
@@ -1,120 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#--
|
3
|
-
## Riassence Framework
|
4
|
-
# Copyright 2008 Riassence Inc.
|
5
|
-
# http://riassence.com/
|
6
|
-
#
|
7
|
-
# You should have received a copy of the GNU General Public License along
|
8
|
-
# with this software package. If not, contact licensing@riassence.com
|
9
|
-
##
|
10
|
-
#++
|
11
|
-
|
12
|
-
if RUBY_VERSION.to_f >= 1.9
|
13
|
-
Encoding.default_external = Encoding::ASCII_8BIT
|
14
|
-
end
|
15
|
-
|
16
|
-
is_win = ['i386-mingw32','x86-mingw32'].include? RUBY_PLATFORM
|
17
|
-
|
18
|
-
if is_win
|
19
|
-
commands = %w[help run]
|
20
|
-
else
|
21
|
-
commands = %w[help start stop restart status run]
|
22
|
-
end
|
23
|
-
|
24
|
-
if ARGV.include?('--help') or ARGV.include?('-h') or
|
25
|
-
ARGV.include?('help') or not (
|
26
|
-
commands.include?(ARGV[0])
|
27
|
-
)
|
28
|
-
|
29
|
-
if is_win
|
30
|
-
extra_cmd_help = ''
|
31
|
-
extra_cmd_examples = %{
|
32
|
-
#{__FILE__} run --log-fg
|
33
|
-
#{__FILE__} run -d
|
34
|
-
#{__FILE__} run --latency 150
|
35
|
-
#{__FILE__} run --server mongrel --port 8080 --addr 127.0.0.1
|
36
|
-
}
|
37
|
-
else
|
38
|
-
extra_cmd_help = %{\
|
39
|
-
status Tells if Riassence Framework Server is running or not
|
40
|
-
start Starts Riassence Framework Server
|
41
|
-
stop Stops Riassence Framework Server
|
42
|
-
restart Restarts Riassence Framework Server
|
43
|
-
save Saves Riassence Framework Server session data
|
44
|
-
}
|
45
|
-
extra_cmd_examples = %{\
|
46
|
-
#{__FILE__} status
|
47
|
-
#{__FILE__} start
|
48
|
-
#{__FILE__} stop
|
49
|
-
#{__FILE__} save
|
50
|
-
#{__FILE__} restart
|
51
|
-
#{__FILE__} restart -d --reset-sessions
|
52
|
-
#{__FILE__} restart --latency 150
|
53
|
-
#{__FILE__} restart --server mongrel --port 8080 --addr 127.0.0.1
|
54
|
-
}
|
55
|
-
end
|
56
|
-
|
57
|
-
puts %{
|
58
|
-
|
59
|
-
Riassence Framework is RIA client and server. This help message contains
|
60
|
-
hints about how to control the server startup/shutdown.
|
61
|
-
|
62
|
-
Usage:
|
63
|
-
#{__FILE__} command [params]
|
64
|
-
|
65
|
-
Command is one of:
|
66
|
-
run Run in foreground (exit with ctrl-c)
|
67
|
-
#{extra_cmd_help} help This message
|
68
|
-
|
69
|
-
Params:
|
70
|
-
--log-fg Don't write log into file (writes to foreground)
|
71
|
-
-d Debug/Development mode
|
72
|
-
--trace-js Write content of msg.reply calls to stdout
|
73
|
-
--trace-delegate Traces plugin method delegation to stdout
|
74
|
-
--root-path <PATH> Define the PATH to rsence server
|
75
|
-
Defaults to 'bin'
|
76
|
-
--port PORT Define the http PORT to use, defaults to '8001'
|
77
|
-
--latency MS Simulate network latency, value in milliseconds
|
78
|
-
--addr <ADDRESS> Define the IPv4 ADDRESS to bind to.
|
79
|
-
Defaults to '0.0.0.0' (any)
|
80
|
-
--server <SERVER> Choose http SERVER, valid choices:
|
81
|
-
- webrick
|
82
|
-
- mongrel
|
83
|
-
- ebb
|
84
|
-
- thin
|
85
|
-
Defaults to thin
|
86
|
-
--reset-sessions Deletes all old sessions on startup
|
87
|
-
--config <PATH> Optional config override file
|
88
|
-
--run-config-wizard Runs configuration wizard
|
89
|
-
Runs by default, if no local
|
90
|
-
configuration files were found.
|
91
|
-
--no-rescan Doesn't rescan the plugins even when in debug mode.
|
92
|
-
--profile Turns on profiling
|
93
|
-
- Runs everything considerable slower!
|
94
|
-
- Shown a table displaying the results on stop.
|
95
|
-
--help This message
|
96
|
-
-h This message
|
97
|
-
|
98
|
-
Examples:
|
99
|
-
#{__FILE__} run
|
100
|
-
#{extra_cmd_examples}
|
101
|
-
Further information:
|
102
|
-
http://riassence.org/
|
103
|
-
|
104
|
-
}
|
105
|
-
exit
|
106
|
-
end
|
107
|
-
|
108
|
-
require 'profile' if ARGV.include?('--profile')
|
109
|
-
|
110
|
-
## Auto-construct paths using this file as the waypoint
|
111
|
-
SERVER_PATH = ARGV.include?('--root-path')?(ARGV[ARGV.index('--root-path')+1]):File.split(File.expand_path(File.dirname(__FILE__)))[0]
|
112
|
-
|
113
|
-
## Include server & lib in the search path
|
114
|
-
$LOAD_PATH << SERVER_PATH
|
115
|
-
$LOAD_PATH << File.join( SERVER_PATH, 'lib' )
|
116
|
-
|
117
|
-
## Riassence Daemon controls
|
118
|
-
require 'daemon/daemon'
|
119
|
-
RSence::HTTPDaemon.daemonize
|
120
|
-
|
data/bin/rdoc.sh
DELETED
data/bin/restart
DELETED
data/bin/run
DELETED
data/bin/run.rb
DELETED
data/bin/save
DELETED
data/bin/start
DELETED
data/bin/status
DELETED
data/bin/stop
DELETED
data/var/db/.git_include
DELETED
File without changes
|
data/var/log/.git_include
DELETED
File without changes
|
data/var/run/.git_include
DELETED
File without changes
|