Module: PuppetHerald
- Defined in:
- lib/puppet-herald.rb,
lib/puppet-herald/app.rb,
lib/puppet-herald/cli.rb,
lib/puppet-herald/version.rb,
lib/puppet-herald/database.rb,
lib/puppet-herald/javascript.rb
Defined Under Namespace
Classes: App, CLI, Database, Javascript
Constant Summary
collapse
- VERSION =
version_prep '0.1.0'
- LICENSE =
'Apache 2.0'
- NAME =
'Puppet Herald'
- PACKAGE =
'puppet-herald'
- SUMMARY =
'a Puppet report processor'
- DESCRIPTION =
"Provides a gateway for consuming puppet reports, a REST API and a simple Web app to display reports."
- HOMEPAGE =
'https://github.com/wavesoftware/gem-puppet-herald'
- @@root =
File.dirname(File.dirname(File.realpath(__FILE__)))
Class Method Summary
collapse
Class Method Details
.environment ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/puppet-herald.rb', line 19
def self.environment
env = :production
unless ENV['PUPPET_HERALD_ENV'].nil?
env = ENV['PUPPET_HERALD_ENV'].to_sym
end
return env
end
|
.is_in_dev? ⇒ Boolean
27
28
29
|
# File 'lib/puppet-herald.rb', line 27
def self.is_in_dev?
return [:development, :dev, :test, :ci].include? environment
end
|
.is_in_prod? ⇒ Boolean
31
32
33
|
# File 'lib/puppet-herald.rb', line 31
def self.is_in_prod?
return !is_in_dev?
end
|
.port ⇒ Object
15
16
17
|
# File 'lib/puppet-herald.rb', line 15
def self.port
@@port
end
|
.relative_dir(dir) ⇒ Object
11
12
13
|
# File 'lib/puppet-herald.rb', line 11
def self.relative_dir dir
File.join @@root, dir
end
|
.version_prep(desired) ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'lib/puppet-herald/version.rb', line 3
def self.version_prep desired
version = desired
if desired.match(/[^0-9\.]+/)
git = `git describe --tags --dirty --always`
version += "-" + git[1..-1]
end
return version.strip
end
|