snapi 0.0.5 → 0.0.6
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/CHANGELOG +2 -0
- data/Gemfile.lock +13 -13
- data/README.md +1 -1
- data/lib/snapi/argument.rb +4 -1
- data/lib/snapi/sinatra_extension.rb +1 -3
- data/lib/snapi/version.rb +1 -1
- data/spec/basic_capability_spec.rb +2 -2
- metadata +1 -1
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
backports (3.3.
|
5
|
-
coderay (1.0
|
6
|
-
diff-lcs (1.2.
|
4
|
+
backports (3.3.5)
|
5
|
+
coderay (1.1.0)
|
6
|
+
diff-lcs (1.2.5)
|
7
7
|
method_source (0.8.2)
|
8
|
-
multi_json (1.8.
|
9
|
-
pry (0.9.12.
|
10
|
-
coderay (~> 1.0
|
8
|
+
multi_json (1.8.2)
|
9
|
+
pry (0.9.12.4)
|
10
|
+
coderay (~> 1.0)
|
11
11
|
method_source (~> 0.8)
|
12
12
|
slop (~> 3.4)
|
13
13
|
rack (1.5.2)
|
14
|
-
rack-protection (1.5.
|
14
|
+
rack-protection (1.5.1)
|
15
15
|
rack
|
16
16
|
rack-test (0.6.2)
|
17
17
|
rack (>= 1.0)
|
@@ -19,22 +19,22 @@ GEM
|
|
19
19
|
rspec-core (~> 2.14.0)
|
20
20
|
rspec-expectations (~> 2.14.0)
|
21
21
|
rspec-mocks (~> 2.14.0)
|
22
|
-
rspec-core (2.14.
|
23
|
-
rspec-expectations (2.14.
|
22
|
+
rspec-core (2.14.7)
|
23
|
+
rspec-expectations (2.14.4)
|
24
24
|
diff-lcs (>= 1.1.3, < 2.0)
|
25
|
-
rspec-mocks (2.14.
|
26
|
-
sinatra (1.4.
|
25
|
+
rspec-mocks (2.14.4)
|
26
|
+
sinatra (1.4.4)
|
27
27
|
rack (~> 1.4)
|
28
28
|
rack-protection (~> 1.4)
|
29
29
|
tilt (~> 1.3, >= 1.3.4)
|
30
|
-
sinatra-contrib (1.4.
|
30
|
+
sinatra-contrib (1.4.2)
|
31
31
|
backports (>= 2.0)
|
32
32
|
multi_json
|
33
33
|
rack-protection
|
34
34
|
rack-test
|
35
35
|
sinatra (~> 1.4.0)
|
36
36
|
tilt (~> 1.3)
|
37
|
-
slop (3.4.
|
37
|
+
slop (3.4.7)
|
38
38
|
tilt (1.4.1)
|
39
39
|
|
40
40
|
PLATFORMS
|
data/README.md
CHANGED
data/lib/snapi/argument.rb
CHANGED
@@ -48,7 +48,10 @@ module Snapi
|
|
48
48
|
#
|
49
49
|
# @returns Array of Symbols
|
50
50
|
def valid_attributes
|
51
|
-
[
|
51
|
+
[
|
52
|
+
:default_value, :format, :list,
|
53
|
+
:required, :type, :values, :name, :description
|
54
|
+
]
|
52
55
|
end
|
53
56
|
|
54
57
|
# DSL Setter
|
@@ -2,12 +2,11 @@ require 'json'
|
|
2
2
|
require 'sinatra/contrib'
|
3
3
|
|
4
4
|
module Snapi
|
5
|
-
# TODO document, test, make more robust
|
6
5
|
module SinatraExtension
|
7
6
|
extend Sinatra::Extension
|
8
7
|
|
9
8
|
get "/?" do
|
10
|
-
capabilities = Snapi.capabilities
|
9
|
+
capabilities = Snapi.capabilities.dup
|
11
10
|
capabilities.keys.each do |key|
|
12
11
|
capabilities[key] = capabilities[key].to_hash
|
13
12
|
end
|
@@ -41,6 +40,5 @@ module Snapi
|
|
41
40
|
response = Snapi.capabilities[@capability].run_function(@function,params)
|
42
41
|
response.class == String ? response : JSON.generate(response)
|
43
42
|
end
|
44
|
-
|
45
43
|
end
|
46
44
|
end
|
data/lib/snapi/version.rb
CHANGED
@@ -17,7 +17,7 @@ describe Snapi::BasicCapability do
|
|
17
17
|
fn.return :raw
|
18
18
|
end
|
19
19
|
end
|
20
|
-
lemon_grab = {:
|
20
|
+
lemon_grab = {:summon_zombies => { :return_type => :raw}}
|
21
21
|
|
22
22
|
PrinceLemonGrab.to_hash.should == lemon_grab
|
23
23
|
end
|
@@ -50,7 +50,7 @@ describe Snapi::BasicCapability do
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
}
|
53
|
-
PrincessBubblegum.to_hash.should ==
|
53
|
+
PrincessBubblegum.to_hash.should == expected_return
|
54
54
|
end
|
55
55
|
|
56
56
|
it "doesn't shared functions between inherited classes" do
|