bmc-daemon-lib 0.8.0 → 0.9.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/Gemfile.lock +3 -3
 - data/bmc-daemon-lib.gemspec +1 -1
 - data/lib/bmc-daemon-lib/conf.rb +45 -38
 - data/lib/bmc-daemon-lib/worker.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: f1519e2b73ad52b107340fdc4b552a241eda330f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: efe6a470bc0c1b5bb64652ca2c8c09f8eb5e2af4
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 35b425a7c42b1b2f4ac771d7f056ddc69d71a74854c5af549464b1c33680d2b82159ae2e2de93da6069875cff9e8edb5ae13e6d0fe11668dc5124ae125aa8eee
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: bf675ec3c7f45e69dcfe57a3fd5f903080982e764c585e882b40774b7e5579dd81dc2ea02c2aa0242da1c9c51dd1bd80034e5c857880fe554a4bb3cb04273c79
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                bmc-daemon-lib (0. 
     | 
| 
      
 4 
     | 
    
         
            +
                bmc-daemon-lib (0.9.0)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  chamber (~> 2.9.1)
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            GEM
         
     | 
| 
         @@ -12,8 +12,8 @@ GEM 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  hashie (~> 3.3)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  thor (~> 0.19.1)
         
     | 
| 
       14 
14 
     | 
    
         
             
                diff-lcs (1.3)
         
     | 
| 
       15 
     | 
    
         
            -
                hashie (3.5. 
     | 
| 
       16 
     | 
    
         
            -
                parser (2. 
     | 
| 
      
 15 
     | 
    
         
            +
                hashie (3.5.3)
         
     | 
| 
      
 16 
     | 
    
         
            +
                parser (2.4.0.0)
         
     | 
| 
       17 
17 
     | 
    
         
             
                  ast (~> 2.2)
         
     | 
| 
       18 
18 
     | 
    
         
             
                powerpack (0.1.1)
         
     | 
| 
       19 
19 
     | 
    
         
             
                rainbow (2.2.1)
         
     | 
    
        data/bmc-daemon-lib.gemspec
    CHANGED
    
    
    
        data/lib/bmc-daemon-lib/conf.rb
    CHANGED
    
    | 
         @@ -63,8 +63,8 @@ module BmcDaemonLib 
     | 
|
| 
       63 
63 
     | 
    
         
             
                  ENV["NEWRELIC_AGENT_ENABLED"] = "false"
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
       65 
65 
     | 
    
         
             
                  # Add other config files
         
     | 
| 
       66 
     | 
    
         
            -
                  add_config  
     | 
| 
       67 
     | 
    
         
            -
                  add_config  
     | 
| 
      
 66 
     | 
    
         
            +
                  add_config generate_config_defaults
         
     | 
| 
      
 67 
     | 
    
         
            +
                  add_config generate_config_etc
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                  # Return something
         
     | 
| 
       70 
70 
     | 
    
         
             
                  return @app_name
         
     | 
| 
         @@ -136,54 +136,61 @@ module BmcDaemonLib 
     | 
|
| 
       136 
136 
     | 
    
         
             
                  return logfile
         
     | 
| 
       137 
137 
     | 
    
         
             
                end
         
     | 
| 
       138 
138 
     | 
    
         | 
| 
       139 
     | 
    
         
            -
                 
     | 
| 
      
 139 
     | 
    
         
            +
                # Feature testers
         
     | 
| 
      
 140 
     | 
    
         
            +
                def self.feature_newrelic?
         
     | 
| 
      
 141 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 142 
     | 
    
         
            +
                  return false if Gem.datadir('newrelic_rpm').nil?
         
     | 
| 
      
 143 
     | 
    
         
            +
                  return false if self.at(:newrelic, :enabled) == false
         
     | 
| 
      
 144 
     | 
    
         
            +
                  return false if self.at(:newrelic, :disabled) == true
         
     | 
| 
      
 145 
     | 
    
         
            +
                  return self.at(:newrelic, :license) || false
         
     | 
| 
      
 146 
     | 
    
         
            +
                end
         
     | 
| 
      
 147 
     | 
    
         
            +
                def self.feature_rollbar?
         
     | 
| 
       140 
148 
     | 
    
         
             
                  ensure_init
         
     | 
| 
      
 149 
     | 
    
         
            +
                  return false if Gem.datadir('rollbar').nil?
         
     | 
| 
      
 150 
     | 
    
         
            +
                  return false if self.at(:rollbar, :enabled) == false
         
     | 
| 
      
 151 
     | 
    
         
            +
                  return false if self.at(:rollbar, :disabled) == true
         
     | 
| 
      
 152 
     | 
    
         
            +
                  return self.at(:rollbar, :token) || false
         
     | 
| 
      
 153 
     | 
    
         
            +
                end
         
     | 
| 
       141 
154 
     | 
    
         | 
| 
       142 
     | 
    
         
            -
             
     | 
| 
      
 155 
     | 
    
         
            +
                def self.feature? name
         
     | 
| 
       143 
156 
     | 
    
         
             
                  case name
         
     | 
| 
       144 
157 
     | 
    
         
             
                  when :newrelic
         
     | 
| 
       145 
     | 
    
         
            -
                    return  
     | 
| 
       146 
     | 
    
         
            -
                    return false if self.at(:newrelic, :enabled) == false
         
     | 
| 
       147 
     | 
    
         
            -
                    return false if self.at(:newrelic, :disabled) == true
         
     | 
| 
       148 
     | 
    
         
            -
                    return self.at(:newrelic, :license) || false
         
     | 
| 
      
 158 
     | 
    
         
            +
                    return feature_newrelic?
         
     | 
| 
       149 
159 
     | 
    
         
             
                  when :rollbar
         
     | 
| 
       150 
     | 
    
         
            -
                    return  
     | 
| 
       151 
     | 
    
         
            -
                    return false if self.at(:rollbar, :enabled) == false
         
     | 
| 
       152 
     | 
    
         
            -
                    return false if self.at(:rollbar, :disabled) == true
         
     | 
| 
       153 
     | 
    
         
            -
                    return self.at(:rollbar, :token) || false
         
     | 
| 
      
 160 
     | 
    
         
            +
                    return feature_rollbar?
         
     | 
| 
       154 
161 
     | 
    
         
             
                  end
         
     | 
| 
       155 
162 
     | 
    
         
             
                  return false
         
     | 
| 
       156 
163 
     | 
    
         
             
                end
         
     | 
| 
       157 
164 
     | 
    
         | 
| 
       158 
     | 
    
         
            -
                #  
     | 
| 
       159 
     | 
    
         
            -
                def self. 
     | 
| 
      
 165 
     | 
    
         
            +
                # Generators
         
     | 
| 
      
 166 
     | 
    
         
            +
                def self.generate_user_agent
         
     | 
| 
       160 
167 
     | 
    
         
             
                  ensure_init
         
     | 
| 
       161 
     | 
    
         
            -
                   
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
       169 
     | 
    
         
            -
                   
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
                   
     | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
       174 
     | 
    
         
            -
             
     | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
             
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
      
 168 
     | 
    
         
            +
                  "#{@app_name}/#{@app_ver}" if @app_name && @app_ver
         
     | 
| 
      
 169 
     | 
    
         
            +
                end
         
     | 
| 
      
 170 
     | 
    
         
            +
                def self.generate_config_defaults
         
     | 
| 
      
 171 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 172 
     | 
    
         
            +
                  "#{@app_root}/defaults.yml" if @app_root
         
     | 
| 
      
 173 
     | 
    
         
            +
                end
         
     | 
| 
      
 174 
     | 
    
         
            +
                def self.generate_config_etc
         
     | 
| 
      
 175 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 176 
     | 
    
         
            +
                  "/etc/#{@app_name}.yml" if @app_name
         
     | 
| 
      
 177 
     | 
    
         
            +
                end
         
     | 
| 
      
 178 
     | 
    
         
            +
                def self.generate_process_name
         
     | 
| 
      
 179 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 180 
     | 
    
         
            +
                  parts = [@app_name, @app_env]
         
     | 
| 
      
 181 
     | 
    
         
            +
                  parts << self[:port] if self[:port]
         
     | 
| 
      
 182 
     | 
    
         
            +
                  parts.join('-')
         
     | 
| 
      
 183 
     | 
    
         
            +
                end
         
     | 
| 
      
 184 
     | 
    
         
            +
                def self.generate_pidfile
         
     | 
| 
      
 185 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 186 
     | 
    
         
            +
                  process_name = self.generate_process_name
         
     | 
| 
      
 187 
     | 
    
         
            +
                  File.expand_path "#{process_name}.pid", PIDFILE_DIR
         
     | 
| 
      
 188 
     | 
    
         
            +
                end
         
     | 
| 
      
 189 
     | 
    
         
            +
                def self.generate_config_message
         
     | 
| 
      
 190 
     | 
    
         
            +
                  ensure_init
         
     | 
| 
      
 191 
     | 
    
         
            +
                    config_defaults = self.generate_config_defaults
         
     | 
| 
       183 
192 
     | 
    
         
             
                    config_etc = self.generate(:config_etc)
         
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
193 
     | 
    
         
             
                    "A default configuration is available (#{config_defaults}) and can be copied to the default location (#{config_etc}): \n sudo cp #{config_defaults} #{config_etc}"
         
     | 
| 
       186 
     | 
    
         
            -
                  end
         
     | 
| 
       187 
194 
     | 
    
         
             
                end
         
     | 
| 
       188 
195 
     | 
    
         | 
| 
       189 
196 
     | 
    
         
             
                def self.prepare_newrelic
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: bmc-daemon-lib
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.9.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Bruno MEDICI
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017-02- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-02-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |