kafo 0.0.8 → 0.0.9

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.

Potentially problematic release.


This version of kafo might be problematic. Click here for more details.

data/lib/kafo.rb CHANGED
@@ -1,2 +1,3 @@
1
+ # encoding: UTF-8
1
2
  require 'kafo/version'
2
3
  require 'kafo/kafo_configure'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'yaml'
2
3
  require 'kafo/puppet_module'
3
4
  require 'kafo/password_manager'
@@ -25,13 +26,15 @@ class Configuration
25
26
  @data = YAML.load_file(@answer_file)
26
27
  rescue Errno::ENOENT => e
27
28
  puts "No answers file at #{@answer_file} found, can not continue"
28
- exit(:no_answer_file)
29
+ KafoConfigure.exit(:no_answer_file)
29
30
  end
30
31
 
31
32
  @config_dir = File.dirname(@config_file)
32
33
  end
33
34
 
34
35
  def save_configuration(configuration)
36
+ FileUtils.touch @config_file
37
+ File.chmod 0600, @config_file
35
38
  File.open(@config_file, 'w') { |file| file.write(YAML.dump(configuration)) }
36
39
  end
37
40
 
@@ -66,7 +69,7 @@ class Configuration
66
69
  @logger.debug `#{command}`
67
70
  unless $?.exitstatus == 0
68
71
  @logger.error "Could not get default values, cannot continue"
69
- exit(:default_error)
72
+ KafoConfigure.exit(:defaults_error)
70
73
  end
71
74
  @logger.info "... finished"
72
75
  YAML.load_file(File.join(KafoConfigure.config.app[:default_values_dir], 'default_values.yaml'))
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class ConfigurationException < StandardError
2
3
  end
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'pty'
2
3
  require 'clamp'
3
4
  require 'kafo/exceptions'
data/lib/kafo/logger.rb CHANGED
@@ -1,11 +1,9 @@
1
+ # encoding: UTF-8
1
2
  require 'fileutils'
2
3
  require 'logging'
3
4
 
4
5
  class Logger
5
6
  pattern = "[%5l %d %c] %m\n"
6
- COLOR_LAYOUT = Logging::Layouts::Pattern.new(:pattern => pattern, :color_scheme => 'bright')
7
- NOCOLOR_LAYOUT = Logging::Layouts::Pattern.new(:pattern => pattern, :color_scheme => nil)
8
-
9
7
  Logging.color_scheme('bright',
10
8
  :levels => {
11
9
  :info => :green,
@@ -19,6 +17,8 @@ class Logger
19
17
  :file => :yellow,
20
18
  :method => :yellow
21
19
  )
20
+ COLOR_LAYOUT = Logging::Layouts::Pattern.new(:pattern => pattern, :color_scheme => 'bright')
21
+ NOCOLOR_LAYOUT = Logging::Layouts::Pattern.new(:pattern => pattern, :color_scheme => nil)
22
22
 
23
23
  def self.setup
24
24
  begin
data/lib/kafo/param.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class Param
2
3
  attr_reader :name, :module
3
4
  attr_accessor :default, :doc, :value_set
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class ParamBuilder
2
3
  ATTRIBUTE_RE = /^(type):(.*)/
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'securerandom'
2
3
  require 'digest/sha2'
3
4
  require 'openssl'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class PuppetCommand
2
3
  def initialize(command, options = [])
3
4
  @command = command
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'kafo/param'
2
3
  require 'kafo/param_builder'
3
4
  require 'kafo/puppet_module_parser'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'puppet'
2
3
  require 'rdoc'
3
4
  # Based on ideas from puppet-parse by Johan van den Dorpe
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module StringHelper
2
3
  def dashize(string)
3
4
  string.tr('_', '-')
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  # we require separate STDERR
2
3
  require 'open3'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class Validator
2
3
 
3
4
  def initialize(params)
data/lib/kafo/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module Kafo
2
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-04 00:00:00.000000000 Z
12
+ date: 2013-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler