icwot 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/icwot +8 -3
- data/lib/icwot.rb +1 -0
- data/lib/icwot/client.rb +1 -1
- data/lib/icwot/console.rb +4 -1
- data/lib/icwot/version.rb +1 -1
- 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: 9748124ee09d8751db32f73b2f49c64ed8bbf047
|
4
|
+
data.tar.gz: 1b0ed9c7114b9c2c2ce31f8e5109e6bfd8cd5110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f00d11625ac678564c01ad1485d581e1cb3795bdc9b57db7afb4ad12be65e5a4c578bd0a52cdd432434003f30b61e95cb3514b880812e3881effa57e0be89afb
|
7
|
+
data.tar.gz: 805d0bf9d9df6c6823f3ded793173862ce804d664b92593e706251efeb2f2005ea77e31af2eac456f7afba6cbd04b7ef10409c7d49975b5ec925fe78a7a31921
|
data/bin/icwot
CHANGED
@@ -19,9 +19,10 @@ if Icwot.is_port_open?('localhost', console.port)
|
|
19
19
|
end
|
20
20
|
|
21
21
|
client = Client.new(port: console.port, content_type: console.produces)
|
22
|
+
console.host_url = client.uri
|
22
23
|
|
23
24
|
begin
|
24
|
-
response = RestClient.
|
25
|
+
response = RestClient.put console.url, client.to_s, console.header
|
25
26
|
rescue RestClient::Exception => e
|
26
27
|
puts "Error #{e.response.code} while contacting the host. The url is: '#{console.url}'"
|
27
28
|
exit 0
|
@@ -32,5 +33,9 @@ end
|
|
32
33
|
|
33
34
|
#TODO handle the case when the response of the host is not correct
|
34
35
|
puts "The response server: '#{response}' with code #{response.code}"
|
35
|
-
|
36
|
-
Icwot.run(console.port, console.log_path)
|
36
|
+
begin
|
37
|
+
app = Icwot.run(console.port, console.log_path)
|
38
|
+
rescue Interrupt => e
|
39
|
+
RestClient.delete console.url
|
40
|
+
app.quit!
|
41
|
+
end
|
data/lib/icwot.rb
CHANGED
data/lib/icwot/client.rb
CHANGED
data/lib/icwot/console.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class Console
|
2
2
|
|
3
3
|
attr_reader :produces, :accept, :port, :host, :protocol, :log_path, :errors
|
4
|
+
attr_accessor :host_url
|
4
5
|
|
5
6
|
def initialize
|
6
7
|
@produces = 'application/json'
|
@@ -53,7 +54,9 @@ class Console
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def url
|
56
|
-
protocol+host
|
57
|
+
base_uri = protocol+host
|
58
|
+
base_uri += '/' unless base_uri[-1] == '/'
|
59
|
+
base_uri + host_url
|
57
60
|
end
|
58
61
|
|
59
62
|
def header
|
data/lib/icwot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icwot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- leo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|