jsonrpc2 0.0.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/test.yml +26 -0
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +38 -0
- data/Dockerfile +8 -0
- data/README.markdown +36 -46
- data/bin/run-example +7 -0
- data/bin/setup +3 -0
- data/bin/test +7 -0
- data/example/config.ru +29 -24
- data/{bin → exe}/jsonrpc2 +0 -0
- data/jsonrpc2.gemspec +15 -3
- data/lib/assets/js/jquery-1.10.2.min.js +6 -0
- data/lib/jsonrpc2/html.rb +4 -3
- data/lib/jsonrpc2/interface.rb +333 -239
- data/lib/jsonrpc2/textile.rb +5 -5
- data/lib/jsonrpc2/types.rb +14 -10
- data/lib/jsonrpc2/version.rb +1 -1
- data/spec/lib/interface_spec.rb +162 -0
- data/spec/spec_helper.rb +94 -0
- metadata +136 -52
data/lib/jsonrpc2/html.rb
CHANGED
@@ -15,6 +15,7 @@ module JSONRPC2
|
|
15
15
|
<title>#{title}</title>
|
16
16
|
#{options[:head]}
|
17
17
|
<link rel="stylesheet" href="#{request.script_name}/_assets/css/bootstrap.min.css">
|
18
|
+
<script src="#{request.script_name}/_assets/js/jquery-1.10.2.min.js"></script>
|
18
19
|
<script src="#{request.script_name}/_assets/js/bootstrap.min.js"></script>
|
19
20
|
<style>
|
20
21
|
body {
|
@@ -22,7 +23,7 @@ module JSONRPC2
|
|
22
23
|
}
|
23
24
|
</style>
|
24
25
|
</head>
|
25
|
-
<body>
|
26
|
+
<body>
|
26
27
|
<div class="navbar navbar-fixed-top">
|
27
28
|
<div class="navbar-inner">
|
28
29
|
<div class="container">
|
@@ -100,7 +101,7 @@ EOM
|
|
100
101
|
end
|
101
102
|
else
|
102
103
|
body = RedCloth.new(interface.to_textile).to_html.gsub(/\<h3\>(.*?)\<\/h3\>/, '<h3><a href="'+request.script_name+'/\1">\1</a></h3>')
|
103
|
-
[200, {'Content-Type' => 'text/html'},
|
104
|
+
[200, {'Content-Type' => 'text/html'},
|
104
105
|
html5('Interface: '+interface.name.to_s, body, :request => request)]
|
105
106
|
end
|
106
107
|
end
|
@@ -171,7 +172,7 @@ EOS
|
|
171
172
|
url = CGI.unescapeHTML(str)[1...-1]
|
172
173
|
%Q["<a href="#{CGI.escapeHTML(url)}">#{CGI.escapeHTML(url)}</a>"]
|
173
174
|
end
|
174
|
-
rescue Exception
|
175
|
+
rescue Exception
|
175
176
|
CGI.escapeHTML(result.to_s)
|
176
177
|
end
|
177
178
|
end
|