netscan_calife 0.0.5 → 0.0.6
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/bin/netscan_calife +2 -3
 - data/lib/netscan_calife/ip_scan.rb +5 -1
 - data/lib/netscan_calife/version.rb +1 -1
 - data/lib/netscan_calife.rb +4 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: aca2bcd020ad5f3100e98f8db29d039b0445c633
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 33ed84b50be9dd327ef10f7ab6de605d1a9fddbe
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 4ff5d48abae7e5eb5916208ccf4f6c6d273dd75a70e39a71791018ee13d7820436075b0d98310a4fb028cb151bcc88ce4611b1b4ffb1f9fee39fa693d750cc39
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1d3c8d8ff05b7f77bd2c099d91aa5a97b553cd3ad61d36f9802ab2498140122869e45f4a0d9790f8a2556a424763951731e05b978decfe76029cb6fd367b9c69
         
     | 
    
        data/bin/netscan_calife
    CHANGED
    
    | 
         @@ -1,6 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
     | 
    
         
            -
            require "netscan_calife 
     | 
| 
       3 
     | 
    
         
            -
            require "netscan_calife/ip_scan"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "netscan_calife"
         
     | 
| 
       4 
3 
     | 
    
         
             
            require 'optparse'
         
     | 
| 
       5 
4 
     | 
    
         
             
            require 'pp'
         
     | 
| 
       6 
5 
     | 
    
         | 
| 
         @@ -72,7 +71,7 @@ end 
     | 
|
| 
       72 
71 
     | 
    
         
             
            scan_result=NetscanCalife::IpScan.scan(options[:network].to_s,options[:netmask].to_s)
         
     | 
| 
       73 
72 
     | 
    
         | 
| 
       74 
73 
     | 
    
         
             
            unless(options[:filename].nil?) # Write result to file
         
     | 
| 
       75 
     | 
    
         
            -
              NetscanCalife::IpScan.to_yaml(scan_result,options[:filename])
         
     | 
| 
      
 74 
     | 
    
         
            +
              puts "Result saved to #{options[:filename]}" if NetscanCalife::IpScan.to_yaml(scan_result,options[:filename])
         
     | 
| 
       76 
75 
     | 
    
         
             
            else # Output result to console
         
     | 
| 
       77 
76 
     | 
    
         
             
              NetscanCalife::IpScan.format_result(scan_result)
         
     | 
| 
       78 
77 
     | 
    
         
             
            end
         
     | 
| 
         @@ -44,12 +44,16 @@ module NetscanCalife 
     | 
|
| 
       44 
44 
     | 
    
         
             
                # === Serialize scan result to yaml file
         
     | 
| 
       45 
45 
     | 
    
         
             
                # * *Args*    :
         
     | 
| 
       46 
46 
     | 
    
         
             
                #   - ++ -> data
         
     | 
| 
      
 47 
     | 
    
         
            +
                # * *Returns* :
         
     | 
| 
      
 48 
     | 
    
         
            +
                #   - true on success
         
     | 
| 
       47 
49 
     | 
    
         
             
                #
         
     | 
| 
       48 
50 
     | 
    
         
             
                def self.to_yaml(data,filename)
         
     | 
| 
       49 
51 
     | 
    
         | 
| 
       50 
52 
     | 
    
         
             
                  File.open(filename,"w") { |fileobj|
         
     | 
| 
       51 
53 
     | 
    
         
             
                    YAML.dump(data,fileobj)
         
     | 
| 
       52 
54 
     | 
    
         
             
                  }
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  return true
         
     | 
| 
       53 
57 
     | 
    
         | 
| 
       54 
58 
     | 
    
         
             
                end
         
     | 
| 
       55 
59 
     | 
    
         | 
| 
         @@ -80,7 +84,7 @@ module NetscanCalife 
     | 
|
| 
       80 
84 
     | 
    
         
             
                  when 'txt'
         
     | 
| 
       81 
85 
     | 
    
         
             
                    printf "%s\n","-----------------------------------------"
         
     | 
| 
       82 
86 
     | 
    
         
             
                    printf "|\t%s\t\t|\t%s\t|\n","HOST","FOUND"      
         
     | 
| 
       83 
     | 
    
         
            -
                    printf "%s\n","-----------------------------------------" 
     | 
| 
      
 87 
     | 
    
         
            +
                    printf "%s\n","-----------------------------------------"
         
     | 
| 
       84 
88 
     | 
    
         
             
                    data.each { |host,found|
         
     | 
| 
       85 
89 
     | 
    
         
             
                      printf "|\t%s\t|\t%s\t|\n","#{host}","#{found}"
         
     | 
| 
       86 
90 
     | 
    
         
             
                    }
         
     | 
    
        data/lib/netscan_calife.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: netscan_calife
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - calife
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015-09- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-09-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |