cliutils 2.0.0 → 2.0.1

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: 617e0d4276c247b7ada07fa4b1a59585b60226a5
4
- data.tar.gz: becc38f30bd5663ef4311347879ce2871b6e4817
3
+ metadata.gz: 2c6e6e5b1a7f34b7dcfa6c887f2d1a704379f667
4
+ data.tar.gz: 67434a07cf330007da7640ee0e73f20355c70133
5
5
  SHA512:
6
- metadata.gz: e4e3393faf8853b9be3862025f141fd990d05644a0b796cf2d652d08be1b7eacb7fb90ce1af37f1dad0eeab0e24cd50b0d8c5074629dd2081eec83ff7093984d
7
- data.tar.gz: 84cdfd269cc1c6d99c27135c2bd8e68a3993cf986fa51cc4e34d45871f37bd584c768e7f0dfa487b50c0c4ca260ee7f9d60b7e334924ae7409d6f97f2ab663a9
6
+ metadata.gz: 86e74f6a482775f620e316fecf3e96cf5bb6e8ef3f0afb447f41d5cfb5069482e76238bd9bd882b0808baa1c0847778094d1b3dedd0338ad6512d3529efa24e3
7
+ data.tar.gz: a33d59a428bbd13e22f972ec9f56718fece03e952124171dd454046c7494253382551e1ef7aa678cfbf22d79b4fbe7772745c492914f939f4f1c97b555f8a024
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.0.1 (2014-04-16)
2
+
3
+ * Modified PrettyIO word wrapping to coerce to String first
4
+
1
5
  # 2.0.0 (2014-04-15)
2
6
 
3
7
  * Added plugin-based Actions
data/README.md CHANGED
@@ -5,6 +5,10 @@ CLIUtils
5
5
 
6
6
  CLIUtils is a library of functionality designed to alleviate common tasks and headaches when developing command-line (CLI) apps in Ruby.
7
7
 
8
+ # *Updating from 1.x.x to 2.0.0?*
9
+
10
+ The big difference is schema changes for Validators, Behaviors, and Pre-Post Actions. Make sure you read the [wiki](https://github.com/bachya/cliutils/wiki "CLIUtils Wiki").
11
+
8
12
  # Why?
9
13
 
10
14
  It's fairly simple:
@@ -79,6 +83,7 @@ Contributions are welcome and encouraged. To contribute:
79
83
 
80
84
  1. Fork it (http://github.com/bachya/cliutils/fork)
81
85
  2. Create your feature branch (`git checkout -b my-new-feature`)
86
+ * Make sure you add tests!
82
87
  3. Commit your changes (`git commit -am 'Add some feature'`)
83
88
  4. Push to the branch (`git push origin my-new-feature`)
84
89
  5. Create new Pull Request
@@ -1,5 +1,5 @@
1
1
  # Stores constants to use.
2
2
  module CLIUtils
3
3
  # The current version of the gem
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -60,9 +60,9 @@ module CLIUtils
60
60
  return text if PrettyIO.wrap_char_limit <= 0
61
61
 
62
62
  limit = PrettyIO.wrap_char_limit - prefix_str.length
63
- text.gsub(/\n/, ' ')
64
- .gsub(/(.{1,#{ limit }})(\s+|$)/, "#{ prefix_str }\\1\n")
65
- .strip
63
+ text.to_s.gsub(/\n/, ' ')
64
+ .gsub(/(.{1,#{ limit }})(\s+|$)/, "#{ prefix_str }\\1\n")
65
+ .strip
66
66
  else
67
67
  text
68
68
  end
data/test/pref_test.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+ require 'yaml'
3
+
4
+ require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/ext/hash_extensions')
5
+ require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/prefs/pref')
6
+
7
+ # Tests for the Prefs class
8
+ class TestPref < Test::Unit::TestCase
9
+
10
+ end
@@ -5,11 +5,24 @@ require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/ext/string_extensi
5
5
  # Tests for the String extension methods
6
6
  class TestStringExtensions < Test::Unit::TestCase
7
7
  def test_custom_colors
8
- assert_output("\e[34mtest\e[0m\n") { puts 'test'.blue }
9
- assert_output("\e[36mtest\e[0m\n") { puts 'test'.cyan }
10
- assert_output("\e[32mtest\e[0m\n") { puts 'test'.green }
11
- assert_output("\e[35mtest\e[0m\n") { puts 'test'.purple }
12
- assert_output("\e[31mtest\e[0m\n") { puts 'test'.red }
13
- assert_output("\e[33mtest\e[0m\n") { puts 'test'.yellow }
8
+ assert_output("\e[34mtest\e[0m") { print 'test'.blue }
9
+ assert_output("\e[36mtest\e[0m") { print 'test'.cyan }
10
+ assert_output("\e[32mtest\e[0m") { print 'test'.green }
11
+ assert_output("\e[35mtest\e[0m") { print 'test'.purple }
12
+ assert_output("\e[31mtest\e[0m") { print 'test'.red }
13
+ assert_output("\e[37mtest\e[0m") { print 'test'.white }
14
+ assert_output("\e[33mtest\e[0m") { print 'test'.yellow }
15
+ end
16
+
17
+ def test_colorize
18
+ assert_output("\e[35;42mtest\e[0m") { print 'test'.colorize('35;42') }
19
+ end
20
+
21
+ def test_camelize
22
+ assert_output('TestString') { print 'test_string'.camelize }
23
+ end
24
+
25
+ def test_snakify
26
+ assert_output('test_string') { print 'TestString'.snakify }
14
27
  end
15
28
  end
data/test/test_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'test/unit'
2
2
 
3
3
  class Test::Unit::TestCase
4
- require 'coveralls'
5
- Coveralls.wear!
4
+ # require 'coveralls'
5
+ # Coveralls.wear!
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach
@@ -134,6 +134,7 @@ files:
134
134
  - test/hash_extensions_test.rb
135
135
  - test/logger_extensions_test.rb
136
136
  - test/messenging_test.rb
137
+ - test/pref_test.rb
137
138
  - test/prefs_test.rb
138
139
  - test/string_extesions_test.rb
139
140
  - test/test_files/prefstest.yaml
@@ -167,6 +168,7 @@ test_files:
167
168
  - test/hash_extensions_test.rb
168
169
  - test/logger_extensions_test.rb
169
170
  - test/messenging_test.rb
171
+ - test/pref_test.rb
170
172
  - test/prefs_test.rb
171
173
  - test/string_extesions_test.rb
172
174
  - test/test_files/prefstest.yaml