Permalink
Browse files

[UI] Support for running CocoaPods without a terminal.

Closes #577.
Closes #575.
  • Loading branch information...
1 parent 5c10da1 commit 733d6aa6621aa8e9e8054e7c84411aebd3df3ce1 @fabiopelosin fabiopelosin committed Oct 10, 2012
Showing with 16 additions and 4 deletions.
  1. +9 −2 CHANGELOG.md
  2. +7 −2 lib/cocoapods/user_interface.rb
View
@@ -4,11 +4,18 @@
###### Enhancements
-- The git cache now always uses a barebone repo.
- [#581](https://github.com/CocoaPods/CocoaPods/pull/581)
- Added support for `.hh` headers.
[#576](https://github.com/CocoaPods/CocoaPods/pull/576)
+###### Bug fixes
+
+- Restored support for not running CocoaPods in a terminal.
+ [#575](https://github.com/CocoaPods/CocoaPods/pull/575)
+ [#577](https://github.com/CocoaPods/CocoaPods/pull/577)
+- The git cache now always uses a barebone repo preventing a number of related issues.
+ [#581](https://github.com/CocoaPods/CocoaPods/pull/581)
+ [#569](https://github.com/CocoaPods/CocoaPods/pull/569)
+
## 0.15.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...0.15.1)
@@ -196,17 +196,22 @@ def puts_indented(message = '')
# @!group Helpers
- # Wraps a string taking into account the width of the terminal and an
- # option indent. Adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
+ # @return [String] Wraps a string taking into account the width of the
+ # terminal and an option indent. Adapted from
+ # http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
#
# @param [String] txt The string to wrap
#
# @param [String] indent The string to use to indent the result.
#
# @return [String] The formatted string.
#
+ # @note If CocoaPods is not being run in a terminal or the width of the
+ # terminal is too small a width of 80 is assumed.
+ #
def wrap_string(txt, indent = '')
width = `stty size`.split(' ')[1].to_i - indent.length
+ width = 80 unless width >= 10
txt.strip.gsub(/(.{1,#{width}})( +|$)\n?|(.{#{width}})/, indent + "\\1\\3\n")
end
end

0 comments on commit 733d6aa

Please sign in to comment.