kommando 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60fcbc413614b3241e6a3f821c4d906b9c3dde0c
4
- data.tar.gz: 1dcd5140f6d593f798d7b1fad08f91ca73c4bbbb
3
+ metadata.gz: 21c7dae7504adc6c8d020d36a15040145cb539b2
4
+ data.tar.gz: 6e13903d3610a520f87759feefbf810b9f60e8ed
5
5
  SHA512:
6
- metadata.gz: e19c3f5ceeef34e4cc387f2eaa434ee92a8a4fc30c58af62338f0aefa6c84fabdee3aaf413bf1b460ffb51c7d39cd9f17b02724c7b7e18cd3336a484b4339b2e
7
- data.tar.gz: 40d62317bb523c2b8dd29dd5f2f9cb8f3b892cdf36df42e885636cbb08dfb349835a6e5fe760ff94809cd5d7e574ae1444aab6cc710efde91ef3823599020297
6
+ metadata.gz: 20709e235f978d408c0a8b4b0e596a2c3d5b8ebc1dcfe9b3c902737f324450d12423633e4801e12a30b8e29d596bb764a2f6810e0ec80023eb7555b3bb329e70
7
+ data.tar.gz: 48cb28a22b828a1dd39561b88f9f5bf344453385cbbf4edc304b1e0dba2bbe64279f71a7bcbc19ee8d87d91287474e6f89103e95d1b0065706fa411c8677734b
@@ -1,7 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.3
4
+ Outputs to standard out while executing.
5
+
6
+ - FEAT: Output with `Kommando.new "ping -c 1 google.com", output: true`
7
+ - EXAMPLES: `live_output` added.
8
+
3
9
  ## 0.0.2
4
- Actually useful intial release.
10
+ Actually useful initial release.
5
11
 
6
12
  - FEAT: Runs commands with arguments `Kommando.new "ping -c 1 google.com"`
7
13
  - FEAT: Captures error code in `k.code`
@@ -0,0 +1,7 @@
1
+ require "./lib/kommando"
2
+
3
+ k = Kommando.new "ping -c 3 127.0.0.1", {
4
+ output: true
5
+ }
6
+
7
+ k.run
@@ -6,9 +6,11 @@ require_relative "kommando/buffer"
6
6
 
7
7
  class Kommando
8
8
 
9
- def initialize(cmd)
9
+ def initialize(cmd, opts={})
10
10
  @cmd = cmd
11
11
  @stdout = Buffer.new
12
+
13
+ @output = opts[:output] == true
12
14
  end
13
15
 
14
16
  def run
@@ -23,6 +25,7 @@ class Kommando
23
25
 
24
26
  c = stdout.getc
25
27
  @stdout.append c if c
28
+ print c if @output
26
29
  end
27
30
  end
28
31
  thread_stdout.join
@@ -1,3 +1,3 @@
1
1
  class Kommando
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kommando
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,6 +102,7 @@ files:
102
102
  - bin/reinstall
103
103
  - bin/setup
104
104
  - examples/exit.rb
105
+ - examples/live_output.rb
105
106
  - examples/ping.rb
106
107
  - examples/uptime.rb
107
108
  - kommando.gemspec