sliver 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/sliver/endpoints.rb +4 -0
- data/sliver.gemspec +1 -1
- data/spec/acceptance/lambda_api_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 508161f41a11f09a90f5e433d5ad5c9581e4cb6b
|
4
|
+
data.tar.gz: 5cba29935618382d59bd5efcec0c0458290acd98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cabb1094f4980937f831e604ef9037907d1155c55a4e3ac01280be848f1b90cee2f987c45be10d8cce1982f3e6c9c61a16a300f854332a4391b75ea38bf7d7b
|
7
|
+
data.tar.gz: dcfe57aa9ecfb127de47e553630577a5b22e156f4ca651e22f2e8a8deffee5785df6e39b8b77b8f905df8ac1cbfd7c795a7c262375e5c6f72d28a59417845693
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
A super simple, extendable Rack API.
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/pat/sliver.svg?branch=master)](https://travis-ci.org/pat/sliver)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/pat/sliver.png)](https://codeclimate.com/github/pat/sliver)
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/sliver.svg)](http://badge.fury.io/rb/sliver)
|
6
8
|
|
7
9
|
Early days of development, so things may change dramatically. Or not. Who knows.
|
8
10
|
|
@@ -11,7 +13,7 @@ Early days of development, so things may change dramatically. Or not. Who knows.
|
|
11
13
|
Add it to your Gemfile like any other gem, or install it manually.
|
12
14
|
|
13
15
|
```ruby
|
14
|
-
gem 'sliver', '~> 0.0.
|
16
|
+
gem 'sliver', '~> 0.0.4'
|
15
17
|
```
|
16
18
|
|
17
19
|
## Usage
|
data/lib/sliver/endpoints.rb
CHANGED
@@ -4,10 +4,14 @@ class Sliver::Endpoints
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def append(path, action)
|
7
|
+
path = '/' if path == ''
|
8
|
+
|
7
9
|
paths[path] = action
|
8
10
|
end
|
9
11
|
|
10
12
|
def find(path)
|
13
|
+
path = '/' if path == ''
|
14
|
+
|
11
15
|
key = paths.keys.detect { |key|
|
12
16
|
key.is_a?(String) ? (key == path) : path[/\A#{key}\z/]
|
13
17
|
}
|
data/sliver.gemspec
CHANGED
@@ -29,6 +29,12 @@ describe 'Basic Sliver API' do
|
|
29
29
|
expect(last_response.body).to eq('foo')
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'matches empty paths as /' do
|
33
|
+
get ''
|
34
|
+
|
35
|
+
expect(last_response.body).to eq('foo')
|
36
|
+
end
|
37
|
+
|
32
38
|
it 'delegates to the appropriate endpoint' do
|
33
39
|
get '/bar'
|
34
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sliver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|