apiif 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/apiif +5 -0
- data/lib/apiif/version.rb +3 -0
- data/lib/apiif.rb +21 -0
- metadata +61 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d57ed2b6dd27e29957eba23cc6c1db7151976fb6
|
4
|
+
data.tar.gz: 1b1a33b4adf338b09a3b4fc550a0ef709fe099d9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 692792ab410f0828fff347c1196bb028b476361fe3337df0303909ae96dc1d6baa0c0755a9e1d416080d53d0cbb12db1eafcd03c5203f79b5c16c813c3090aae
|
7
|
+
data.tar.gz: 667d4b0044c70eb6577763b2feb51b87bf6cf5f13e3ab5bd224bf5cf82f9925ee4e972474aea1bbe7efe93c187f2eb2b8e6aa1595a4f35265ee90935f62e4d2a
|
data/bin/apiif
ADDED
data/lib/apiif.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'apiif/version'
|
2
|
+
|
3
|
+
require 'sinatra'
|
4
|
+
|
5
|
+
class Apiif::Server < Sinatra::Base
|
6
|
+
def serve_file(path, verb)
|
7
|
+
path = File.join('.', path, "#{verb}.json")
|
8
|
+
halt 404 if !File.exists?(path)
|
9
|
+
|
10
|
+
content_type :json
|
11
|
+
File.read(path)
|
12
|
+
end
|
13
|
+
|
14
|
+
get '/*' do
|
15
|
+
serve_file request.path_info, 'get'
|
16
|
+
end
|
17
|
+
|
18
|
+
post '/*' do
|
19
|
+
serve_file request.path_info, 'post'
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apiif
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dan Tao
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sinatra
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
description: A gem that exposes an API based on folder structure
|
28
|
+
email: daniel.tao@gmail.com
|
29
|
+
executables:
|
30
|
+
- apiif
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- bin/apiif
|
35
|
+
- lib/apiif.rb
|
36
|
+
- lib/apiif/version.rb
|
37
|
+
homepage: https://github.com/dtao/apiif
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.2.2
|
58
|
+
signing_key:
|
59
|
+
specification_version: 4
|
60
|
+
summary: Specify your API in folders
|
61
|
+
test_files: []
|