moro-delta_attack 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/delta_attack/client.rb +6 -3
- data/lib/delta_attack.rb +1 -1
- metadata +2 -2
data/lib/delta_attack/client.rb
CHANGED
|
@@ -6,10 +6,11 @@ require 'securerandom'
|
|
|
6
6
|
module DeltaAttack
|
|
7
7
|
class Client
|
|
8
8
|
class << self
|
|
9
|
-
def cast(file, host="localhost", port=3333)
|
|
9
|
+
def cast(file, content_type = nil, host="localhost", port=3333)
|
|
10
10
|
begin
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
client = new(file)
|
|
12
|
+
client.content_type = content_type
|
|
13
|
+
res = Net::HTTP.start(host, port){|http| http.request(client.request) }
|
|
13
14
|
raise "Request failed #{res}" unless res.is_a? Net::HTTPOK
|
|
14
15
|
res.body
|
|
15
16
|
rescue Errno::ECONNREFUSED => e
|
|
@@ -19,6 +20,8 @@ module DeltaAttack
|
|
|
19
20
|
alias extract cast
|
|
20
21
|
end
|
|
21
22
|
|
|
23
|
+
attr_writer :content_type
|
|
24
|
+
|
|
22
25
|
def initialize(filename, content=nil)
|
|
23
26
|
@filename = filename
|
|
24
27
|
@content = content
|
data/lib/delta_attack.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moro-delta_attack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MOROHASHI Kyosuke
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-09-
|
|
12
|
+
date: 2008-09-25 00:00:00 -07:00
|
|
13
13
|
default_executable: delta_attack_server
|
|
14
14
|
dependencies: []
|
|
15
15
|
|