bixby-client 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: 612e1c186d5b8d826adf4c9cb55bc4bc177f60ca
4
- data.tar.gz: 2f4a93cdfd9cec51393e0cfae0971e14561aa549
3
+ metadata.gz: 0ef77cb00e1743828677004f98f71640ba27f0e9
4
+ data.tar.gz: 1910aac0d3ed3e678b2aa76a5424b326ebd869b1
5
5
  SHA512:
6
- metadata.gz: 8cf630d2fe55a757490fe7800747ff521dae0359182f6ee6e055d2cc4c9c03aecdf9ae79923ccd6babfb17bc69359ab680bf280327de62327c8309be8505b319
7
- data.tar.gz: 0b4d499a4ba0907471ba57b04a6eed2bd11124ce41d2df265447ec2c6747caaf8ee337e95733c870cf83a7e1b2e3fc0066d18bc29d7e280089e5c2e2fec202f9
6
+ metadata.gz: 1bb22df36bc74a9a7b9acdd559b2007e8d7d17f9ab98acfbd346c3751051094b328f42ae51b10b6713498c1613daf466b04674ee39da1990cfe909d201f9deb8
7
+ data.tar.gz: 0a30e6c7ffc99df233c1fba1c88e9e3d681ef332e972d5eb1203a72f5ec9723146920eeea8f2ca8a3439c8ec682d37c79720307fc8c6cd996e664bab005eff28
data/.travis.yml CHANGED
@@ -2,7 +2,7 @@ before_install:
2
2
  - "curl -sL https://s3.bixby.io/wad > ~/wad"
3
3
  - "chmod +x ~/wad"
4
4
  install:
5
- - "~/wad"
5
+ - "travis_retry ~/wad"
6
6
  script: "bundle exec micron test/"
7
7
  after_script: "rake coveralls"
8
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
data/bixby-client.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bixby-client 0.4.0 ruby lib
5
+ # stub: bixby-client 0.4.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bixby-client"
9
- s.version = "0.4.0"
9
+ s.version = "0.4.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Chetan Sarva"]
13
- s.date = "2013-11-19"
13
+ s.date = "2013-11-21"
14
14
  s.description = "Bixby Client"
15
15
  s.email = "chetan@pixelcop.net"
16
16
  s.executables = ["bixby"]
@@ -15,21 +15,31 @@ module Bixby
15
15
  str = argv.shift
16
16
  scripts = FileFinder.new(Bixby.repo).find_script(str)
17
17
 
18
- if scripts.kind_of?(Array)
18
+ if scripts.nil? then
19
+ $stderr.puts "Error: missing input"
20
+ $stderr.puts "usage: #{$0} run <script> [args ...]"
21
+ return exit 1
22
+
23
+ elsif scripts.kind_of?(Array)
24
+
19
25
  if scripts.size > 1 then
20
26
  $stderr.puts "Found #{scripts.size} scripts matching '#{str}'. Please be more explicit"
21
27
  scripts.each do |s|
22
28
  puts " * #{s}"
23
29
  end
24
30
  return 1
31
+
25
32
  elsif scripts.empty? then
26
33
  $stderr.puts "No scripts matched '#{str}'. Try again"
27
34
  return 1
28
35
  end
36
+
37
+ # only one match
38
+ scripts = scripts.shift
29
39
  end
30
40
 
31
41
  setup_env()
32
- exec(scripts.shift, *argv)
42
+ exec(scripts, *argv)
33
43
  end
34
44
 
35
45
  # Setup the ENV for exec
@@ -9,8 +9,13 @@ module Bixby
9
9
  @root = root
10
10
  end
11
11
 
12
+ # Look for a script matchign the given [partial] filename
13
+ #
14
+ # @param [String] script
15
+ #
16
+ # @return [Array<String>] matches
12
17
  def find_script(script)
13
- # try to locate script
18
+ return nil if script.nil? or script.empty?
14
19
  return script if File.exists? script
15
20
 
16
21
  # try relative path
@@ -1,4 +1,5 @@
1
1
 
2
+ require "oj"
2
3
  require "bixby-client"
3
4
  require "fileutils"
4
5
  require "mixlib/shellout"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bixby-client
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
  - Chetan Sarva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bixby-common