inch 0.5.0.rc10 → 0.5.0.rc11

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: 638174e9554e3e2939318497da1bc383117b4da2
4
- data.tar.gz: 5d8da01335c3b3aa85c32206f17e6be9467cc438
3
+ metadata.gz: d83477cb56f05fa36eae43b8a5207cccf6160b53
4
+ data.tar.gz: 89554aa7ecb0f7845ebeaca9851eb8daa0e735e3
5
5
  SHA512:
6
- metadata.gz: 860ec137656d65114b760e311573ce6b00321f9a490a763cc5aa9e1830d920e4172808bf14abbbce52953632a41ad7a026d7953140a55d7fdef9067f27cb37d3
7
- data.tar.gz: 4b471c480d52ba2724b34edc1d96f36f1929b1bcebcc6a3609524a03f511d195cb6df12c59b9b2f9459e7a0f7173ea3c792696e24edbd9a883dfe1db16c2a411
6
+ metadata.gz: 6d7282dabbec8ed4f730eac1d7511f507c3dd260f8820ee8edaefe0fd385e902c0b7003c455487b90ae91596f1d9e2a0235e7cb102f6b2ab52a999d5872d3c4e
7
+ data.tar.gz: f2ee1b8f2716a954873e14fb7d58f8b1bd11c18182e8c1ee3bddedaf80f580a99d82b6c1e6518b6346b9cf559f25e40a22ff48f3aa22a78b52f371ce6c149312
data/lib/inch/cli.rb CHANGED
@@ -10,9 +10,13 @@ module Inch
10
10
  # @param default [Fixnum] default value for columns
11
11
  # @return [Fixnum]
12
12
  def get_term_columns(default = 80)
13
- str = `stty size`
14
- rows_cols = str.split(' ').map(&:to_i)
15
- rows_cols[1] || default
13
+ str = `stty size 2>&1`
14
+ if str =~ /Invalid argument/
15
+ default
16
+ else
17
+ rows_cols = str.split(' ').map(&:to_i)
18
+ rows_cols[1] || default
19
+ end
16
20
  rescue
17
21
  default
18
22
  end
@@ -31,21 +31,20 @@ module Inch
31
31
 
32
32
  class FunctionSignature < Struct.new(:signature)
33
33
  def parameter_names
34
- names = []
35
- signature.each do |tuple|
36
- if name = name_from_tuple(*tuple)
37
- names << name
38
- end
34
+ return [] if signature.nil?
35
+ signature.map do |tuple|
36
+ name_from_tuple(*tuple)
39
37
  end
40
- names
41
38
  end
42
39
 
43
40
  def name_from_tuple(a, _, b)
44
- if b.nil?
41
+ if b.nil? || b == 'Elixir'
45
42
  a
46
43
  else
47
44
  if a == "\\\\"
48
- b.first.first
45
+ name_from_tuple(*b.first)
46
+ else
47
+ warn "[WARN] could not parse FunctionSignature: #{[a, _, b].inspect}"
49
48
  end
50
49
  end
51
50
  end
data/lib/inch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Inch
2
- VERSION = '0.5.0.rc10'
2
+ VERSION = '0.5.0.rc11'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.rc10
4
+ version: 0.5.0.rc11
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Föhring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler