blazing 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,10 @@
1
1
  ## master
2
2
 
3
+ ## 0.2.4 - November 9, 2011
4
+
5
+ * Fix logger, so the formatting does not get carried over to apps using
6
+ blazing. (#55)
7
+
3
8
  ## 0.2.3 - November 1, 2011
4
9
 
5
10
  * Don't run in -w (warnings) mode, as warnings scare people when they
@@ -1,26 +1,38 @@
1
1
  require 'logging'
2
2
 
3
- include Logging.globally
3
+ module Blazing
4
+ module Logger
4
5
 
5
- # here we setup a color scheme called 'bright'
6
- Logging.color_scheme( 'bright',
7
- :levels => {
8
- :debug => :green,
9
- :info => :green,
10
- :warn => :yellow,
11
- :error => [:white, :on_red],
12
- :fatal => [:white, :on_red]
13
- }
14
- )
6
+ # include Logging.globally
15
7
 
16
- Logging.appenders.stdout(
17
- 'stdout',
18
- :layout => Logging.layouts.pattern(
19
- :pattern => ' ------> [blazing] %-5l: %m\n',
20
- :color_scheme => 'bright'
21
- )
22
- )
8
+ # here we setup a color scheme called 'bright'
9
+ Logging.color_scheme( 'bright',
10
+ :levels => {
11
+ :debug => :green,
12
+ :info => :green,
13
+ :warn => :yellow,
14
+ :error => [:white, :on_red],
15
+ :fatal => [:white, :on_red]
16
+ }
17
+ )
23
18
 
24
- Logging.logger.root.appenders = 'stdout'
25
- Logging.logger.root.level = :info
26
- Logging.consolidate :root
19
+ Logging.appenders.stdout(
20
+ 'stdout',
21
+ :layout => Logging.layouts.pattern(
22
+ :pattern => ' ------> [blazing] %-5l: %m\n',
23
+ :color_scheme => 'bright'
24
+ )
25
+ )
26
+
27
+ Logging.logger.root.appenders = 'stdout'
28
+ Logging.logger.root.level = :info
29
+ Logging.consolidate :root
30
+
31
+ %w[debug info warn error fatal].each do |level|
32
+ define_method level do |message|
33
+ Logging.logger[self].send(level, message)
34
+ end
35
+ end
36
+
37
+ end
38
+ end
@@ -3,6 +3,8 @@ require 'grit'
3
3
 
4
4
  class Blazing::Runner
5
5
 
6
+ include Blazing::Logger
7
+
6
8
  def initialize(config = nil, target = nil)
7
9
  if config
8
10
  @config = config
@@ -17,8 +19,8 @@ class Blazing::Runner
17
19
  end
18
20
 
19
21
  def init_command
20
- logger.info "Creating an example config file in #{Blazing::DEFAULT_CONFIG_LOCATION}"
21
- logger.info "Customize it to your needs"
22
+ info "Creating an example config file in #{Blazing::DEFAULT_CONFIG_LOCATION}"
23
+ info "Customize it to your needs"
22
24
 
23
25
  Dir.mkdir 'config' unless File.exists? 'config'
24
26
  configuration_file = ERB.new(File.read("#{Blazing::TEMPLATE_ROOT}/config.erb")).result
@@ -31,7 +33,7 @@ class Blazing::Runner
31
33
  def setup_git_remotes
32
34
  repository = Grit::Repo.new(Dir.pwd)
33
35
  @config.targets.each do |target|
34
- logger.info "Adding new remote #{target.name} pointing to #{target.location}"
36
+ info "Adding new remote #{target.name} pointing to #{target.location}"
35
37
  repository.config["remote.#{target.name}.url"] = target.location
36
38
  end
37
39
  end
@@ -2,6 +2,8 @@ require 'blazing/shell'
2
2
 
3
3
  class Blazing::Target
4
4
 
5
+ include Blazing::Logger
6
+
5
7
  attr_accessor :name, :location, :options
6
8
 
7
9
  def initialize(name, location, config, options = {})
@@ -13,19 +15,19 @@ class Blazing::Target
13
15
  end
14
16
 
15
17
  def setup
16
- logger.info "Setting up repository for #{name} in #{location}"
18
+ info "Setting up repository for #{name} in #{location}"
17
19
  @shell.run "ssh #{user}@#{host} '#{init_repository} && #{setup_repository}'"
18
20
  end
19
21
 
20
22
  def apply_hook
21
- logger.info "Generating and uploading post-receive hook for #{name}"
23
+ info "Generating and uploading post-receive hook for #{name}"
22
24
  hook = ERB.new(File.read("#{Blazing::TEMPLATE_ROOT}/hook.erb")).result(binding)
23
25
 
24
26
  File.open(Blazing::TMP_HOOK, "wb") do |f|
25
27
  f.puts hook
26
28
  end
27
29
 
28
- logger.debug "Copying hook for #{name} to #{location}"
30
+ debug "Copying hook for #{name} to #{location}"
29
31
  copy_hook
30
32
  @shell.run "ssh #{user}@#{host} #{make_hook_executable}"
31
33
  end
@@ -54,7 +56,7 @@ class Blazing::Target
54
56
  end
55
57
 
56
58
  def copy_hook
57
- logger.debug "Making hook executable"
59
+ debug "Making hook executable"
58
60
  @shell.run "scp #{Blazing::TMP_HOOK} #{user}@#{host}:#{path}/.git/hooks/post-receive"
59
61
  end
60
62
 
@@ -1,3 +1,3 @@
1
1
  module Blazing
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-01 00:00:00.000000000Z
12
+ date: 2011-11-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- requirement: &70256165498500 !ruby/object:Gem::Requirement
16
+ requirement: &70336821944020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70256165498500
24
+ version_requirements: *70336821944020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70256165496760 !ruby/object:Gem::Requirement
27
+ requirement: &70336821943420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70256165496760
35
+ version_requirements: *70336821943420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70256165496320 !ruby/object:Gem::Requirement
38
+ requirement: &70336821942940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70256165496320
46
+ version_requirements: *70336821942940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &70256165495860 !ruby/object:Gem::Requirement
49
+ requirement: &70336821942360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70256165495860
57
+ version_requirements: *70336821942360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &70256165495100 !ruby/object:Gem::Requirement
60
+ requirement: &70336821941820 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70256165495100
68
+ version_requirements: *70336821941820
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: growl
71
- requirement: &70256165493860 !ruby/object:Gem::Requirement
71
+ requirement: &70336821919000 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70256165493860
79
+ version_requirements: *70336821919000
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rb-fsevent
82
- requirement: &70256165482380 !ruby/object:Gem::Requirement
82
+ requirement: &70336821918460 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70256165482380
90
+ version_requirements: *70336821918460
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: grit
93
- requirement: &70256165481920 !ruby/object:Gem::Requirement
93
+ requirement: &70336821917920 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70256165481920
101
+ version_requirements: *70336821917920
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: logging
104
- requirement: &70256165481480 !ruby/object:Gem::Requirement
104
+ requirement: &70336821917440 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70256165481480
112
+ version_requirements: *70336821917440
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: activesupport
115
- requirement: &70256165481060 !ruby/object:Gem::Requirement
115
+ requirement: &70336821916960 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70256165481060
123
+ version_requirements: *70336821916960
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: i18n
126
- requirement: &70256165480640 !ruby/object:Gem::Requirement
126
+ requirement: &70336821916480 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *70256165480640
134
+ version_requirements: *70336821916480
135
135
  description: painless git push deployments for everyone
136
136
  email:
137
137
  - felipekaufmann@gmail.com