autowow 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 +5 -5
- data/.gitignore +14 -14
- data/.rspec +2 -2
- data/.rubocop.yml +118 -116
- data/.travis.yml +11 -11
- data/Gemfile +6 -6
- data/Guardfile +22 -22
- data/LICENSE.txt +21 -21
- data/README.md +143 -139
- data/Rakefile +59 -59
- data/autowow.gemspec +41 -41
- data/bin/autowow +5 -5
- data/bin/aw +5 -5
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/lib/autowow.rb +13 -13
- data/lib/autowow/cli.rb +91 -91
- data/lib/autowow/commands/gem.rb +27 -27
- data/lib/autowow/commands/os.rb +11 -11
- data/lib/autowow/commands/rbenv.rb +19 -19
- data/lib/autowow/commands/vcs.rb +87 -87
- data/lib/autowow/decorators/string_decorator.rb +11 -11
- data/lib/autowow/executor.rb +56 -49
- data/lib/autowow/features/fs.rb +49 -49
- data/lib/autowow/features/gem.rb +48 -48
- data/lib/autowow/features/os.rb +16 -16
- data/lib/autowow/features/rbenv.rb +50 -50
- data/lib/autowow/features/vcs.rb +272 -272
- data/lib/autowow/log_formatter.rb +25 -25
- data/lib/autowow/time_difference.rb +29 -29
- data/lib/autowow/version.rb +3 -3
- metadata +3 -3
@@ -1,25 +1,25 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
module Autowow
|
4
|
-
class LogFormatter
|
5
|
-
def self.beautify(severity, msg)
|
6
|
-
log_msg = msg.to_s.end_with?($/) ? msg : "#{msg}#{$/}"
|
7
|
-
log_msg = " $ #{log_msg}" if severity.eql?(
|
8
|
-
color(severity, log_msg)
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.color(severity, msg)
|
12
|
-
pastel = Pastel.new
|
13
|
-
case severity
|
14
|
-
when
|
15
|
-
pastel.yellow(msg)
|
16
|
-
when
|
17
|
-
pastel.red(msg)
|
18
|
-
when
|
19
|
-
pastel.bright_red(msg)
|
20
|
-
else
|
21
|
-
msg
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
1
|
+
require "pastel"
|
2
|
+
|
3
|
+
module Autowow
|
4
|
+
class LogFormatter
|
5
|
+
def self.beautify(severity, msg)
|
6
|
+
log_msg = msg.to_s.end_with?($/) ? msg : "#{msg}#{$/}"
|
7
|
+
log_msg = " $ #{log_msg}" if severity.eql?("DEBUG")
|
8
|
+
color(severity, log_msg)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.color(severity, msg)
|
12
|
+
pastel = Pastel.new
|
13
|
+
case severity
|
14
|
+
when "DEBUG"
|
15
|
+
pastel.yellow(msg)
|
16
|
+
when "WARN"
|
17
|
+
pastel.red(msg)
|
18
|
+
when "ERROR"
|
19
|
+
pastel.bright_red(msg)
|
20
|
+
else
|
21
|
+
msg
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
module RefinedTimeDifference
|
4
|
-
refine(TimeDifference) do
|
5
|
-
def humanize_higher_than(limit)
|
6
|
-
limit_index = TimeDifference::TIME_COMPONENTS.index(limit)
|
7
|
-
|
8
|
-
diff_parts = []
|
9
|
-
in_general.each_with_index do |array, index|
|
10
|
-
part, quantity = array
|
11
|
-
next if quantity <= 0
|
12
|
-
part = part.to_s.humanize
|
13
|
-
|
14
|
-
if quantity <= 1
|
15
|
-
part = part.singularize
|
16
|
-
end
|
17
|
-
|
18
|
-
diff_parts << "#{quantity} #{part}"
|
19
|
-
end
|
20
|
-
|
21
|
-
last_part = (diff_parts.pop or
|
22
|
-
if diff_parts.empty?
|
23
|
-
return last_part
|
24
|
-
else
|
25
|
-
return [diff_parts.join(
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
1
|
+
require "time_difference"
|
2
|
+
|
3
|
+
module RefinedTimeDifference
|
4
|
+
refine(TimeDifference) do
|
5
|
+
def humanize_higher_than(limit)
|
6
|
+
limit_index = TimeDifference::TIME_COMPONENTS.index(limit)
|
7
|
+
|
8
|
+
diff_parts = []
|
9
|
+
in_general.each_with_index do |array, index|
|
10
|
+
part, quantity = array
|
11
|
+
next if (quantity <= 0) || (limit_index < index)
|
12
|
+
part = part.to_s.humanize
|
13
|
+
|
14
|
+
if quantity <= 1
|
15
|
+
part = part.singularize
|
16
|
+
end
|
17
|
+
|
18
|
+
diff_parts << "#{quantity} #{part}"
|
19
|
+
end
|
20
|
+
|
21
|
+
last_part = (diff_parts.pop or "")
|
22
|
+
if diff_parts.empty?
|
23
|
+
return last_part
|
24
|
+
else
|
25
|
+
return [diff_parts.join(", "), last_part].join(" and ")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/autowow/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Autowow
|
2
|
-
VERSION = "0.8.
|
3
|
-
end
|
1
|
+
module Autowow
|
2
|
+
VERSION = "0.8.1"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autowow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thisismydesign
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: easy_logging
|
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
293
|
version: '0'
|
294
294
|
requirements: []
|
295
295
|
rubyforge_project:
|
296
|
-
rubygems_version: 2.
|
296
|
+
rubygems_version: 2.7.3
|
297
297
|
signing_key:
|
298
298
|
specification_version: 4
|
299
299
|
summary: Set of commands to AUTOmate Way Of Working
|