reagan 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa82dc3e27d070c5d66ca40b4088d68b21a9ca3d
4
- data.tar.gz: d2c7fb3484aff6e8ab84f25a3271d061c75e1d25
3
+ metadata.gz: 5cdf319dc7aafcfdab1c853b9dc1ccc807e0cfe5
4
+ data.tar.gz: 2c3f9b61287238314f851ace86fa9ea736b00dc3
5
5
  SHA512:
6
- metadata.gz: dc48ac3f3659ae8d49a87f3dec1293d67bc183d9658ea6119a3b40eebab5456ffdbc79b73ecd44a00be10c8a283c825a71b130db1dc50db767f3f62c27362ad3
7
- data.tar.gz: 033de188750db73a5881192a6b52bd9cc4fc386c0af37f168f0d58794d8c3391894bd8ac3dc0327a674e86cbf816f7e610968ddabd2d25d9bc9193ec32b5d360
6
+ metadata.gz: fb69381eee4203050887b8f906913ecab3584ca7c3db68c0b711d0238813ecb669e9de2fe26227ad1c19d23c92b5d96f722d40c07b8cff0c18f66d50bae4b2ba
7
+ data.tar.gz: 02b7f2e4c3505c615505f023489d1d4834879289643f73dec06673c766e7a654fb02351d355a2e0c1f79ff96b226a160c41e20b43979500fe58a717c15edbe91
data/lib/application.rb CHANGED
@@ -26,9 +26,9 @@ module Reagan
26
26
  require 'test_reagan'
27
27
  require 'test_version'
28
28
 
29
- attr_accessor :config
30
29
  def initialize
31
- @@config = Reagan::Config.new.settings
30
+ @config_obj = Reagan::Config.new
31
+ @@config = @config_obj.settings
32
32
  @changes = Reagan::Change.new.files
33
33
  end
34
34
 
@@ -56,8 +56,17 @@ module Reagan
56
56
  end
57
57
  end
58
58
 
59
+ # check and see if the -p flag was passed and if so print the config hash
60
+ def check_print_config
61
+ return unless @@config['flags']['print_config']
62
+ pretty_print('Current config file / CLI flag values')
63
+ @config_obj.print_config
64
+ exit 0
65
+ end
66
+
59
67
  # run tests on each changed cookbook
60
68
  def run
69
+ check_print_config
61
70
  check_empty_update
62
71
 
63
72
  # print objects that will be tested
data/lib/config.rb CHANGED
@@ -35,12 +35,16 @@ module Reagan
35
35
 
36
36
  # grabs the flags passed in via command line
37
37
  def flag_parser
38
- flags = { :pull => nil, :override_cookbooks => nil, :config => '/etc/reagan.yml' }
38
+ flags = { :pull => nil, :override_cookbooks => nil, :config => '/etc/reagan.yml', :print_config => false }
39
39
  OptionParser.new do |opts|
40
40
  opts.banner = 'Usage: reagan [options]'
41
41
  opts.on('-o', '--override cb1,cb2', 'Comma separated list of cookbooks to test') do |cookbooks|
42
42
  flags[:override_cookbooks] = cookbooks.split(',')
43
43
  end
44
+
45
+ opts.on('-p', '--print', 'Print the config options that will be used') do |config|
46
+ flags[:print_config] = config
47
+ end
44
48
 
45
49
  opts.on('-p', '--pull_num 123', 'Github pull number to test') do |pull|
46
50
  flags[:pull] = pull
@@ -82,5 +86,20 @@ module Reagan
82
86
  @flags.each { |k, v| config['flags'][k.to_s] = v }
83
87
  config
84
88
  end
89
+
90
+ # pretty print the config hash
91
+ def print_config(hash = nil, spaces = 0)
92
+ hash = @settings if hash.nil?
93
+ hash.each do |k, v|
94
+ spaces.times { print ' ' }
95
+ print k.to_s + ': '
96
+ if v.class == Hash
97
+ print "\n"
98
+ print_config(v, spaces + 2)
99
+ else
100
+ puts v
101
+ end
102
+ end
103
+ end
85
104
  end
86
105
  end
data/reagan.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'reagan'
3
- s.version = '0.8.0'
3
+ s.version = '0.8.1'
4
4
  s.date = Date.today.to_s
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.extra_rdoc_files = ['README.md', 'LICENSE']
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.required_ruby_version = '>= 1.9.3'
15
15
  s.add_dependency 'octokit', '~> 3.0'
16
- s.add_dependency 'chef', '~> 11.0'
16
+ s.add_dependency 'chef', '>= 11.0'
17
17
  s.add_dependency 'ridley', '~> 4.0'
18
18
  s.add_development_dependency 'rake', '~> 10.0'
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reagan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: chef
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '11.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '11.0'
41
41
  - !ruby/object:Gem::Dependency
@@ -124,3 +124,4 @@ specification_version: 4
124
124
  summary: Trust But Verify - Ruby build script for Jenkins that automates the testing
125
125
  of Chef cookbooks
126
126
  test_files: []
127
+ has_rdoc: