sockd 0.3.0 → 0.3.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 +4 -4
- data/lib/sockd.rb +2 -2
- data/lib/sockd/runner.rb +6 -2
- data/lib/sockd/version.rb +1 -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: 22b8a9ad90fe47dae69da26ef9d88774529e9b9a
         | 
| 4 | 
            +
              data.tar.gz: c94d37f82af935bad426c91209b2cb7258cbdeed
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2bd29d45c860985129b625157fc66993f6c88952568d81cfafc1027a08bcaf1b93dc39e8db011a8f516600e737d89f92bc20b77c0e9f660e0792b80f5eb52d4d
         | 
| 7 | 
            +
              data.tar.gz: 2170f73f868f664ccb9671cea2ffeabbbacb5532fe49cff3e0495113323374f74fbc70c04653107f996769a79380c4dd60bad848799417266b9884a431d61d53
         | 
    
        data/lib/sockd.rb
    CHANGED
    
    | @@ -31,7 +31,7 @@ module Sockd | |
| 31 31 | 
             
                    raise ParseError, 'no config file path specified, unable to save' unless save_path
         | 
| 32 32 | 
             
                    save_yaml options, save_path
         | 
| 33 33 |  | 
| 34 | 
            -
                    puts "config saved to: #{ | 
| 34 | 
            +
                    puts "config saved to: #{save_path}"
         | 
| 35 35 | 
             
                    exit
         | 
| 36 36 | 
             
                  end
         | 
| 37 37 |  | 
| @@ -154,7 +154,7 @@ module Sockd | |
| 154 154 |  | 
| 155 155 | 
             
                def read_yaml(options, path)
         | 
| 156 156 | 
             
                  config = YAML.load_file(path).merge!(options)
         | 
| 157 | 
            -
                  options.replace | 
| 157 | 
            +
                  options.replace Hash[config.map{ |k, v| [k.to_sym, v] }]
         | 
| 158 158 | 
             
                rescue Errno::EACCES, Errno::EISDIR => e
         | 
| 159 159 | 
             
                  raise ConfigFileError, "unable to read config (#{e.message})"
         | 
| 160 160 | 
             
                end
         | 
    
        data/lib/sockd/runner.rb
    CHANGED
    
    | @@ -134,6 +134,8 @@ module Sockd | |
| 134 134 | 
             
                    warn "#{name} process not running"
         | 
| 135 135 | 
             
                  end
         | 
| 136 136 | 
             
                  self
         | 
| 137 | 
            +
                rescue Errno::EPERM => e
         | 
| 138 | 
            +
                  raise ServiceError, "unable to stop #{name} process (#{e.message})"
         | 
| 137 139 | 
             
                end
         | 
| 138 140 |  | 
| 139 141 | 
             
                # restart our service
         | 
| @@ -195,9 +197,9 @@ module Sockd | |
| 195 197 | 
             
                  ensure
         | 
| 196 198 | 
             
                    server.close
         | 
| 197 199 | 
             
                  end
         | 
| 198 | 
            -
                rescue Errno::EACCES
         | 
| 200 | 
            +
                rescue Errno::EACCES, Errno::EADDRINUSE => e
         | 
| 199 201 | 
             
                  sock = options[:socket] || "#{options[:host]}:#{options[:port]}"
         | 
| 200 | 
            -
                  raise ServiceError, "unable to open socket: #{sock} ( | 
| 202 | 
            +
                  raise ServiceError, "unable to open socket: #{sock} (#{e.message})"
         | 
| 201 203 | 
             
                end
         | 
| 202 204 |  | 
| 203 205 | 
             
                # return a UNIXSocket or TCPSocket instance depending on config
         | 
| @@ -260,6 +262,8 @@ module Sockd | |
| 260 262 | 
             
                  pid
         | 
| 261 263 | 
             
                rescue Errno::ESRCH
         | 
| 262 264 | 
             
                  false
         | 
| 265 | 
            +
                rescue Errno::EPERM
         | 
| 266 | 
            +
                  pid
         | 
| 263 267 | 
             
                end
         | 
| 264 268 |  | 
| 265 269 | 
             
                # reverse of daemon_running?
         | 
    
        data/lib/sockd/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sockd
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mike Greiling
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015-05- | 
| 11 | 
            +
            date: 2015-05-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |