autowow 0.9.1 → 0.9.2
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 +4 -4
- data/README.md +1 -1
- data/autowow.gemspec +1 -1
- data/lib/autowow/executor.rb +43 -21
- data/lib/autowow/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48291b2d9a0df006bf706b4b1e78e68d738b2e95
|
4
|
+
data.tar.gz: a77484bd198269c68dd5c43afec2055b0368f536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 917b983e4fb8cd58ea0c6ff2b2c06b5b496b86f5fd28cbb06fce4f6b43d53ca915929be98b12d7be276d4cd0bfe43d954582af576992eb83e5b60a25d1b49da8
|
7
|
+
data.tar.gz: 769549c409634fe76c2e286d97be3d7fa7bca9204c4582834306e815caef882d024c1e1dde9706469413dd52414b248c091322f5ac20c2dbe1aadc00ae018bda
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
#### Set of commands to [auto]mate [w]ay [o]f [w]orking
|
4
4
|
|
5
|
-
*You are viewing the README of version [v0.9.
|
5
|
+
*You are viewing the README of version [v0.9.2](https://github.com/thisismydesign/autowow/releases/tag/v0.9.2). You can find other releases [here](https://github.com/thisismydesign/autowow/releases).*
|
6
6
|
|
7
7
|
| Branch | Status |
|
8
8
|
| ------ | ------ |
|
data/autowow.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency "pastel" # Colorize output of own logger
|
27
27
|
spec.add_dependency "time_difference", "= 0.5.0" # Calculate project age. Fixed version because of refinements :(
|
28
28
|
spec.add_dependency "launchy" # Open project in browser
|
29
|
-
spec.add_dependency "tty-command", "
|
29
|
+
spec.add_dependency "tty-command", "~> 0.8" # Execute system commands nicely
|
30
30
|
spec.add_dependency "reflection_utils", ">= 0.3.0" # Invoke module methods without including the module
|
31
31
|
spec.add_dependency "rubocop" # Style check
|
32
32
|
spec.add_dependency "rubocop-rspec" # Style check
|
data/lib/autowow/executor.rb
CHANGED
@@ -8,24 +8,53 @@ module Autowow
|
|
8
8
|
|
9
9
|
def print_command_exit(cmd, status, runtime, *args)
|
10
10
|
super
|
11
|
-
|
12
|
-
if tty_version < Gem::Version.new("0.8.0")
|
13
|
-
write("")
|
14
|
-
else
|
15
|
-
write(TTY::Command::Cmd.new("dummy"), "")
|
16
|
-
end
|
11
|
+
write(TTY::Command::Cmd.new("dummy"), "")
|
17
12
|
end
|
18
13
|
end
|
19
14
|
|
20
15
|
class PrettyWithOutput < TTY::Command::Printers::Pretty
|
21
16
|
def print_command_exit(cmd, status, runtime, *args)
|
22
17
|
super
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
write(TTY::Command::Cmd.new("dummy"), "")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class BufferingPretty < TTY::Command::Printers::Pretty
|
23
|
+
def initialize(*)
|
24
|
+
super
|
25
|
+
@out = ""
|
26
|
+
end
|
27
|
+
|
28
|
+
def print_command_out_data(cmd, *args)
|
29
|
+
@out << args.join(" ")
|
30
|
+
return unless multiple_lines?(@out)
|
31
|
+
finished_lines(@out).each { |line| write(cmd, line) }
|
32
|
+
@out = unfinished_line(@out)
|
33
|
+
end
|
34
|
+
alias_method :print_command_err_data, :print_command_out_data
|
35
|
+
|
36
|
+
def print_command_exit(cmd, status, runtime, *args)
|
37
|
+
@out.each_line.map(&:chomp).each { |line| write(cmd, line) }
|
38
|
+
super
|
39
|
+
end
|
40
|
+
|
41
|
+
def write(cmd, message, data = nil)
|
42
|
+
out = []
|
43
|
+
out << "[#{decorate(cmd.uuid, :green)}] " unless cmd.uuid.nil?
|
44
|
+
out << "#{message}\n"
|
45
|
+
output << out.join
|
46
|
+
end
|
47
|
+
|
48
|
+
def finished_lines(string)
|
49
|
+
string.each_line.to_a[0..-2].map(&:chomp)
|
50
|
+
end
|
51
|
+
|
52
|
+
def unfinished_line(string)
|
53
|
+
string.each_line.to_a[-1]
|
54
|
+
end
|
55
|
+
|
56
|
+
def multiple_lines?(string)
|
57
|
+
string.each_line.count > 1
|
29
58
|
end
|
30
59
|
end
|
31
60
|
|
@@ -54,7 +83,7 @@ module Autowow
|
|
54
83
|
end
|
55
84
|
|
56
85
|
def pretty_with_output
|
57
|
-
@pretty_with_output ||= RunWrapper.new(TTY::Command.new(tty_params.merge(printer:
|
86
|
+
@pretty_with_output ||= RunWrapper.new(TTY::Command.new(tty_params.merge(printer: BufferingPretty)), fail_silently: true)
|
58
87
|
end
|
59
88
|
|
60
89
|
def quiet
|
@@ -62,14 +91,7 @@ module Autowow
|
|
62
91
|
end
|
63
92
|
|
64
93
|
def tty_params
|
65
|
-
|
66
|
-
if tty_version < Gem::Version.new("0.7.0")
|
67
|
-
{}
|
68
|
-
elsif tty_version < Gem::Version.new("0.8.0")
|
69
|
-
{ pty: true }
|
70
|
-
else
|
71
|
-
{ pty: true, verbose: false }
|
72
|
-
end
|
94
|
+
{ pty: true, verbose: false }
|
73
95
|
end
|
74
96
|
|
75
97
|
include ReflectionUtils::CreateModuleFunctions
|
data/lib/autowow/version.rb
CHANGED
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.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thisismydesign
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04
|
11
|
+
date: 2018-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: easy_logging
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: tty-command
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.8
|
89
|
+
version: '0.8'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.8
|
96
|
+
version: '0.8'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: reflection_utils
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|