cwlogs-s3 0.0.5 → 0.0.6

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.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "cwlogs-s3"
7
- spec.version = '0.0.5'
7
+ spec.version = '0.0.6'
8
8
  spec.authors = ["Tim-B"]
9
9
  spec.email = ["tim@galacticcode.com"]
10
10
  spec.summary = %q{Exports logs from CloudWatch logs and uploads them to S3}
@@ -19,8 +19,8 @@ module CWLogsToS3
19
19
  start = Time.at(ending.to_i - period)
20
20
 
21
21
  s3Uri = URI(command_options[:s3_path])
22
- bucket = s3Uri.host
23
- s3_prefix = s3Uri.path
22
+ @bucket = s3Uri.host
23
+ @s3_prefix = s3Uri.path.gsub!(/^\//, '')
24
24
 
25
25
  Escort::Logger.output.puts "Exporting from #{start} to #{ending}"
26
26
 
@@ -70,9 +70,9 @@ module CWLogsToS3
70
70
  @event_cnt = @event_cnt + 1
71
71
  page_content << event[:message] << "\n"
72
72
  end
73
- object_name = command_options[:prefix] + randomise_prefix + '_' + @page_cnt.to_s + '.log'
74
- @s3.bucket(command_options[:bucket]).object(object_name).put(
75
- :body => page_content
73
+ object_name = @s3_prefix + randomise_prefix + '_' + @page_cnt.to_s + '.log'
74
+ @s3.bucket(@bucket).object(object_name).put(
75
+ :body => page_content
76
76
  )
77
77
  Escort::Logger.output.puts "Put #{object_name} to S3."
78
78
  @page_cnt = @page_cnt + 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cwlogs-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: