tn_s3_file_uploader 0.1.10 → 0.1.11
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea2a6e568fde79c255b4e32815d77b3a19b1d2b0
|
4
|
+
data.tar.gz: c54e9211c46bd69140bce7778cd0e7c76576bef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61cd3265f546970f35c3cb13d9719c740c4ec4f05b693f8de24d8fccb3b8fdd913d0cb7a6c22cc5976fe42faf95a56405a142edf8e18eade118b0fa7a6b09c76
|
7
|
+
data.tar.gz: 7c3889e7660e439fda5c7bcdf093c036d29d47f2be61453fc0b0baa0f3b893f3db7a01ba9d0ad1d2be265899b379f3e957a9c78afe0b2f61ad431abe6117f566
|
@@ -21,7 +21,7 @@ module TnS3FileUploader
|
|
21
21
|
def upload_log_files(options)
|
22
22
|
raise ArgumentError, 's3_output_pattern cannot be empty' if blank?(options[:s3_output_pattern])
|
23
23
|
bucket = check_bucket_dest_path(options[:s3_output_pattern])
|
24
|
-
log_files = check_log_files(options
|
24
|
+
log_files = check_log_files(options)
|
25
25
|
|
26
26
|
file_path_generator = FilePathGenerator.new(options)
|
27
27
|
|
@@ -45,14 +45,27 @@ module TnS3FileUploader
|
|
45
45
|
end
|
46
46
|
|
47
47
|
private
|
48
|
-
def check_log_files(
|
48
|
+
def check_log_files(options)
|
49
|
+
log_file_pattern = options[:input_file_pattern]
|
50
|
+
|
49
51
|
raise ArgumentError, 'log file pattern cannot be nil' if log_file_pattern == nil
|
50
52
|
|
51
53
|
last_folder_separator = log_file_pattern.rindex('.')
|
52
54
|
raise ArgumentError, "#{ log_file_pattern } is not a valid path. It lacks a file extension." if last_folder_separator == nil
|
53
55
|
|
54
56
|
files = Dir[log_file_pattern].entries
|
55
|
-
|
57
|
+
if files.empty?
|
58
|
+
if options[:verbose]
|
59
|
+
options[:context] ||= {}
|
60
|
+
disk_free_result = %x[df -h].split("\n")
|
61
|
+
options[:context][:df] = disk_free_result
|
62
|
+
logs_dir = %x[ls -l /media/ephemeral0/logs].split("\n")
|
63
|
+
options[:context][:logs_dir] = logs_dir
|
64
|
+
symlink_check = %x[ls -l /usr/share/tomcat7/].split("\n")
|
65
|
+
options[:context][:symlink_check] = symlink_check
|
66
|
+
end
|
67
|
+
raise ArgumentError, "#{ log_file_pattern } did not match any files."
|
68
|
+
end
|
56
69
|
|
57
70
|
files
|
58
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tn_s3_file_uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thinknear.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: honeybadger
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.4.
|
82
|
+
rubygems_version: 2.4.8
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Amazon S3 file uploader
|