Orbjson 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/dep/handy/script/jsonrpc.js +187 -187
- data/dep/handy/script/jsonrpc.js,bak +187 -0
- data/examples/cgi/index.html +71 -71
- data/examples/cgi/index.html,bak +71 -0
- data/examples/cgi/json-rpc.rb +34 -34
- data/examples/cgi/json-rpc.rb,bak +34 -0
- data/examples/cgi/script/jsonrpc.js +187 -187
- data/examples/cgi/script/jsonrpc.js,bak +187 -0
- data/examples/cgi/services/sample.rb +21 -21
- data/examples/cgi/services/sample.rb,bak +21 -0
- data/examples/webrick/Orbjson.log +49 -0
- data/examples/webrick/index.html +69 -69
- data/examples/webrick/index.html,bak +69 -0
- data/examples/webrick/script/jsonrpc.js +187 -187
- data/examples/webrick/script/jsonrpc.js,bak +187 -0
- data/examples/webrick/server.rb +28 -28
- data/examples/webrick/server.rb,bak +28 -0
- data/examples/webrick/services/sample.rb +21 -21
- data/examples/webrick/services/sample.rb,bak +21 -0
- data/lib/skeleton/cgi/json-rpc.rb +60 -60
- data/lib/skeleton/cgi/json-rpc.rb,bak +60 -0
- data/lib/skeleton/script/jsonrpc.js +187 -187
- data/lib/skeleton/script/jsonrpc.js,bak +187 -0
- data/lib/skeleton/webrick/server.rb +57 -57
- data/lib/skeleton/webrick/server.rb,bak +57 -0
- metadata +19 -6
data/examples/cgi/index.html
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
-
<title>Metatagging</title>
|
6
|
-
<script type="text/javascript" src="script/jsonrpc.js"></script>
|
7
|
-
<script language="javascript" type="text/javascript">
|
8
|
-
<!-- Make sure this URL makes sense for your set-up -->
|
9
|
-
var jsonurl = "http://127.0.0.1/orbjson/json-rpc.rb";
|
10
|
-
|
11
|
-
var jsonrpc = null;
|
12
|
-
|
13
|
-
function init() {
|
14
|
-
jsonrpc = new JSONRpcClient( jsonurl );
|
15
|
-
}
|
16
|
-
|
17
|
-
function show_details( topic ) {
|
18
|
-
var el = document.getElementById( 'details' );
|
19
|
-
var html = jsonrpc.details.fetch( topic)
|
20
|
-
el.innerHTML = html;
|
21
|
-
}
|
22
|
-
|
23
|
-
</script>
|
24
|
-
|
25
|
-
<style type="text/css">
|
26
|
-
#metatagFields #reset {
|
27
|
-
text-align: right;
|
28
|
-
}
|
29
|
-
body {
|
30
|
-
font-family: Verdana, Arial, Helvetica, sans-serif;
|
31
|
-
color: #666666;
|
32
|
-
}
|
33
|
-
a {
|
34
|
-
text-decoration: none;
|
35
|
-
}
|
36
|
-
|
37
|
-
fieldset {
|
38
|
-
background-image: url(yellow_crossfade_01.gif);
|
39
|
-
background-repeat: repeat-y;
|
40
|
-
background-position: left top;
|
41
|
-
}
|
42
|
-
|
43
|
-
#metatagFields {
|
44
|
-
width: 300px;
|
45
|
-
margin-top: 10px;
|
46
|
-
}
|
47
|
-
|
48
|
-
#metatagFields legend {
|
49
|
-
background-color: #FFFFFF;
|
50
|
-
border: 1px dashed #333333;
|
51
|
-
}
|
52
|
-
</style>
|
53
|
-
|
54
|
-
</head>
|
55
|
-
<body onload='init()' >
|
56
|
-
|
57
|
-
<div id='instructions'>Select a topic to seee more about it</div>
|
58
|
-
<div id='curentItemList'>
|
59
|
-
<a href='javascript:show_details( "JSON")'>JSON</a>, <a href='javascript:show_details( "JSON-RPC")'>JSON-RPC</a>, <a href='javascript:show_details( "Ruby")' >Ruby</a>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id='currentSelectionSet'>
|
63
|
-
<form name='metatagForm' action='#' method="get">
|
64
|
-
<fieldset id='metatagFields'>
|
65
|
-
<legend>Topic info</legend>
|
66
|
-
<div id='details'></div>
|
67
|
-
</fieldset>
|
68
|
-
</form>
|
69
|
-
</div>
|
70
|
-
</body>
|
71
|
-
</html>
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title>Metatagging</title>
|
6
|
+
<script type="text/javascript" src="script/jsonrpc.js"></script>
|
7
|
+
<script language="javascript" type="text/javascript">
|
8
|
+
<!-- Make sure this URL makes sense for your set-up -->
|
9
|
+
var jsonurl = "http://127.0.0.1/orbjson/json-rpc.rb";
|
10
|
+
|
11
|
+
var jsonrpc = null;
|
12
|
+
|
13
|
+
function init() {
|
14
|
+
jsonrpc = new JSONRpcClient( jsonurl );
|
15
|
+
}
|
16
|
+
|
17
|
+
function show_details( topic ) {
|
18
|
+
var el = document.getElementById( 'details' );
|
19
|
+
var html = jsonrpc.details.fetch( topic)
|
20
|
+
el.innerHTML = html;
|
21
|
+
}
|
22
|
+
|
23
|
+
</script>
|
24
|
+
|
25
|
+
<style type="text/css">
|
26
|
+
#metatagFields #reset {
|
27
|
+
text-align: right;
|
28
|
+
}
|
29
|
+
body {
|
30
|
+
font-family: Verdana, Arial, Helvetica, sans-serif;
|
31
|
+
color: #666666;
|
32
|
+
}
|
33
|
+
a {
|
34
|
+
text-decoration: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
fieldset {
|
38
|
+
background-image: url(yellow_crossfade_01.gif);
|
39
|
+
background-repeat: repeat-y;
|
40
|
+
background-position: left top;
|
41
|
+
}
|
42
|
+
|
43
|
+
#metatagFields {
|
44
|
+
width: 300px;
|
45
|
+
margin-top: 10px;
|
46
|
+
}
|
47
|
+
|
48
|
+
#metatagFields legend {
|
49
|
+
background-color: #FFFFFF;
|
50
|
+
border: 1px dashed #333333;
|
51
|
+
}
|
52
|
+
</style>
|
53
|
+
|
54
|
+
</head>
|
55
|
+
<body onload='init()' >
|
56
|
+
|
57
|
+
<div id='instructions'>Select a topic to seee more about it</div>
|
58
|
+
<div id='curentItemList'>
|
59
|
+
<a href='javascript:show_details( "JSON")'>JSON</a>, <a href='javascript:show_details( "JSON-RPC")'>JSON-RPC</a>, <a href='javascript:show_details( "Ruby")' >Ruby</a>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id='currentSelectionSet'>
|
63
|
+
<form name='metatagForm' action='#' method="get">
|
64
|
+
<fieldset id='metatagFields'>
|
65
|
+
<legend>Topic info</legend>
|
66
|
+
<div id='details'></div>
|
67
|
+
</fieldset>
|
68
|
+
</form>
|
69
|
+
</div>
|
70
|
+
</body>
|
71
|
+
</html>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title>Metatagging</title>
|
6
|
+
<script type="text/javascript" src="script/jsonrpc.js"></script>
|
7
|
+
<script language="javascript" type="text/javascript">
|
8
|
+
<!-- Make sure this URL makes sense for your set-up -->
|
9
|
+
var jsonurl = "http://127.0.0.1/orbjson/json-rpc.rb";
|
10
|
+
|
11
|
+
var jsonrpc = null;
|
12
|
+
|
13
|
+
function init() {
|
14
|
+
jsonrpc = new JSONRpcClient( jsonurl );
|
15
|
+
}
|
16
|
+
|
17
|
+
function show_details( topic ) {
|
18
|
+
var el = document.getElementById( 'details' );
|
19
|
+
var html = jsonrpc.details.fetch( topic)
|
20
|
+
el.innerHTML = html;
|
21
|
+
}
|
22
|
+
|
23
|
+
</script>
|
24
|
+
|
25
|
+
<style type="text/css">
|
26
|
+
#metatagFields #reset {
|
27
|
+
text-align: right;
|
28
|
+
}
|
29
|
+
body {
|
30
|
+
font-family: Verdana, Arial, Helvetica, sans-serif;
|
31
|
+
color: #666666;
|
32
|
+
}
|
33
|
+
a {
|
34
|
+
text-decoration: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
fieldset {
|
38
|
+
background-image: url(yellow_crossfade_01.gif);
|
39
|
+
background-repeat: repeat-y;
|
40
|
+
background-position: left top;
|
41
|
+
}
|
42
|
+
|
43
|
+
#metatagFields {
|
44
|
+
width: 300px;
|
45
|
+
margin-top: 10px;
|
46
|
+
}
|
47
|
+
|
48
|
+
#metatagFields legend {
|
49
|
+
background-color: #FFFFFF;
|
50
|
+
border: 1px dashed #333333;
|
51
|
+
}
|
52
|
+
</style>
|
53
|
+
|
54
|
+
</head>
|
55
|
+
<body onload='init()' >
|
56
|
+
|
57
|
+
<div id='instructions'>Select a topic to seee more about it</div>
|
58
|
+
<div id='curentItemList'>
|
59
|
+
<a href='javascript:show_details( "JSON")'>JSON</a>, <a href='javascript:show_details( "JSON-RPC")'>JSON-RPC</a>, <a href='javascript:show_details( "Ruby")' >Ruby</a>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id='currentSelectionSet'>
|
63
|
+
<form name='metatagForm' action='#' method="get">
|
64
|
+
<fieldset id='metatagFields'>
|
65
|
+
<legend>Topic info</legend>
|
66
|
+
<div id='details'></div>
|
67
|
+
</fieldset>
|
68
|
+
</form>
|
69
|
+
</div>
|
70
|
+
</body>
|
71
|
+
</html>
|
data/examples/cgi/json-rpc.rb
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
2
|
-
|
3
|
-
|
4
|
-
require 'cgi'
|
5
|
-
require 'rubygems'
|
6
|
-
require "orbjson"
|
7
|
-
require 'logger'
|
8
|
-
|
9
|
-
include Orbjson
|
10
|
-
|
11
|
-
|
12
|
-
$logger = Logger.new( "orbjson_cgi.log" )
|
13
|
-
$logger.level = Logger::DEBUG
|
14
|
-
|
15
|
-
$logger.debug( "Have a request!" )
|
16
|
-
|
17
|
-
# You can config the
|
18
|
-
cfg = 'services/sample:
|
19
|
-
- Details'
|
20
|
-
json_rpc = CGI_JSON_RPC.new( cfg )
|
21
|
-
|
22
|
-
print "content-type: text/javascript\n\n"
|
23
|
-
res = json_rpc.process_request
|
24
|
-
$logger.debug( "Have a resposne:\n#{res}" )
|
25
|
-
|
26
|
-
print res
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
|
3
|
+
|
4
|
+
require 'cgi'
|
5
|
+
require 'rubygems'
|
6
|
+
require "orbjson"
|
7
|
+
require 'logger'
|
8
|
+
|
9
|
+
include Orbjson
|
10
|
+
|
11
|
+
|
12
|
+
$logger = Logger.new( "orbjson_cgi.log" )
|
13
|
+
$logger.level = Logger::DEBUG
|
14
|
+
|
15
|
+
$logger.debug( "Have a request!" )
|
16
|
+
|
17
|
+
# You can config the
|
18
|
+
cfg = 'services/sample:
|
19
|
+
- Details'
|
20
|
+
json_rpc = CGI_JSON_RPC.new( cfg )
|
21
|
+
|
22
|
+
print "content-type: text/javascript\n\n"
|
23
|
+
res = json_rpc.process_request
|
24
|
+
$logger.debug( "Have a resposne:\n#{res}" )
|
25
|
+
|
26
|
+
print res
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
|
3
|
+
|
4
|
+
require 'cgi'
|
5
|
+
require 'rubygems'
|
6
|
+
require "orbjson"
|
7
|
+
require 'logger'
|
8
|
+
|
9
|
+
include Orbjson
|
10
|
+
|
11
|
+
|
12
|
+
$logger = Logger.new( "orbjson_cgi.log" )
|
13
|
+
$logger.level = Logger::DEBUG
|
14
|
+
|
15
|
+
$logger.debug( "Have a request!" )
|
16
|
+
|
17
|
+
# You can config the
|
18
|
+
cfg = 'services/sample:
|
19
|
+
- Details'
|
20
|
+
json_rpc = CGI_JSON_RPC.new( cfg )
|
21
|
+
|
22
|
+
print "content-type: text/javascript\n\n"
|
23
|
+
res = json_rpc.process_request
|
24
|
+
$logger.debug( "Have a resposne:\n#{res}" )
|
25
|
+
|
26
|
+
print res
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|