file_scan 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30637764091ba4b39b8dc3ead21eb5e14963513083cb842641c1d0c79203c508
4
- data.tar.gz: b1d5410407ef9ad147bae99ad9d897648ecfdbde52f9bb169c51585b07b74f01
3
+ metadata.gz: bd9694b39c57bfc074e4a845825047e2520314dc39601d77164f66a752e42569
4
+ data.tar.gz: 10b5f577d49c3712d5192e7e1e9ff4bcb10375ffff033d6457f78a3210c38142
5
5
  SHA512:
6
- metadata.gz: d5d56dc43aff5bb568f747644061907fe0d261364bbed3048ca0b320899644b6d787fef0569b4675dcc813c4f1e0866668ceef2dc3d480a2f1f90205c7b0ff8b
7
- data.tar.gz: 8c8dec2d713a17ea85d1fc3414f46735dede1f5a6d9cd7f5dd7ebda675ae9558f2206b8395e3a1000f49ebfa687a277bd4021155b6dd4a284a7eac123505544d
6
+ metadata.gz: a30f8ca0d7524092933f44ddbc3f2c547fc28bc0006285e30abf3a089c656496848a5aa7860d068c0bee470af9fe4c4569c813aef26010c81f9798307c2bb552
7
+ data.tar.gz: 63eea528577cc671af7e2376d14f69b7706b73a843f958c16d1ee2a4c3bf099652cf928325af363d4223b59859769939287963e6092fcad3ea8a6f37b2b8e30b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- file_scan (0.1.0)
4
+ file_scan (0.1.1)
5
5
  colorize (~> 0.8.1)
6
6
  rake (~> 13.0)
7
7
  rubocop (~> 1.7)
@@ -11,26 +11,26 @@ GEM
11
11
  specs:
12
12
  ast (2.4.2)
13
13
  colorize (0.8.1)
14
- parallel (1.20.1)
15
- parser (3.0.2.0)
14
+ parallel (1.21.0)
15
+ parser (3.0.3.2)
16
16
  ast (~> 2.4.1)
17
17
  rainbow (3.0.0)
18
18
  rake (13.0.6)
19
- regexp_parser (2.1.1)
19
+ regexp_parser (2.2.0)
20
20
  rexml (3.2.5)
21
- rubocop (1.18.4)
21
+ rubocop (1.23.0)
22
22
  parallel (~> 1.10)
23
23
  parser (>= 3.0.0.0)
24
24
  rainbow (>= 2.2.2, < 4.0)
25
25
  regexp_parser (>= 1.8, < 3.0)
26
26
  rexml
27
- rubocop-ast (>= 1.8.0, < 2.0)
27
+ rubocop-ast (>= 1.12.0, < 2.0)
28
28
  ruby-progressbar (~> 1.7)
29
29
  unicode-display_width (>= 1.4.0, < 3.0)
30
- rubocop-ast (1.9.0)
30
+ rubocop-ast (1.15.0)
31
31
  parser (>= 3.0.1.1)
32
32
  ruby-progressbar (1.11.0)
33
- unicode-display_width (2.0.0)
33
+ unicode-display_width (2.1.0)
34
34
 
35
35
  PLATFORMS
36
36
  x86_64-darwin-20
@@ -39,4 +39,4 @@ DEPENDENCIES
39
39
  file_scan!
40
40
 
41
41
  BUNDLED WITH
42
- 2.2.27
42
+ 2.2.32
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/file_scanner/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "file_scan"
7
+ spec.version = FileScanner::VERSION
8
+ spec.authors = ["c477y"]
9
+ spec.email = ["c477y@pm.me"]
10
+
11
+ spec.summary = "A utility gem which scan files recursively inside a directory and performs actions with each file"
12
+ spec.description = spec.summary
13
+ spec.homepage = "https://github.com/c477y/file_scanner"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.4.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "colorize", "~> 0.8.1"
32
+ spec.add_dependency "rake", "~> 13.0"
33
+ spec.add_dependency "rubocop", "~> 1.7"
34
+ end
@@ -15,6 +15,7 @@ module FileScanner
15
15
  def initialize(dir, **options)
16
16
  @nested = options[:nested]
17
17
  @extension = options[:extension].nil? ? "*.mp4" : options[:extension]
18
+ @logger = options[:logger] || $stdout
18
19
  @dir = dir
19
20
  end
20
21
 
@@ -34,7 +35,7 @@ module FileScanner
34
35
  def process_directory(dir)
35
36
  Dir.chdir(dir) do
36
37
  # Process files in a given directory
37
- print "Scanning files in #{Dir.pwd}\n".colorize(:blue)
38
+ @logger.info "Scanning files in #{Dir.pwd}".colorize(:blue)
38
39
 
39
40
  Dir.glob(@extension).sort.each { |file| @block.call(file) }
40
41
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FileScanner
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - c477y
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-22 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -67,6 +67,7 @@ files:
67
67
  - Rakefile
68
68
  - bin/console
69
69
  - bin/setup
70
+ - file_scanner.gemspec
70
71
  - lib/file_scanner.rb
71
72
  - lib/file_scanner/client.rb
72
73
  - lib/file_scanner/version.rb