bigsister 0.1.2 → 0.2.0
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 +4 -4
 - data/GHANGELOG.md +9 -1
 - data/lib/bigsister/application.rb +22 -16
 - data/lib/bigsister/monitors/local.rb +2 -0
 - data/lib/bigsister/reporter.rb +2 -2
 - data/lib/bigsister/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9b8a6ea96901e98e0c74a7126a3b055308cb6c1b383b636024193d6a6c1b7578
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c26bddb5e35e8f61fd7352eea93f851f5a13c444234244314a6e031f3ff623dd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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. 
     | 
| 
      
 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", " 
     | 
| 
      
 7 
     | 
    
         
            +
                DEFAULT_CONFIG_PATHS = ["./.bigsister.yml", "#{Dir.home}/.bigsister/config.yml"].freeze
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                attr_reader : 
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
       19 
     | 
    
         
            -
                    config. 
     | 
| 
       20 
     | 
    
         
            -
                       
     | 
| 
       21 
     | 
    
         
            -
                         
     | 
| 
       22 
     | 
    
         
            -
                           
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                         
     | 
| 
       27 
     | 
    
         
            -
                           
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
      
 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
         
     | 
    
        data/lib/bigsister/reporter.rb
    CHANGED
    
    | 
         @@ -70,7 +70,7 @@ module BigSister 
     | 
|
| 
       70 
70 
     | 
    
         
             
                  elsif type == "file_size"
         
     | 
| 
       71 
71 
     | 
    
         
             
                    file.file_size
         
     | 
| 
       72 
72 
     | 
    
         
             
                  elsif type == "literal"
         
     | 
| 
       73 
     | 
    
         
            -
                     
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
      
 90 
     | 
    
         
            +
                    column.fetch("value", nil)
         
     | 
| 
       91 
91 
     | 
    
         
             
                  end
         
     | 
| 
       92 
92 
     | 
    
         
             
                end
         
     | 
| 
       93 
93 
     | 
    
         | 
    
        data/lib/bigsister/version.rb
    CHANGED