nsisam 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
@@ -18,6 +18,10 @@ module NSISam
18
18
  @port = port
19
19
  end
20
20
 
21
+ def download_link_for_file(key)
22
+ "http://#{@host}:#{@port}/file/#{key}"
23
+ end
24
+
21
25
  def store(data)
22
26
  key = Time.now.nsec.to_s
23
27
  @storage[key] = JSON.load(data.to_json) unless @expire
data/nsisam.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "nsisam"
8
- s.version = "0.7.1"
8
+ s.version = "0.7.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Douglas Camata"]
@@ -68,29 +68,29 @@ describe "NSISam::FakeClient" do
68
68
  it "stored by #store in a dict with file and filename" do
69
69
  data = {file: Base64.encode64('a file'), filename: 'dumb.txt'}
70
70
  response = @nsisam.store(data)
71
- request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}"))
71
+ request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key)))
72
72
  request.body.should == "a file"
73
73
  end
74
74
 
75
75
  it "should update the hosted file when the file is updated through #store" do
76
76
  data = {file: Base64.encode64('a file'), filename: 'dumb.txt'}
77
77
  response = @nsisam.store(data)
78
- request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}"))
78
+ request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key)))
79
79
  request.body.should == "a file"
80
80
 
81
81
  data = {file: Base64.encode64('another file'), filename: 'dumb.txt'}
82
82
  response = @nsisam.store(data)
83
- request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}"))
83
+ request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key)))
84
84
  request.body.should == "another file"
85
85
  end
86
86
 
87
87
  it "should update the hosted file when the file is updated through #store_file" do
88
88
  response = @nsisam.store_file('a file', 'dumb.txt')
89
- request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}"))
89
+ request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key)))
90
90
  request.body.should == "a file"
91
91
 
92
92
  response = @nsisam.update_file(response.key, 'another file', 'dumb.txt')
93
- request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}"))
93
+ request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key)))
94
94
  request.body.should == "another file"
95
95
  end
96
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsisam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -188,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: -4153678088285420192
191
+ hash: -333567177505630667
192
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements: