honkhonk 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 277990092878568fce69dace8a786f9eb14644c1ae99420d8dc2842c7c92ef57
4
- data.tar.gz: 7278590c0c215ec62c700818b411ba563200d1a29031f29fe5d9639db29efad4
3
+ metadata.gz: 10c96d7dd74b1a63f7443303e14cc31546c1ec014ad96686de34a892ee2ebf11
4
+ data.tar.gz: c5f5db1f22c45cc2aebed8376fc9657a43722becc82eb160e235376adc1beb12
5
5
  SHA512:
6
- metadata.gz: a8422fff8c4a9c6178b9c531abefda367a986b57d12b9b2b64ec07cce246500a274739c2c6c12277c1267bae7316aa520441806431eda58fec833e758d4aca29
7
- data.tar.gz: 04c225f4c53015ce801e4ba5eebd26e2f59eb8c64264e3bb389c82ef0bb68f30140969c183c085dddfca17bae0b497263ae788999219f25a01b4d0a2e042cc4c
6
+ metadata.gz: 2b8fc52ad85b34e4d892b074c6ebed39b16c4774aef0398383f443e587225333db6633339cbb00e30dde1153141573499c5c5b52d4384a9e92556d596e851e29
7
+ data.tar.gz: 5cc6d76b89a29248e2c318b03da540e56f0be7a59a05d9b9f18c790bceb2990e97345dc784a283317d005673d573efbc1bf27788a1e7bd9353bb3e06faf2a4bb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- honkhonk (0.0.1)
4
+ honkhonk (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Readme.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ## Usage
4
4
 
5
- 1. `gem install honk`
5
+ 1. `gem install honkhonk`
6
6
  2. `bundle exec honk`
7
7
 
8
8
  or
9
9
 
10
- 1. `gem install honk`
10
+ 1. `gem install honkhonk`
11
11
  2. add `require "honk/tasks"` to `Rakefile`
12
12
  3. `rake honk`
data/bin/honk CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- require 'bundler/setup'
2
+
3
+ lib = File.expand_path(__dir__+"/../lib")
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'honk'
4
6
  Honk.()
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "honkhonk"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.required_ruby_version = ">= 2.5.0"
9
9
  spec.authors = ["Jon Rowe"]
10
10
  spec.email = ["hello@jonrowe.co.uk"]
@@ -4,6 +4,16 @@ module Honk
4
4
  module_function
5
5
 
6
6
  def call
7
- `afplay #{HONK}`
7
+ if run_quietly('which afplay')
8
+ run_quietly("afplay #{HONK}")
9
+ elsif run_quietly('which mplayer')
10
+ run_quietly("mplayer #{HONK}")
11
+ else
12
+ raise "No `afplay` or `mplayer` executable"
13
+ end
14
+ end
15
+
16
+ def run_quietly(command)
17
+ system(command, out: '/dev/null', err: '/dev/null')
8
18
  end
9
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkhonk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Rowe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2019-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake