s3grep 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/s3info +7 -1
- data/lib/s3grep/directory_info.rb +8 -1
- data/s3grep.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88e4a4103d7d4263d025c54f4a5be65349961caf01026b510b3f16ba056e23c
|
4
|
+
data.tar.gz: a60b92d47715a38252c9a903c2f95c11841fbaa876ef1f8ccee3a99d92c90d2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989e6da04b302d4fe68f4d8ed52c8f813d45ba359d7e270414b9602020d017380d1e611e50958fc5a4ee8edb6356e1c5a5243dd66d1182f899bc71825926e420
|
7
|
+
data.tar.gz: 89d12dd7fc507b998b4f1bdafa62b9a012650ed7aec71dd08df729ee0b2d215295e9eb8f02558f3122e0c50ee789192cfe53f5399d3b2d169cd975276750bb21
|
data/bin/s3info
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'pathname'
|
4
|
+
BASE_DIR = Pathname.new(File.expand_path('..', __dir__))
|
5
|
+
$LOAD_PATH << "#{BASE_DIR}/lib"
|
6
|
+
|
3
7
|
require 'optparse'
|
4
8
|
require 's3grep'
|
5
9
|
require 'aws-sdk-s3'
|
@@ -17,7 +21,9 @@ stats = {
|
|
17
21
|
last_modified: info.last_modified,
|
18
22
|
newest_file: info.newest_file,
|
19
23
|
first_modified: info.first_modified,
|
20
|
-
first_file: info.first_file
|
24
|
+
first_file: info.first_file,
|
25
|
+
num_files_by_storage_class: info.num_files_by_storage_class,
|
26
|
+
total_size_by_storage_class: info.total_size_by_storage_class
|
21
27
|
}
|
22
28
|
|
23
29
|
print JSON.pretty_generate(stats) + "\n"
|
@@ -5,7 +5,9 @@ module S3Grep
|
|
5
5
|
:total_size,
|
6
6
|
:num_files,
|
7
7
|
:newest_content,
|
8
|
-
:oldest_content
|
8
|
+
:oldest_content,
|
9
|
+
:num_files_by_storage_class,
|
10
|
+
:total_size_by_storage_class
|
9
11
|
|
10
12
|
def self.get(directory)
|
11
13
|
info = new(directory)
|
@@ -15,6 +17,8 @@ module S3Grep
|
|
15
17
|
def initialize(directory)
|
16
18
|
@total_size = 0
|
17
19
|
@num_files = 0
|
20
|
+
@num_files_by_storage_class = Hash.new(0)
|
21
|
+
@total_size_by_storage_class = Hash.new(0)
|
18
22
|
set_path(directory)
|
19
23
|
end
|
20
24
|
|
@@ -23,6 +27,9 @@ module S3Grep
|
|
23
27
|
@num_files += 1
|
24
28
|
@total_size += content[:size]
|
25
29
|
|
30
|
+
@num_files_by_storage_class[content[:storage_class]] += 1
|
31
|
+
@total_size_by_storage_class[content[:storage_class]] += content[:size]
|
32
|
+
|
26
33
|
set_newest(content)
|
27
34
|
set_oldest(content)
|
28
35
|
end
|
data/s3grep.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3grep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Youch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|