bigsister 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e856359282c49195b70bf99957e8a51b15829dd04db3e60585cfeff07e07f7bd
4
- data.tar.gz: 2a0a5e21088f29e54bb2677c13d05a75d43a155d244072cf5a6d3ff667006eb5
3
+ metadata.gz: 9b8a6ea96901e98e0c74a7126a3b055308cb6c1b383b636024193d6a6c1b7578
4
+ data.tar.gz: c26bddb5e35e8f61fd7352eea93f851f5a13c444234244314a6e031f3ff623dd
5
5
  SHA512:
6
- metadata.gz: 78f223af17f62af998f0ce1589472a6d642ca8eb87e22e92ebc44c6f129063e4cfaa8d932cb2e59dad0beba01d0f8f813abd70f8b3c6b507b08e80bd03cf7f8f
7
- data.tar.gz: 920e554d8c4796f8113f80e688a6ea21e6461f07eda99bda0e12995cbc4e7ada5b8e9b425f3d8ff45895fe92757fb6f5735f349144f1a284c51541f1e84809b3
6
+ metadata.gz: ab45d17b58c0b0d9a8a34891f25aba9633d727d468c183c88b28175523f1d402eefd22a5eaabd150fa4282ad0aca4654de6ff47541ee502fc01b0cd90e9c0dea
7
+ data.tar.gz: 352d617beaa59dd8bd44c718b23e9eaf30fbede009d23e18ea02ef510a6bdf9ad18ca5f12e0942fac277d13730941cd155c2e932be6bd0f02eaa5809c7068f92
data/GHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to BigSister will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.2.0] - Nov 11, 2019
8
+ ### Changed
9
+ * Configs now stored as array of `sister`s
10
+ * Fix literal column
11
+ * Fix home dir config for Windows
12
+ * Don't include . and .. symlinks for reported directories
13
+
7
14
  ## [0.1.2] - Nov 11, 2019
8
15
  ### Added
9
16
  * CSV reporter
@@ -14,6 +21,7 @@ All notable changes to BigSister will be documented in this file.
14
21
  * Basic Application object
15
22
  * CLI tool
16
23
 
17
- [Unreleased]: https://github.com/paulholden2/bigsister/compare/0.1.2...HEAD
24
+ [Unreleased]: https://github.com/paulholden2/bigsister/compare/0.2.0...HEAD
18
25
  [0.1.1]: https://github.com/paulholden2/bigsister/releases/tag/0.1.1
19
26
  [0.1.2]: https://github.com/paulholden2/bigsister/releases/tag/0.1.2
27
+ [0.2.0]: https://github.com/paulholden2/bigsister/releases/tag/0.2.0
@@ -4,31 +4,34 @@ require "bigsister/configuration"
4
4
 
5
5
  module BigSister
6
6
  class Application
7
- DEFAULT_CONFIG_PATHS = ["./.bigsister.yml", "~/.bigsister/config.yml"].freeze
7
+ DEFAULT_CONFIG_PATHS = ["./.bigsister.yml", "#{Dir.home}/.bigsister/config.yml"].freeze
8
8
 
9
- attr_reader :config
9
+ attr_reader :configs
10
10
 
11
11
  def initialize(opts = {})
12
12
  @config_paths = opts[:config_paths] || DEFAULT_CONFIG_PATHS
13
+ @configs = []
13
14
 
14
15
  load_config!
15
16
  end
16
17
 
17
18
  def run
18
- config.reporters.each { |reporter|
19
- config.monitors.each { |monitor|
20
- if reporter.log_files?
21
- monitor.files.each { |file|
22
- reporter.log_file(file)
23
- }
24
- end
25
- if reporter.log_directories?
26
- monitor.directories.each { |directory|
27
- reporter.log_directory(directory)
28
- }
29
- end
19
+ configs.each { |config|
20
+ config.reporters.each { |reporter|
21
+ config.monitors.each { |monitor|
22
+ if reporter.log_files?
23
+ monitor.files.each { |file|
24
+ reporter.log_file(file)
25
+ }
26
+ end
27
+ if reporter.log_directories?
28
+ monitor.directories.each { |directory|
29
+ reporter.log_directory(directory)
30
+ }
31
+ end
32
+ }
33
+ reporter.render
30
34
  }
31
- reporter.render
32
35
  }
33
36
  end
34
37
 
@@ -41,7 +44,10 @@ module BigSister
41
44
  if yaml.nil?
42
45
  raise BigSister::NoConfigurationFound.new(@config_paths)
43
46
  end
44
- @config = Configuration.new(yaml)
47
+ sisters = yaml.fetch("sisters", [])
48
+ sisters.each { |config|
49
+ @configs.push(Configuration.new(config))
50
+ }
45
51
  end
46
52
  end
47
53
  end
@@ -28,6 +28,8 @@ module BigSister
28
28
  def directories
29
29
  res = Dir.entries(@path).select { |file|
30
30
  File.directory?(File.join(@path, file))
31
+ }.reject { |dir|
32
+ dir == "." || dir == ".."
31
33
  }.map { |dir|
32
34
  dir_path = File.join(@path, dir)
33
35
  file_count = Dir.entries(dir_path).reject { |file| File.directory?(File.join(dir_path, file)) }.size
@@ -70,7 +70,7 @@ module BigSister
70
70
  elsif type == "file_size"
71
71
  file.file_size
72
72
  elsif type == "literal"
73
- @schema.fetch("value", nil)
73
+ column.fetch("value", nil)
74
74
  end
75
75
  end
76
76
 
@@ -87,7 +87,7 @@ module BigSister
87
87
  elsif type == "directory_count"
88
88
  directory.directory_count
89
89
  elsif type == "literal"
90
- @schema.fetch("value", nil)
90
+ column.fetch("value", nil)
91
91
  end
92
92
  end
93
93
 
@@ -1,3 +1,3 @@
1
1
  module BigSister
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigsister
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Holden