simple_respond 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/simple_respond +12 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f06c2aaf36c28ea0f8aaa90c077051ad1c39f4d1
|
4
|
+
data.tar.gz: 1f5200166949f3c73e128e719d6f87f4f44c91bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a468b91f8582da0ae5cd02f8298f8d0ac2610fcc80116c513e22016813941ba91178c2874d7aac3bd2960eb93ad4f02e3c1eb8a85ef45ff7d4d12084e7c21c1
|
7
|
+
data.tar.gz: 4916363a19eaeaaba9307b7d188b776c8c77d644a3bde8db45f5e7b75ce692c78b2704aeef07e13b963ec6ea946cee4a84cb69f829f90525cff17b3331cc3e14
|
data/bin/simple_respond
CHANGED
@@ -7,12 +7,17 @@ if ARGV.length != 2 then
|
|
7
7
|
Kernel.exit(1)
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
class SimpleRespond < Sinatra::Base
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
set :port, ARGV[0]
|
13
|
+
|
14
|
+
get '*' do
|
15
|
+
content_type :json
|
16
|
+
response = ARGV[1]
|
17
|
+
response ||= 'response.json'
|
18
|
+
puts "Responding with #{response}"
|
19
|
+
File.read(response)
|
20
|
+
end
|
21
|
+
|
22
|
+
run!
|
18
23
|
end
|