instacli 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.org +1 -1
  3. data/lib/instacli/silence.rb +16 -0
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50a85c046d7c6a005f5ae3fb995afb467b83e462
4
- data.tar.gz: 16832c6490f6822773c851a5d84f86394a89ae82
3
+ metadata.gz: b4a2fd308b300d0876ff33e66342c22de3968044
4
+ data.tar.gz: 9927eb0293c7693dafbe03ed101e89213fa48830
5
5
  SHA512:
6
- metadata.gz: af9511d7f1c66621428c30f3346b84efff385d8f7eeb4648011c297fa40fead434a12ab53c5575e0593ca6ba1c83f3015dd4f299af3283fbcba95c798159f3b9
7
- data.tar.gz: 8d33afe6a36f0e4a1445659cff0b1bb31ce0ef2890e8f40003ee1ba28a98e3acda27cecaf423c51080d2b1ecfb0df3ee36be5291d7790173fa35c34bbebee3ca
6
+ metadata.gz: a45f8b9dbf1703d74d7f67001ba462514a12fa1c4dc0a83ab30abfd99cc1b109f13a7834f93e10aaa5f1b4af3933a810b1ef670ebf1c2188bb71f71c4c219c59
7
+ data.tar.gz: 84deb3641b57cf7b8eea93d99b4363ecb59cc26db19b7ac080040a3244b79c76ad9b47e450baf6c77316d37ac978144a6b1a7d0071c930a7e58f845d56b5e32f
data/README.org CHANGED
@@ -116,7 +116,7 @@
116
116
  The parameters of a method are used to generate usage documentation,
117
117
  following the common convention of =<required>= and =[optional]=.
118
118
 
119
- If a method raises an ~ArugmentError~, a usage notice will be displayed,
119
+ If a method raises an ~ArgumentError~, a usage notice will be displayed,
120
120
  outlining the correct usage.
121
121
 
122
122
  ** Command Demultiplexing (aka "that thing =busybox= does")
@@ -0,0 +1,16 @@
1
+ module InstaCLI
2
+ # Suppress output
3
+ module Silence
4
+ def execute(*args)
5
+ return STDERR.puts help(*args[1..-1]) if %w(--help -h).include?(args.first)
6
+
7
+ o, m, *rest = *args
8
+
9
+ begin
10
+ method(o, m).call(*rest)
11
+ rescue *rescues
12
+ STDERR.puts help(*args)
13
+ end
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instacli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-16 00:00:00.000000000 Z
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts
@@ -44,6 +44,7 @@ files:
44
44
  - lib/instacli/demuxing.rb
45
45
  - lib/instacli/exception_variant.rb
46
46
  - lib/instacli/help.rb
47
+ - lib/instacli/silence.rb
47
48
  homepage: https://github.com/colstrom/instacli
48
49
  licenses:
49
50
  - MIT