jsonrpc2 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/jsonrpc2.gemspec +31 -29
  2. data/lib/jsonrpc2/version.rb +1 -1
  3. metadata +31 -29
@@ -5,39 +5,41 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ["Geoff Youngs"]
6
6
  gem.email = ["git@intersect-uk.co.uk"]
7
7
  gem.description = <<-EOD
8
- JSON-RPC2 server DSL - allows APIs to be created as mountable Rack applications
9
- with inline documentation, authentication and type checking.
8
+ == Description
9
+
10
+ A Rack compatible JSON-RPC2 server domain specific language (DSL) - allows JSONRPC APIs to be
11
+ defined as mountable Rack applications with inline documentation, authentication and type checking.
10
12
 
11
13
  e.g.
12
14
 
13
- class Calculator < JSONRPC2::Interface
14
- title "JSON-RPC2 Calculator"
15
- introduction "This interface allows basic maths calculations via JSON-RPC2"
16
- auth_with JSONRPC2::BasicAuth.new({'user' => 'secretword'})
17
-
18
- section 'Simple Ops' do
19
- desc 'Multiply two numbers'
20
- param 'a', 'Number', 'a'
21
- param 'b', 'Number', 'b'
22
- result 'Number', 'a * b'
23
- def mul args
24
- args['a'] * args['b']
25
- end
26
-
27
- desc 'Add numbers'
28
- example "Calculate 1 + 1 = 2", :params => { 'a' => 1, 'b' => 1}, :result => 2
29
-
30
- param 'a', 'Number', 'First number'
31
- param 'b', 'Number', 'Second number'
32
- optional 'c', 'Number', 'Third number'
33
- result 'Number', 'a + b + c'
34
- def sum args
35
- val = args['a'] + args['b']
36
- val += args['c'] if args['c']
37
- val
38
- end
15
+ class Calculator < JSONRPC2::Interface
16
+ title "JSON-RPC2 Calculator"
17
+ introduction "This interface allows basic maths calculations via JSON-RPC2"
18
+ auth_with JSONRPC2::BasicAuth.new({'user' => 'secretword'})
19
+
20
+ section 'Simple Ops' do
21
+ desc 'Multiply two numbers'
22
+ param 'a', 'Number', 'a'
23
+ param 'b', 'Number', 'b'
24
+ result 'Number', 'a * b'
25
+ def mul args
26
+ args['a'] * args['b']
27
+ end
28
+
29
+ desc 'Add numbers'
30
+ example "Calculate 1 + 1 = 2", :params => { 'a' => 1, 'b' => 1}, :result => 2
31
+
32
+ param 'a', 'Number', 'First number'
33
+ param 'b', 'Number', 'Second number'
34
+ optional 'c', 'Number', 'Third number'
35
+ result 'Number', 'a + b + c'
36
+ def sum args
37
+ val = args['a'] + args['b']
38
+ val += args['c'] if args['c']
39
+ val
40
+ end
41
+ end
39
42
  end
40
- end
41
43
 
42
44
  EOD
43
45
  gem.summary = %q{JSON-RPC2 server DSL}
@@ -1,5 +1,5 @@
1
1
  # JSONRPC2 namespace module
2
2
  module JSONRPC2
3
3
  # Version
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonrpc2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Geoff Youngs
@@ -60,39 +60,41 @@ dependencies:
60
60
  type: :development
61
61
  version_requirements: *id003
62
62
  description: |+
63
- JSON-RPC2 server DSL - allows APIs to be created as mountable Rack applications
64
- with inline documentation, authentication and type checking.
63
+ == Description
64
+
65
+ A Rack compatible JSON-RPC2 server domain specific language (DSL) - allows JSONRPC APIs to be
66
+ defined as mountable Rack applications with inline documentation, authentication and type checking.
65
67
 
66
68
  e.g.
67
69
 
68
- class Calculator < JSONRPC2::Interface
69
- title "JSON-RPC2 Calculator"
70
- introduction "This interface allows basic maths calculations via JSON-RPC2"
71
- auth_with JSONRPC2::BasicAuth.new({'user' => 'secretword'})
70
+ class Calculator < JSONRPC2::Interface
71
+ title "JSON-RPC2 Calculator"
72
+ introduction "This interface allows basic maths calculations via JSON-RPC2"
73
+ auth_with JSONRPC2::BasicAuth.new({'user' => 'secretword'})
72
74
 
73
- section 'Simple Ops' do
74
- desc 'Multiply two numbers'
75
- param 'a', 'Number', 'a'
76
- param 'b', 'Number', 'b'
77
- result 'Number', 'a * b'
78
- def mul args
79
- args['a'] * args['b']
80
- end
75
+ section 'Simple Ops' do
76
+ desc 'Multiply two numbers'
77
+ param 'a', 'Number', 'a'
78
+ param 'b', 'Number', 'b'
79
+ result 'Number', 'a * b'
80
+ def mul args
81
+ args['a'] * args['b']
82
+ end
81
83
 
82
- desc 'Add numbers'
83
- example "Calculate 1 + 1 = 2", :params => { 'a' => 1, 'b' => 1}, :result => 2
84
+ desc 'Add numbers'
85
+ example "Calculate 1 + 1 = 2", :params => { 'a' => 1, 'b' => 1}, :result => 2
84
86
 
85
- param 'a', 'Number', 'First number'
86
- param 'b', 'Number', 'Second number'
87
- optional 'c', 'Number', 'Third number'
88
- result 'Number', 'a + b + c'
89
- def sum args
90
- val = args['a'] + args['b']
91
- val += args['c'] if args['c']
92
- val
93
- end
87
+ param 'a', 'Number', 'First number'
88
+ param 'b', 'Number', 'Second number'
89
+ optional 'c', 'Number', 'Third number'
90
+ result 'Number', 'a + b + c'
91
+ def sum args
92
+ val = args['a'] + args['b']
93
+ val += args['c'] if args['c']
94
+ val
95
+ end
96
+ end
94
97
  end
95
- end
96
98
 
97
99
  email:
98
100
  - git@intersect-uk.co.uk