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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f21cd8c5684c1df5a750b1fcde9d8686c201e78
4
- data.tar.gz: dcbb2635b735629e359ed533049d13f6cc5eec79
3
+ metadata.gz: 508161f41a11f09a90f5e433d5ad5c9581e4cb6b
4
+ data.tar.gz: 5cba29935618382d59bd5efcec0c0458290acd98
5
5
  SHA512:
6
- metadata.gz: 98a1a1a0d96f341afe028cc3125e4b05591688e645fea36457e23c87aa8b2ec0ae0522e271d4863705ad7551da72dc8713389371dbe939e6ba71f6ca0a1168a8
7
- data.tar.gz: 75de6c573a1299a6ca44317c1701dcb19acc411ac385860475815212547730b6df2fcc5b79434614f7895669892bf0aa1e3c46e3e05cdbe83dfc5dac4cd8288e
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.3'
16
+ gem 'sliver', '~> 0.0.4'
15
17
  ```
16
18
 
17
19
  ## Usage
@@ -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
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = 'sliver'
4
- spec.version = '0.0.3'
4
+ spec.version = '0.0.4'
5
5
  spec.authors = ['Pat Allan']
6
6
  spec.email = ['pat@freelancing-gods.com']
7
7
  spec.summary = %q{Lightweight, simple Rack APIs}
@@ -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.3
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-09 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack