Sha256: 405257f06a0ef076fba4df87790921c6d25bb7f651d780e947ec6ba35d498e57
Contents?: true
Size: 766 Bytes
Versions: 17
Compression:
Stored size: 766 Bytes
Contents
require 'puppetfactory' class Puppetfactory::Helpers def self.configure(options) @@options = options end def self.environment_name(username) case @@options[:repomodel] when :peruser "#{username}_production" when :single username else raise "Invalid setting for repomodel (#{repomodel})" end end def self.approximate_time_difference(timestamp) return 'never' if timestamp.nil? start = timestamp.class == String ? Time.parse(timestamp) : timestamp delta = (Time.now - start) if delta > 60 # This grossity is rounding to the nearest whole minute mins = ((delta / 600).round(1)*10).to_i "about #{mins} minutes ago" else "#{delta.to_i} seconds ago" end end end
Version data entries
17 entries across 17 versions & 1 rubygems