claide 1.0.0.beta.1 → 1.0.0.beta.2

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: 8a888d4809588a8ca94222c78932a36cfac67940
4
- data.tar.gz: babd101e0982e0a7f8a426b4cc39ba49a282c3b3
3
+ metadata.gz: 138c2f7de447bdfad1075ed69ac06bfc9220cec3
4
+ data.tar.gz: c88d79e4178e7ffcf4602734af362cc177756598
5
5
  SHA512:
6
- metadata.gz: a909e58b2f88c4fe849466a1808866dbfe85189e8ec05f3d8a6be04e4ab3a5929fdd90e1dc70b14ac19adee19b81766ca48adef3ccfc6f210f48c889c61ac4cd
7
- data.tar.gz: ddb80f1c803f42e6940736b43236828082cd91658fa4199351534072627e84148f2b280253e93d9ca39ea68fce1503006336d923d29333ba4beee4234346f76e
6
+ metadata.gz: 23dc3f7e517459964657b086ea2ff1ba7de2f5ad346d4387bc6f8bb8a1f6caacb558c65bf4a2e6c3cc410670497b1a041c66e5e4c07c92a6799fd6426dc0bd93
7
+ data.tar.gz: 45415976ea1d18c5d5743b62e7cb4f80052137a88947665fb8491da4b7dc8587c81667ecfa9315afa7f32776980cde23a788570f8e5c309eebbf63894cf8fc96
data/.travis.yml CHANGED
@@ -11,5 +11,5 @@ rvm:
11
11
  - 1.9.3
12
12
  - 2.1.1
13
13
  bundler_args: --without development
14
+ before_install: gem install bundler
14
15
  script: bundle exec rake spec
15
-
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CLAide Changelog
2
2
 
3
+ ## 1.0.0.beta.2 (2016-03-08)
4
+
5
+ ##### Bug Fixes
6
+
7
+ * Attempt to get the terminal width without shelling out to `tput`.
8
+ [Samuel Giddins](https://github.com/segiddins)
9
+
10
+
3
11
  ## 1.0.0.beta.1 (2015-12-30)
4
12
 
5
13
  ##### Bug Fixes
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- claide (1.0.0.beta.1)
4
+ claide (1.0.0.beta.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.0.0)
9
+ ast (2.2.0)
10
10
  astrolabe (1.3.0)
11
11
  parser (>= 2.2.0.pre.3, < 3.0)
12
12
  bacon (1.2.0)
@@ -30,8 +30,8 @@ GEM
30
30
  mocha (>= 0.13.0)
31
31
  multi_json (1.10.1)
32
32
  notify (0.5.2)
33
- parser (2.2.0.3)
34
- ast (>= 1.1, < 3.0)
33
+ parser (2.3.0.6)
34
+ ast (~> 2.2)
35
35
  powerpack (0.1.0)
36
36
  prettybacon (0.0.2)
37
37
  bacon (~> 1.2)
data/lib/claide.rb CHANGED
@@ -8,7 +8,7 @@ module CLAide
8
8
  #
9
9
  # CLAide’s version, following [semver](http://semver.org).
10
10
  #
11
- VERSION = '1.0.0.beta.1'.freeze
11
+ VERSION = '1.0.0.beta.2'.freeze
12
12
 
13
13
  require 'claide/ansi'
14
14
  require 'claide/argument'
@@ -286,16 +286,21 @@ module CLAide
286
286
  # @return [Fixnum] The width of the current terminal unless being piped.
287
287
  #
288
288
  def self.terminal_width
289
- unless @terminal_width
290
- if !ENV['CLAIDE_DISABLE_AUTO_WRAP'] &&
291
- STDOUT.tty? && system('which tput > /dev/null 2>&1')
292
- @terminal_width = `tput cols`.to_i
293
- else
294
- @terminal_width = 0
295
- end
296
- end
297
- @terminal_width
289
+ @terminal_width ||=
290
+ (!ENV['CLAIDE_DISABLE_AUTO_WRAP'] &&
291
+ STDOUT.tty? &&
292
+ calculate_terminal_width) || 0
293
+ end
294
+
295
+ def self.calculate_terminal_width
296
+ require 'io/console'
297
+ STDOUT.winsize.last
298
+ rescue LoadError
299
+ (system('which tput > /dev/null 2>&1') && `tput cols`.to_i) || 0
300
+ rescue
301
+ 0
298
302
  end
303
+ private_class_method :calculate_terminal_width
299
304
  end
300
305
  end
301
306
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claide
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.1
4
+ version: 1.0.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-30 00:00:00.000000000 Z
12
+ date: 2016-03-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -19,12 +19,12 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - .gitignore
23
- - .kick
24
- - .rubocop.yml
25
- - .rubocop_cocoapods.yml
26
- - .travis.yml
27
- - .yardopts
22
+ - ".gitignore"
23
+ - ".kick"
24
+ - ".rubocop.yml"
25
+ - ".rubocop_cocoapods.yml"
26
+ - ".travis.yml"
27
+ - ".yardopts"
28
28
  - CHANGELOG.md
29
29
  - Gemfile
30
30
  - Gemfile.lock
@@ -55,17 +55,17 @@ require_paths:
55
55
  - lib
56
56
  required_ruby_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
- - - '>='
63
+ - - ">="
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project:
68
- rubygems_version: 2.5.1
68
+ rubygems_version: 2.6.1
69
69
  signing_key:
70
70
  specification_version: 3
71
71
  summary: A small command-line interface framework.