pocketwatch 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 5388ad0287b782cbfcbd2fd09befcca9f0103d8b415cf60e2cc19b0016c64bbf
4
- data.tar.gz: 627a66a496dd946cb70975d9861e5c2be3b2a77773a5d9a52a6dd525e264de98
3
+ metadata.gz: 9226e5de85c599f936431e8671977225c9c9551bf3a296a91e34f0d6343ea37e
4
+ data.tar.gz: 47be2034eec10a51414bcdf52ffdef75bb002a16476d3370a3f4ac7292aa3890
5
5
  SHA512:
6
- metadata.gz: eb3d6d5b7abb3a4feee7c241ddc261116a0b7d46a6d286f2127f83ace85cc899d38e54d993dee5da5db104d70fedefc37ece19e16d2f87071f10c37c990c4216
7
- data.tar.gz: d7bf7e1e7f854a299f03b69320eb1710082e6deb1956218d740ac7459a7e54e5d08e52197c66f2ef9dca98c6e838dffd20afd22ed9bf934a279cdbe1404a8829
6
+ metadata.gz: a0d9bc5898efff01153331ae48d812864eeb8bc3c7cf06e3d7ae8e9c1aa621788115698236668c053356dab069cfc5c10dfea944612f7078bb040c3b20537bba
7
+ data.tar.gz: 3bf4f180e5bc48b625e1e2a0c63d3233e4ed8c10615e7d8c2ca67c1f0b77727f484e2f5dbfc21609482c40370901b70c2d068d7fde343f2ab9d10246635e9409
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pocketwatch (0.1.0)
4
+ pocketwatch (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -12,7 +12,11 @@ gem install pocketwatch
12
12
 
13
13
  ## Usage
14
14
 
15
- TODO: Write usage instructions here
15
+ ```
16
+ Usage: pocketwatch [options] -- <command>
17
+ -v, --version Print the version number
18
+ -n INTERVAL Length in seconds between command execution
19
+ ```
16
20
 
17
21
  ## License
18
22
 
@@ -29,7 +29,7 @@ module Pocketwatch
29
29
  exit
30
30
  end
31
31
 
32
- opts.on("-n INTERVAL", Integer, "Interval length in seconds between command execution") do |v|
32
+ opts.on("-n INTERVAL", Integer, "Length in seconds between command execution") do |v|
33
33
  unless v.positive?
34
34
  warn "Must provide a positive integer for the command execution interval."
35
35
  exit
@@ -1,3 +1,3 @@
1
1
  module Pocketwatch
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -29,8 +29,12 @@ module Pocketwatch
29
29
  # Double buffer the output by precomputing the results of the system
30
30
  # call. Then, clear the terminal and print the results as quickly as
31
31
  # possible - this should avoid any flickering due to clearing the
32
- # terminal.
33
- output = `#{@command}`
32
+ # terminal. Restrict the output of the command to the current height of
33
+ # the terminal - scrolling is not supported, and we want to see the
34
+ # first part of the output, not the last.
35
+ num_lines = `tput lines`.strip.to_i - 1
36
+ num_lines = 1 unless num_lines.positive?
37
+ output = `#{@command}`.split("\n").first(num_lines)
34
38
 
35
39
  clear_screen
36
40
  puts output
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pocketwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Thurlow