tidy_reset 0.1.17 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tidy_reset.rb +30 -4
- data/tidy_reset.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0aa5a59fbde641fb81a07fe6db3c0834cccdeab
|
4
|
+
data.tar.gz: a87f27f29993d8b8adf9450f80b1d838c24284b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af1a846a3d1c2187d0062ab1414eafe24b39b4a0f563a9df8ab1d6ae6f6a71d20d2e2be510790ea3fe5cf8c91a79be5ae1a9fc036e3d1d8d86192700b286f383
|
7
|
+
data.tar.gz: 9fc87dc8ec9a176be83490ff78107b5b4c2656b7d942a9bf54f9b0b2344d9a6d458de6898f5c9500d1e717fed663de98be7a9a304e9d9069ca8d5ad9834d7798
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.19
|
data/lib/tidy_reset.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'tidy_reset/configuration'
|
2
2
|
require 'tidy_reset/version'
|
3
|
+
require 'open3'
|
3
4
|
|
4
5
|
module TidyReset
|
5
6
|
class << self
|
@@ -14,10 +15,35 @@ module TidyReset
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def execute(command)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
Bundler.with_clean_env do
|
19
|
+
begin
|
20
|
+
tries ||= 3
|
21
|
+
rake_error = false
|
22
|
+
puts "running: #{command}"
|
23
|
+
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
|
24
|
+
while line = stdout.gets
|
25
|
+
puts line
|
26
|
+
rake_error = true if line =~ /rake aborted/
|
27
|
+
end
|
28
|
+
while line = stderr.gets
|
29
|
+
puts line
|
30
|
+
rake_error = true if line =~ /rake aborted/
|
31
|
+
end
|
32
|
+
unless wait_thr.value.success?
|
33
|
+
raise RuntimeError, wait_thr.value
|
34
|
+
end
|
35
|
+
if rake_error
|
36
|
+
raise RuntimeError, "rake aborted"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
rescue RuntimeError => e
|
40
|
+
if (tries -= 1) > 0
|
41
|
+
puts "Failed running command. Waiting 10s before next retry. Error: #{e}"
|
42
|
+
sleep(10)
|
43
|
+
retry
|
44
|
+
else
|
45
|
+
raise RuntimeError, "Error running command. Retried 3 times. Error #{e}"
|
46
|
+
end
|
21
47
|
end
|
22
48
|
end
|
23
49
|
end
|
data/tidy_reset.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tidy_reset 0.1.
|
5
|
+
# stub: tidy_reset 0.1.19 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tidy_reset"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.19"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Thinknear"]
|
14
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-09-12"
|
15
15
|
s.description = "Reset dynos, environment variables, deploys master git branch, and purges the database."
|
16
16
|
s.email = "software@thinknear.com"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tidy_reset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thinknear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|