coque 0.7.0 → 0.7.1
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/.travis.yml +3 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -9
- data/lib/coque/runnable.rb +1 -11
- data/lib/coque/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6df60f837355fa035e81e14eff31a1df0f462408
|
4
|
+
data.tar.gz: 5f044bde907269b17ee5279969f13a01840066aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b89af30708ef7db84f92238f1a50eefc1bbba04ff1726c746c5a39ba228cd768958e738cc39bb7e4cbca12b0575beb918ce95f4a4892b3f5bedcb5c27e310a9
|
7
|
+
data.tar.gz: 2b4c7d528d05b415704c1dd33090b2b1e0f70b673d9c8a726ec99d6fad5cfc8a71e915c785c972e1301d610ccd9bfe7fed168a4221847506034b932af9a19fc8
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Coque
|
2
2
|
|
3
|
+
[](https://travis-ci.org/worace/coque)
|
4
|
+
[](https://badge.fury.io/rb/coque)
|
5
|
+
|
3
6
|
Create, manage, and interop with shell pipelines from Ruby. Like [Plumbum](https://plumbum.readthedocs.io/en/latest/), for Ruby, with native (Ruby) code streaming integration.
|
4
7
|
|
5
8
|
## Installation
|
@@ -99,15 +102,6 @@ Coque also includes a `Coque.source` helper for feeding Ruby enumerables into sh
|
|
99
102
|
# => ["500"]
|
100
103
|
```
|
101
104
|
|
102
|
-
#### Logging
|
103
|
-
|
104
|
-
You can set a logger for Coque, which will be used to output messages when commands are executed:
|
105
|
-
|
106
|
-
```rb
|
107
|
-
Coque.logger = Logger.new(STDOUT)
|
108
|
-
(Coque["echo", "hi"] | Coque["wc", "-c"]).run!
|
109
|
-
```
|
110
|
-
|
111
105
|
#### Named (Non-Operator) Method Alternatives
|
112
106
|
|
113
107
|
The main piping and redirection methods also include named alternatives:
|
@@ -125,6 +119,15 @@ So these 2 invocations are equivalent:
|
|
125
119
|
Coque["echo", "hi"].pipe(Coque["wc", "-c"]).out(STDERR).run!
|
126
120
|
```
|
127
121
|
|
122
|
+
#### Logging
|
123
|
+
|
124
|
+
You can set a logger for Coque, which will be used to output messages when commands are executed:
|
125
|
+
|
126
|
+
```rb
|
127
|
+
Coque.logger = Logger.new(STDOUT)
|
128
|
+
(Coque["echo", "hi"] | Coque["wc", "-c"]).run!
|
129
|
+
```
|
130
|
+
|
128
131
|
Will log:
|
129
132
|
|
130
133
|
```
|
data/lib/coque/runnable.rb
CHANGED
@@ -16,17 +16,7 @@ module Coque
|
|
16
16
|
|
17
17
|
def run
|
18
18
|
log_start
|
19
|
-
|
20
|
-
result = get_result
|
21
|
-
end_time = Time.now
|
22
|
-
log_end(end_time - start_time)
|
23
|
-
result
|
24
|
-
end
|
25
|
-
|
26
|
-
def log_end(seconds)
|
27
|
-
if Coque.logger
|
28
|
-
Coque.logger.info("Coque Command: #{self.to_s} finished in #{seconds} seconds.")
|
29
|
-
end
|
19
|
+
get_result
|
30
20
|
end
|
31
21
|
|
32
22
|
def log_start
|
data/lib/coque/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Horace Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.6.14.1
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Shell command utilities with easy integration with Ruby code.
|