r10k 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  require 'r10k'
2
2
  require 'r10k/logging'
3
+ require 'r10k/cli/ext/logging'
3
4
  require 'cri'
4
5
 
5
6
  module R10K::CLI
@@ -1,6 +1,7 @@
1
1
  require 'r10k/cli'
2
2
  require 'r10k/synchro/git'
3
3
  require 'cri'
4
+ require 'r10k/logging'
4
5
 
5
6
  module R10K::CLI
6
7
  module Cache
@@ -12,7 +13,6 @@ module R10K::CLI
12
13
 
13
14
  run do |opts, args, cmd|
14
15
  sources = R10K::Deployment.instance[:sources]
15
-
16
16
  remotes = Set.new
17
17
 
18
18
  sources.each_pair do |name, hash|
@@ -20,7 +20,7 @@ module R10K::CLI
20
20
  end
21
21
 
22
22
  remotes.each do |remote|
23
- puts "Synchronizing #{remote}"
23
+ logger.info "Synchronizing #{remote}"
24
24
  synchro = R10K::Synchro::Git.new(remote)
25
25
  synchro.cache
26
26
  end
@@ -0,0 +1,16 @@
1
+ require 'cri/command_dsl'
2
+ require 'r10k/logging'
3
+
4
+ module Cri
5
+ class CommandDSL
6
+ include R10K::Logging
7
+
8
+ def logger
9
+ unless @logger
10
+ @logger = Log4r::Logger.new(@command.name)
11
+ @logger.add R10K::Logging.outputter
12
+ end
13
+ @logger
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,6 @@
1
1
  require 'r10k/cli/module'
2
2
  require 'r10k/deployment'
3
+ require 'r10k/logging'
3
4
  require 'cri'
4
5
 
5
6
  require 'fileutils'
@@ -33,7 +34,7 @@ module R10K::CLI::Module
33
34
  mods = env.modules.select { |mod| mod.name == module_name }
34
35
 
35
36
  if mods.empty?
36
- puts "No modules with name #{module_name} matched in environment #{env.name.inspect}".red
37
+ logger.warn "No modules with name #{module_name} matched in environment #{env.name.inspect}".red
37
38
  end
38
39
 
39
40
  stack = Middleware::Builder.new
@@ -13,8 +13,6 @@ module R10K::CLI
13
13
  usage 'synchronize <options>'
14
14
  summary 'Fully synchronize all environments'
15
15
 
16
- flag :u, :update, "Update cache before running"
17
-
18
16
  run do |opts, args, cmd|
19
17
  deployment = R10K::Deployment.instance
20
18
  environments = deployment.environments
@@ -31,7 +29,7 @@ module R10K::CLI
31
29
  end
32
30
 
33
31
  stack_env = {
34
- :update_cache => opts[:update],
32
+ :update_cache => true,
35
33
  :trace => opts[:trace],
36
34
  :recurse => true,
37
35
  }
@@ -1,9 +1,12 @@
1
1
  require 'r10k'
2
2
  require 'r10k/module'
3
3
  require 'r10k/synchro/git'
4
+ require 'r10k/logging'
4
5
 
5
6
  class R10K::Root
6
7
 
8
+ include R10K::Logging
9
+
7
10
  # @!attribute [r] name
8
11
  # The directory name of this root
9
12
  attr_reader :name
@@ -49,7 +52,7 @@ class R10K::Root
49
52
  R10K::Module.new(name, "#{full_path}/modules", args)
50
53
  end
51
54
  rescue Errno::ENOENT
52
- puts "#{self}: #{full_path} does not exist, cannot enumerate modules."
55
+ logger.warn "#{self}: #{full_path} does not exist, cannot enumerate modules."
53
56
  []
54
57
  end
55
58
 
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -126,6 +126,7 @@ files:
126
126
  - lib/r10k/cli/environment/list.rb
127
127
  - lib/r10k/cli/environment/stale.rb
128
128
  - lib/r10k/cli/environment.rb
129
+ - lib/r10k/cli/ext/logging.rb
129
130
  - lib/r10k/cli/module/deploy.rb
130
131
  - lib/r10k/cli/module/list.rb
131
132
  - lib/r10k/cli/module.rb