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 CHANGED
@@ -1,3 +1,5 @@
1
+ 0.0.6
2
+ -- fix bug around @@capabilities overide in Sinatra Extension
1
3
  0.0.5
2
4
  -- remove binding.pry in sinatra extension
3
5
  -- Add GPLv3 License
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- backports (3.3.4)
5
- coderay (1.0.9)
6
- diff-lcs (1.2.4)
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.0)
9
- pry (0.9.12.2)
10
- coderay (~> 1.0.5)
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.0)
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.5)
23
- rspec-expectations (2.14.3)
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.3)
26
- sinatra (1.4.3)
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.1)
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.6)
37
+ slop (3.4.7)
38
38
  tilt (1.4.1)
39
39
 
40
40
  PLATFORMS
data/README.md CHANGED
@@ -17,7 +17,7 @@ This has only been used on `1.9.3` but is should run fine on `1.9+` and `2.x+`
17
17
 
18
18
  ## Usage
19
19
 
20
- Simple Exmaple:
20
+ Simple Example:
21
21
 
22
22
  ```ruby
23
23
  require 'snapi'
@@ -48,7 +48,10 @@ module Snapi
48
48
  #
49
49
  # @returns Array of Symbols
50
50
  def valid_attributes
51
- [:default_value, :format, :list, :required, :type, :values]
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
@@ -1,3 +1,3 @@
1
1
  module Snapi
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -17,7 +17,7 @@ describe Snapi::BasicCapability do
17
17
  fn.return :raw
18
18
  end
19
19
  end
20
- lemon_grab = {:prince_lemon_grab => {:summon_zombies => { :return_type => :raw}}}
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 == { PrincessBubblegum.namespace => expected_return}
53
+ PrincessBubblegum.to_hash.should == expected_return
54
54
  end
55
55
 
56
56
  it "doesn't shared functions between inherited classes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: