genesis_framework 0.6.5 → 0.6.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a704f5e9e4ac56e6e41b2817a4fbb506c714513
4
- data.tar.gz: 8d8ae76f57d4241129e0373eb060f96c5a90db75
3
+ metadata.gz: 664e768cc3d3181cacb8c0f32431c4760fb737e9
4
+ data.tar.gz: f9ab70b373c9ccb2e3a7bdd3c5b91aa0b08b1aed
5
5
  SHA512:
6
- metadata.gz: 1a518945bc91ff460dd266c5530ec0e1ce46a3eb44abef1fb8b8e4d290fed1937e2455da882ac8b050f764a98629e5489e8b4456fb43c2512290872b9938e2e9
7
- data.tar.gz: b891a8b6434bb4f0a70f23375531fe4a92a021310bb0a4bb79fdeb081e0d3813215ffd5292f96fa1bbb7cea2d622441f34a5a69fe4dfdc3bffa528deab7c13d8
6
+ metadata.gz: 58b42a263bfe0c453b22d01c50ae29aa6d8cd8e01143a46c5b36e3161bb05f58fee923bcf6ddd636b946c942794e14e53f2b30a7558b8a44e005d03de7b88ffc
7
+ data.tar.gz: 77cace27e435c7b3289f92c71b992137e8e05e15c24a324fc971c50ff54c52f998b5d7169d7b96aac9c67e739c5f0d6d8b24f14f68e1acdc94862ab5e727e18b
@@ -79,7 +79,7 @@ module Genesis
79
79
  end
80
80
  end
81
81
  rescue => e
82
- puts "%s task had error on testing if it needs initialization: %s" % [task_name, e.message]
82
+ task.log "task had error on testing if it needs initialization: %s" % e.message
83
83
  return false
84
84
  end
85
85
 
@@ -88,7 +88,7 @@ module Genesis
88
88
  self.call_block(task.blocks, :init);
89
89
  puts "task is now initialized..."
90
90
  rescue => e
91
- puts "%s task threw error on initialization: %s" % [task_name, e.message]
91
+ task.log "task threw error on initialization: %s" % e.message
92
92
  return false
93
93
  end
94
94
 
@@ -104,7 +104,7 @@ module Genesis
104
104
  end
105
105
  end
106
106
  rescue => e
107
- puts "%s task had error on testing if it needs running: %s" % [task_name, e.message]
107
+ task.log "task had error on testing if it needs running: %s" % e.message
108
108
  return false
109
109
  end
110
110
 
@@ -112,27 +112,27 @@ module Genesis
112
112
  task.options[:retries].each_with_index do |sleep_interval, index|
113
113
  attempt = index + 1
114
114
  begin
115
- puts "task is attempting run #%d..." % [attempt]
115
+ task.log "task is attempting run #%d..." % [attempt]
116
116
  Timeout::timeout(task.options[:timeout]) do
117
117
  success = self.call_block(task.blocks, :run)
118
118
  end
119
119
  # a run block should raise an error or be false for a failure
120
120
  success = true if success.nil?
121
121
  rescue => e
122
- puts "%s task [run #%d] caused error: %s" % [task_name, attempt, e.message]
122
+ task.log "run #%d caused error: %s" % [attempt, e.message]
123
123
  success = nil # cause a retry
124
124
  end
125
125
  break unless success.nil? # if we got an answer, we're done
126
- puts "task is sleeping for %d seconds..." % [sleep_interval]
126
+ task.log "task is sleeping for %d seconds..." % [sleep_interval]
127
127
  Kernel.sleep(sleep_interval)
128
128
  end
129
129
  success = false if success.nil? # must have used all the retries, fail
130
130
 
131
131
  if success
132
132
  success = self.call_block(task.blocks, :success)
133
- puts "task is successful!"
133
+ task.log "task is successful!"
134
134
  else
135
- puts 'task failed!!!'
135
+ task.log 'task failed!!!'
136
136
  if self.has_block? task.blocks, :rollback
137
137
  success = self.call_block(task.blocks, :rollback, "rolling back!")
138
138
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genesis_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Johnstone
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-15 00:00:00.000000000 Z
13
+ date: 2016-01-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: genesis_promptcli