Orbjson 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,57 @@
1
+ #!/usr/local/bin/ruby
2
+ require 'webrick'
3
+
4
+ require "orbjson"
5
+ include WEBrick
6
+
7
+
8
+ Socket.do_not_reverse_lookup = true
9
+
10
+ $logger = Logger.new( "orbjson.log" )
11
+ $logger.level = Logger::DEBUG
12
+
13
+ s = HTTPServer.new( :Port => 2222,
14
+ :DocumentRoot => File.dirname( __FILE__ ) )
15
+
16
+ s.mount("/json-rpc", Orbjson::WEBrick_JSON_RPC )
17
+
18
+
19
+ # These mounts are a ahandy way to to kill a WEBrick instance via URL,
20
+ # useful mostly during debugging. Probably less useful when you've deployed
21
+ # the applicaton. Consider removing these before going live.
22
+ s.mount_proc( "/exit" ){|req, res| s.shutdown; exit; }
23
+ s.mount_proc( "/quit" ){|req, res| s.shutdown; exit; }
24
+
25
+
26
+ # You can configure the Orbjsn services list in a few ways.
27
+ # Well, three, really:
28
+ # 1. Pass in a path to a local YAML file; the path must begin with
29
+ # 'file://'
30
+ # For example: cfg = 'file://config.yaml'
31
+ # Orbjson::System.init( cfg )
32
+ #
33
+ # 2. Pass in some YAML:
34
+ # cfg = 'services/sample:
35
+ # - Details'
36
+ # Orbjson::System.init( cfg )
37
+ #
38
+ # 3. Pass in some an atual Hash objectL:
39
+ # cfg = { 'services/sample' => ['Details'] }
40
+ # Orbjson::System.init( cfg )
41
+ #
42
+ # The hash (however you express it) consists of 'require' paths mapped
43
+ # to arrays of classes to instantiate.
44
+
45
+
46
+ # Change this to suit your actual situation: If you use a configuration file,
47
+ # # mkae sure you have the correct name, path, and contents.
48
+ # This example expects to find the file config.yml in the same dir
49
+ # as server.rb
50
+ cfg = "file://config.yml"
51
+ Orbjson::System.init( cfg )
52
+
53
+
54
+ trap( "INT" ){ s.shutdown }
55
+ trap( 1 ){ s.shutdown }
56
+ s.start
57
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.6
3
3
  specification_version: 1
4
4
  name: Orbjson
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.2
7
- date: 2005-02-27
6
+ version: 0.0.3
7
+ date: 2005-02-28
8
8
  summary: Lib for creating JSON-RPC server applications.
9
9
  require_paths:
10
10
  - lib
@@ -35,33 +35,46 @@ files:
35
35
  - lib/skeleton/cgi
36
36
  - lib/skeleton/script
37
37
  - lib/skeleton/webrick
38
+ - lib/skeleton/cgi/json-rpc.rb,bak
38
39
  - lib/skeleton/cgi/json-rpc.rb
40
+ - lib/skeleton/script/jsonrpc.js,bak
39
41
  - lib/skeleton/script/jsonrpc.js
40
42
  - lib/skeleton/webrick/config.yml
43
+ - lib/skeleton/webrick/server.rb,bak
41
44
  - lib/skeleton/webrick/server.rb
42
45
  - examples/cgi
43
46
  - examples/webrick
44
47
  - examples/cgi/Orbjson.log
45
48
  - examples/cgi/httpd.conf
46
- - examples/cgi/index.html
47
- - examples/cgi/json-rpc.rb
48
49
  - examples/cgi/orbjson_cgi.log
49
50
  - examples/cgi/yellow_crossfade_01.gif
50
51
  - examples/cgi/script
51
52
  - examples/cgi/services
53
+ - examples/cgi/json-rpc.rb,bak
54
+ - examples/cgi/json-rpc.rb
55
+ - examples/cgi/index.html,bak
56
+ - examples/cgi/index.html
57
+ - examples/cgi/script/jsonrpc.js,bak
52
58
  - examples/cgi/script/jsonrpc.js
59
+ - examples/cgi/services/sample.rb,bak
53
60
  - examples/cgi/services/sample.rb
54
61
  - examples/webrick/config.yml
55
- - examples/webrick/index.html
56
- - examples/webrick/server.rb
57
62
  - examples/webrick/yellow_crossfade_01.gif
58
63
  - examples/webrick/script
59
64
  - examples/webrick/services
65
+ - examples/webrick/server.rb,bak
66
+ - examples/webrick/server.rb
67
+ - examples/webrick/index.html,bak
68
+ - examples/webrick/index.html
69
+ - examples/webrick/Orbjson.log
70
+ - examples/webrick/script/jsonrpc.js,bak
60
71
  - examples/webrick/script/jsonrpc.js
72
+ - examples/webrick/services/sample.rb,bak
61
73
  - examples/webrick/services/sample.rb
62
74
  - dep/handy
63
75
  - dep/required
64
76
  - dep/handy/script
77
+ - dep/handy/script/jsonrpc.js,bak
65
78
  - dep/handy/script/jsonrpc.js
66
79
  - dep/required/ruby-json
67
80
  - dep/required/ruby-json/ruby-json-1.1.1.gem