bigfiles 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bigfiles.gemspec +1 -1
- data/lib/bigfiles.rb +9 -24
- data/lib/bigfiles/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf4a5bbae72f722ccf428675d63e64ad4e229451
|
4
|
+
data.tar.gz: 603bda6dfae33c48276eb7e4ec2e477c0ef57916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae26bd963ff8379f31639b2da418e4cab456183b293fecda34d393e58a4101f9b73e517de0dafa709889d0cafd3b67ab1861403f318cfb8530e394f98fb23ee
|
7
|
+
data.tar.gz: 288c2b628c6ce4a78a3543103153dfdd0166ddf368041e20cd2ae55c8d0c1907f1ac78afd387bb9298f530920ab6c01b4a0bce30387c576714393950cc2b2601
|
data/bigfiles.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.rubygems_version = '1.3.6'
|
27
27
|
s.summary = 'Finds largest source files in a project'
|
28
28
|
|
29
|
-
s.
|
29
|
+
s.add_dependency('source_finder', ['>=2'])
|
30
30
|
s.add_development_dependency('bundler')
|
31
31
|
s.add_development_dependency('rake')
|
32
32
|
s.add_development_dependency('quality')
|
data/lib/bigfiles.rb
CHANGED
@@ -2,6 +2,7 @@ require 'optparse'
|
|
2
2
|
|
3
3
|
require_relative 'bigfiles/file_with_lines'
|
4
4
|
require 'source_finder/source_file_globber'
|
5
|
+
require 'source_finder/option_parser'
|
5
6
|
|
6
7
|
# Simple tool to find the largest source files in your project.
|
7
8
|
module BigFiles
|
@@ -12,12 +13,14 @@ module BigFiles
|
|
12
13
|
exiter: Kernel,
|
13
14
|
file_with_lines: FileWithLines,
|
14
15
|
source_file_globber: SourceFinder::SourceFileGlobber.new,
|
15
|
-
option_parser_class: OptionParser
|
16
|
+
option_parser_class: OptionParser,
|
17
|
+
source_finder_option_parser: SourceFinder::OptionParser.new)
|
16
18
|
@io = io
|
17
19
|
@exiter = exiter
|
18
20
|
@file_with_lines = file_with_lines
|
19
21
|
@source_file_globber = source_file_globber
|
20
22
|
@option_parser_class = option_parser_class
|
23
|
+
@source_finder_option_parser = source_finder_option_parser
|
21
24
|
@options = parse_options(args)
|
22
25
|
end
|
23
26
|
|
@@ -30,30 +33,13 @@ module BigFiles
|
|
30
33
|
options
|
31
34
|
end
|
32
35
|
|
33
|
-
# XXX: Move to using SourceFinder for this
|
34
|
-
DEFAULT_GLOB =
|
35
|
-
'{app,lib,test,spec,feature}/**/*.{rb,swift,cpp,c,java,py}'
|
36
|
-
|
37
36
|
def glob
|
38
|
-
@options[:glob] ||
|
37
|
+
@options[:glob] || @source_finder_option_parser.default_source_files_glob
|
39
38
|
end
|
40
39
|
|
41
40
|
def exclude_glob
|
42
|
-
@options[:exclude] ||
|
43
|
-
|
44
|
-
|
45
|
-
def add_glob_option(opts, options)
|
46
|
-
opts.on('-g glob here', '--glob',
|
47
|
-
"Which files to parse - default is #{DEFAULT_GLOB}") do |v|
|
48
|
-
options[:glob] = v
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def add_exclude_glob_option(opts, options)
|
53
|
-
opts.on('-e glob here', '--exclude-glob',
|
54
|
-
'Files to exclude - default is none') do |v|
|
55
|
-
options[:exclude] = v
|
56
|
-
end
|
41
|
+
@options[:exclude] ||
|
42
|
+
@source_finder_option_parser.default_source_files_exclude_glob
|
57
43
|
end
|
58
44
|
|
59
45
|
def add_help_option(opts, options)
|
@@ -65,8 +51,7 @@ module BigFiles
|
|
65
51
|
def setup_options(opts)
|
66
52
|
options = {}
|
67
53
|
opts.banner = 'Usage: bigfiles [options]'
|
68
|
-
|
69
|
-
add_exclude_glob_option(opts, options)
|
54
|
+
@source_finder_option_parser.add_options(opts, options)
|
70
55
|
add_help_option(opts, options)
|
71
56
|
options
|
72
57
|
end
|
@@ -79,7 +64,7 @@ module BigFiles
|
|
79
64
|
def find_analyze_and_report_on_files
|
80
65
|
@source_file_globber.source_files_glob = glob
|
81
66
|
@source_file_globber.source_files_exclude_glob = exclude_glob
|
82
|
-
file_list = @source_file_globber.
|
67
|
+
file_list = @source_file_globber.source_files_arr
|
83
68
|
files_with_lines = file_list.map do |filename|
|
84
69
|
@file_with_lines.new(filename)
|
85
70
|
end
|
data/lib/bigfiles/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigfiles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: source_finder
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
19
|
+
version: '2'
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|