sparkr 0.4.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2b803ac74d70b8ad2eaf16e843476e2d9be2e6b
4
- data.tar.gz: de4f7507f9f15f93464d88c12cb0747338a12895
3
+ metadata.gz: 2e2f56cc675afba616b05eb38ba741d283ffa000
4
+ data.tar.gz: a2b4431f919cbf5218298a937bd4736a5cc1c503
5
5
  SHA512:
6
- metadata.gz: 593c4038a8bf0fc0dbeee096d5f8ae725034c4a94ce30dd00fccae9cd169842519208d79a1a45fa64a17cd51493db2f9e65ed90443705666099c02e3d55c5c93
7
- data.tar.gz: 5466b0f309cab197763c9e085c30b72185f907e377a18dd8a01c9c845e6ce208ad76bc516f6e757dd09f1bb0b1b6785346e8e8b5f9b2f4cc785a7bddae17c988
6
+ metadata.gz: 896820a1a6c0666619b72810a51810462e65fc5ede2cc27971140906fa3330d9cd8cd77849ed83f687fd2daa36522dc366740a1b7db1bc4ba8e51e47510889df
7
+ data.tar.gz: 591ebd1eae9059124de15967fae0ab3fc8fbdc298a13df8dd1453da2b07886fc44866585c90e4913fe67ae3afa3c735143856c0bd05adfb81c4b0506b06305b3
data/README.md CHANGED
@@ -33,6 +33,11 @@ you would expect:
33
33
  $ sparkr 0 30 55 80 33 150
34
34
  ▁▂▃▅▂▇
35
35
 
36
+ It is also possible to pipe data into `sparkr`:
37
+
38
+ $ echo 9 13 5 17 1 | sparkr
39
+ ▄▆▂█▁
40
+
36
41
  ### Ruby
37
42
 
38
43
  The real reason for this port:
@@ -15,7 +15,7 @@ module Sparkr
15
15
  # Runs sparkr with the given +args+
16
16
  # @return [void]
17
17
  def run(*args)
18
- if args.empty?
18
+ if args.empty? || (args.size == 1 && %w(-h --help).include?(args.first))
19
19
  puts help
20
20
  else
21
21
  sparkline = Sparkline.new(args.map(&:to_f))
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Sparkr
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
@@ -13,13 +13,14 @@ describe ::Sparkr::CLI do
13
13
  assert_equal "▁▁▁▁▃▁▁▁▂█\n", out
14
14
  end
15
15
 
16
- it ".run should print usage information if args are missing" do
17
- string_numbers = %w()
18
- out, err = capture_io do
19
- ::Sparkr::CLI.run(*string_numbers)
16
+ it ".run should print usage information if args are missing or '-h'" do
17
+ [[], ['-h'], ['--help']].each do |args|
18
+ out, err = capture_io do
19
+ ::Sparkr::CLI.run(*args)
20
+ end
21
+ refute out.empty?, "there should be some output"
22
+ assert err.empty?, "there should be no errors"
23
+ assert_match /USAGE\:/, out
20
24
  end
21
- refute out.empty?, "there should be some output"
22
- assert err.empty?, "there should be no errors"
23
- assert_match /USAGE\:/, out
24
25
  end
25
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparkr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Föhring