simple_respond 0.0.5 → 1.0.0

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: f06c2aaf36c28ea0f8aaa90c077051ad1c39f4d1
4
- data.tar.gz: 1f5200166949f3c73e128e719d6f87f4f44c91bd
3
+ metadata.gz: ed0b7b3876a8cce1456e8de1e2f96d8574314c15
4
+ data.tar.gz: 9390ccbd4a9994a2ec3427e24acfbb00200e934a
5
5
  SHA512:
6
- metadata.gz: 1a468b91f8582da0ae5cd02f8298f8d0ac2610fcc80116c513e22016813941ba91178c2874d7aac3bd2960eb93ad4f02e3c1eb8a85ef45ff7d4d12084e7c21c1
7
- data.tar.gz: 4916363a19eaeaaba9307b7d188b776c8c77d644a3bde8db45f5e7b75ce692c78b2704aeef07e13b963ec6ea946cee4a84cb69f829f90525cff17b3331cc3e14
6
+ metadata.gz: b955e210b050267af832c6ba5129e709efe74139699b98293cb14e89467b63d78cad483e2f9dfe8e2c36d8281e34ac5b4691554d4ae74c835b6e6cc0275a5122
7
+ data.tar.gz: d133aac084cf78deb3d9e4bd1955c1eec0b7bba38adc70134ef4083c1d414d88e9dc5c72ce60be87ca15de84788f99af3e45eb2d3d91f5d6f514e83626435b7e
@@ -0,0 +1,16 @@
1
+ require 'sinatra'
2
+ require 'thin'
3
+ require 'forwardable'
4
+
5
+ class SimpleRespond < Sinatra::Base
6
+
7
+ set :port, ARGV[0]
8
+
9
+ get '*' do
10
+
11
+ content_type :json
12
+ puts "Responding with #{$response_file}"
13
+ $response
14
+ end
15
+
16
+ end
@@ -1,23 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'sinatra'
4
-
5
3
  if ARGV.length != 2 then
6
4
  puts 'USAGE: simple_respond <port> <JSON file>'
7
5
  Kernel.exit(1)
8
6
  end
9
7
 
10
- class SimpleRespond < Sinatra::Base
11
-
12
- set :port, ARGV[0]
8
+ $response_file = ARGV[1]
9
+ $response_file ||= 'response.json'
10
+ $response = File.read($response_file)
13
11
 
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
12
+ me_dir = File.expand_path(File.dirname(__FILE__))
21
13
 
22
- run!
14
+ Dir.chdir (me_dir) do
15
+ require '../application/simple_respond.rb'
16
+ SimpleRespond.run!
23
17
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_respond
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bill Laboon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-27 00:00:00.000000000 Z
11
+ date: 2015-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.3.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 1.3.6
27
+ - !ruby/object:Gem::Dependency
28
+ name: thin
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.6.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.6.3
27
41
  description: Respond to all requests on a port by returning a specified JSON file
28
42
  email: bill@billlaboon.com
29
43
  executables:
@@ -31,6 +45,7 @@ executables:
31
45
  extensions: []
32
46
  extra_rdoc_files: []
33
47
  files:
48
+ - application/simple_respond.rb
34
49
  - bin/simple_respond
35
50
  homepage: http://github.com/laboon/simple_respond
36
51
  licenses:
@@ -42,17 +57,17 @@ require_paths:
42
57
  - lib
43
58
  required_ruby_version: !ruby/object:Gem::Requirement
44
59
  requirements:
45
- - - '>='
60
+ - - ">="
46
61
  - !ruby/object:Gem::Version
47
62
  version: '0'
48
63
  required_rubygems_version: !ruby/object:Gem::Requirement
49
64
  requirements:
50
- - - '>='
65
+ - - ">="
51
66
  - !ruby/object:Gem::Version
52
67
  version: '0'
53
68
  requirements: []
54
69
  rubyforge_project:
55
- rubygems_version: 2.2.2
70
+ rubygems_version: 2.4.3
56
71
  signing_key:
57
72
  specification_version: 4
58
73
  summary: A simple web service JSON responder