json-waveform 0.1.0 → 0.2.0

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: bd2e33a91089ceb6931b15602438bdd1cc4a3c9d
4
- data.tar.gz: 9122243fe4acaef1954a929f17e53acf4cd44e8f
3
+ metadata.gz: d36b9399da8bc246ec51e20d9ce4f89763cc5443
4
+ data.tar.gz: e2c18ef64ce38d2c7121b4db7d2e75d737e3c4ee
5
5
  SHA512:
6
- metadata.gz: 3e3489489c328093edc783aea97563b9f9e14997dfe9df02fe17cf3cc7ce2b641f1f839c434f84710c847dfa53d2fd3a497f33f971808796dfbf673b65101fb5
7
- data.tar.gz: b0fcc8bb42c729fbe4bbc5a3b6c0a224cf21ebecec5421ebc065420844b8cdb1eafbfd528f3708eaa79c9385c455a8767b4740e7607a162433d865fc43160952
6
+ metadata.gz: c83b0f46eaf8f4140f2dd2f0917fbeea85739c38b87842f96229ed6a7d7c1f13d57d33f1d0b563991430c57482c8941e2a3556c34aee2f345dfff91aac999476
7
+ data.tar.gz: 96fc580e294ad1c31ebce0f0fd14212f94617e77244aabed5d72d3b1d54ec64797430262cbbde7c97be549fcddd54968056e7ffe7d0904c5e60eedde63ed68e2
@@ -5,13 +5,9 @@ require "optparse"
5
5
 
6
6
  options = JsonWaveform::DEFAULT_OPTIONS
7
7
  optparse = OptionParser.new do |o|
8
- o.banner = "Usage: json-waveform [options] source_audio"
8
+ o.banner = "Usage: json-waveform [options] source_audio [output]"
9
9
  o.version = JsonWaveform::VERSION
10
10
 
11
- o.on("-o", "--output FILE", "File where to write the JSON -- Default is stdout.") do |output|
12
- options[:output] = output
13
- end
14
-
15
11
  o.on("-s", "--samples SAMPLES", "Samples generated from the original file (i.e.: waveform width) -- Default #{JsonWaveform::DEFAULT_OPTIONS[:samples]}.") do |samples|
16
12
  options[:samples] = samples.to_i
17
13
  end
@@ -38,8 +34,8 @@ optparse.parse!
38
34
 
39
35
  begin
40
36
  result = JSON.dump(JsonWaveform.generate(ARGV[0], options))
41
- if options[:output]
42
- File.open(options[:output], 'w') do |file|
37
+ if ARGV[1]
38
+ File.open(ARGV[1], 'w') do |file|
43
39
  file.write result
44
40
  end
45
41
  else
@@ -1,3 +1,3 @@
1
1
  class JsonWaveform
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-waveform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esteban Pastorino