runtime_command 0.1.9 → 1.0.0
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/.rubocop.yml +21 -0
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/lib/runtime_command/builder.rb +3 -3
- data/lib/runtime_command/logger.rb +4 -4
- data/lib/runtime_command/version.rb +1 -1
- data/runtime_command.gemspec +13 -12
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1223e519d09d6ac6f450c8d85015a70c5c5d2cff
|
4
|
+
data.tar.gz: e34753557dba141fb12510a2603d7eed244ec6c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06a809fb7e82b69c48a53cce54e2587a6c15101d1c72ae3ad9559ef9591435898ffd74abbb00f8e83f35dd2ceaa7eb3ae55fad4968770eec1f1d2a2e81130a42
|
7
|
+
data.tar.gz: 15379de1b55a75e74f2419916efa9105c2e2f20b844ed0265909b60a688eae10b32574ad18d7cf2f02b3950d3031c8474beb1e3e387cd11d6aa31804a31d5ce3
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Style/Documentation:
|
2
|
+
Enabled: false
|
3
|
+
Style/ExtraSpacing:
|
4
|
+
Enabled: false
|
5
|
+
Metrics/AbcSize:
|
6
|
+
Max: 20
|
7
|
+
Metrics/BlockLength:
|
8
|
+
Enabled: false
|
9
|
+
Metrics/ClassLength:
|
10
|
+
Enabled: false
|
11
|
+
Metrics/LineLength:
|
12
|
+
Enabled: false
|
13
|
+
Metrics/MethodLength:
|
14
|
+
CountComments: false
|
15
|
+
Max: 64
|
16
|
+
Metrics/ModuleLength:
|
17
|
+
Enabled: false
|
18
|
+
Security/YAMLLoad:
|
19
|
+
Enabled: false
|
20
|
+
Style/SpaceAroundOperators:
|
21
|
+
Enabled: false
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
task :
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
task default: :spec
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'runtime_command'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "runtime_command"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
@@ -26,7 +26,7 @@ module RuntimeCommand
|
|
26
26
|
logger.stdin(@stdin_prefix + ' ' + command)
|
27
27
|
|
28
28
|
begin
|
29
|
-
Open3.popen3(command, chdir: chdir) do |stdin, stdout, stderr
|
29
|
+
Open3.popen3(command, chdir: chdir) do |stdin, stdout, stderr|
|
30
30
|
stdin.close
|
31
31
|
|
32
32
|
stdout.each do |message|
|
@@ -53,7 +53,7 @@ module RuntimeCommand
|
|
53
53
|
# @return [RuntimeCommand::Logger]
|
54
54
|
def puts(message)
|
55
55
|
logger = Logger.new(@output, @colors)
|
56
|
-
logger.stdout(message)
|
56
|
+
logger.stdout(message) unless message.nil?
|
57
57
|
|
58
58
|
@buffered_log << logger.buffered_log + "\n"
|
59
59
|
logger
|
@@ -63,7 +63,7 @@ module RuntimeCommand
|
|
63
63
|
# @return [RuntimeCommand::Logger]
|
64
64
|
def puts_error(message)
|
65
65
|
logger = Logger.new(@output, @colors)
|
66
|
-
logger.stderr(message)
|
66
|
+
logger.stderr(message) unless message.nil?
|
67
67
|
|
68
68
|
@buffered_log << logger.buffered_log + "\n"
|
69
69
|
logger
|
@@ -22,7 +22,7 @@ module RuntimeCommand
|
|
22
22
|
puts HighLine.color(line, @stdin_color) if @output
|
23
23
|
@buffered_log << line + "\n"
|
24
24
|
|
25
|
-
|
25
|
+
nil
|
26
26
|
end
|
27
27
|
|
28
28
|
# @return [Boolean]
|
@@ -37,7 +37,7 @@ module RuntimeCommand
|
|
37
37
|
@buffered_log << line
|
38
38
|
@buffered_stdout << line
|
39
39
|
|
40
|
-
|
40
|
+
nil
|
41
41
|
end
|
42
42
|
|
43
43
|
# @return [Boolean]
|
@@ -52,7 +52,7 @@ module RuntimeCommand
|
|
52
52
|
@buffered_log << line
|
53
53
|
@buffered_stderr << line
|
54
54
|
|
55
|
-
|
55
|
+
nil
|
56
56
|
end
|
57
57
|
|
58
58
|
def flash
|
@@ -60,7 +60,7 @@ module RuntimeCommand
|
|
60
60
|
@buffered_stdout = ''
|
61
61
|
@buffered_stderr = ''
|
62
62
|
|
63
|
-
|
63
|
+
nil
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/runtime_command.gemspec
CHANGED
@@ -4,32 +4,33 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'runtime_command/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'runtime_command'
|
8
8
|
spec.version = RuntimeCommand::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['naomichi-y']
|
10
|
+
spec.email = ['n.yamakita@gmail.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
12
|
+
spec.summary = 'Execute external command from Ruby.'
|
13
|
+
spec.description = 'Execute external command and retrive STDIN / STDOUT in real time.'
|
14
|
+
spec.homepage = 'https://github.com/naomichi-y/runtime_command'
|
15
15
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
18
|
if spec.respond_to?(:metadata)
|
19
19
|
# spec.metadata['allowed_push_host'] = ""
|
20
20
|
else
|
21
|
-
raise
|
22
|
-
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
22
|
+
'public gem pushes.'
|
23
23
|
end
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
26
|
f.match(%r{^(test|spec|features)/})
|
27
27
|
end
|
28
|
-
spec.bindir =
|
28
|
+
spec.bindir = 'exe'
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
-
spec.require_paths = [
|
30
|
+
spec.require_paths = ['lib']
|
31
31
|
|
32
32
|
spec.add_dependency 'highline'
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
33
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
34
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
35
|
+
spec.add_development_dependency 'rubocop'
|
35
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runtime_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- naomichi-y
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Execute external command and retrive STDIN / STDOUT in real time.
|
56
70
|
email:
|
57
71
|
- n.yamakita@gmail.com
|
@@ -61,6 +75,7 @@ extra_rdoc_files: []
|
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
63
77
|
- ".rspec"
|
78
|
+
- ".rubocop.yml"
|
64
79
|
- Gemfile
|
65
80
|
- README.md
|
66
81
|
- Rakefile
|
@@ -91,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
106
|
version: '0'
|
92
107
|
requirements: []
|
93
108
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.5.1
|
95
110
|
signing_key:
|
96
111
|
specification_version: 4
|
97
112
|
summary: Execute external command from Ruby.
|
98
113
|
test_files: []
|
114
|
+
has_rdoc:
|