Commit 733d6aa6 authored by Fabio Pelosin's avatar Fabio Pelosin

[UI] Support for running CocoaPods without a terminal.

Closes #577.
Closes #575.
parent 5c10da1b
...@@ -4,11 +4,18 @@ ...@@ -4,11 +4,18 @@
###### Enhancements ###### Enhancements
- The git cache now always uses a barebone repo.
[#581](https://github.com/CocoaPods/CocoaPods/pull/581)
- Added support for `.hh` headers. - Added support for `.hh` headers.
[#576](https://github.com/CocoaPods/CocoaPods/pull/576) [#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 ## 0.15.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...0.15.1) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...0.15.1)
......
...@@ -196,8 +196,9 @@ module Pod ...@@ -196,8 +196,9 @@ module Pod
# @!group Helpers # @!group Helpers
# Wraps a string taking into account the width of the terminal and an # @return [String] Wraps a string taking into account the width of the
# option indent. Adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/ # 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] txt The string to wrap
# #
...@@ -205,8 +206,12 @@ module Pod ...@@ -205,8 +206,12 @@ module Pod
# #
# @return [String] The formatted string. # @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 = '') def wrap_string(txt, indent = '')
width = `stty size`.split(' ')[1].to_i - indent.length 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") txt.strip.gsub(/(.{1,#{width}})( +|$)\n?|(.{#{width}})/, indent + "\\1\\3\n")
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment