corelib 0.0.4 → 0.0.5

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: ec4f66acccd5ce6fe48870677dee180718b2d17b
4
- data.tar.gz: 3c5052450fcf5c47ff0fb148a989a213587d7aec
3
+ metadata.gz: b40273d8345128c15662dbb6b8405b9cbe478f33
4
+ data.tar.gz: 10e8b878e22f4bb36d968b528726e56b998dce83
5
5
  SHA512:
6
- metadata.gz: 43d0708b128dd8b37a6088b1788a389205cd519a4f1f5a6eef3b0bbd9cd3ae664a472a0afd814242b24d18729e747f90364090f7ac4d68eb95e82e7138b90307
7
- data.tar.gz: de87d535265d31237d724a8ff1b4f6afc313315fadebd7b6510aed6d1b6e5dfb03bda554a18b68473d802c14b8bc0a3c8ca33353d3a3777f7e909622a3060fc5
6
+ metadata.gz: c3eed0d06beb744ac7105a1a6bf9b6755735d8db87cce9929b71569299c301934b84559b5df2e15e2a2e776953234e0a204090ebc630a0a28ff970f6ae64a724
7
+ data.tar.gz: 865b337465c7d99d0c8d91e1c5747ce4df155f1399c65317529732d8190f8887b6d9448c7070e259d6dcb759f90de89ef1a79333a7d17ed1defb3e146e53b75d
@@ -16,8 +16,8 @@ class String
16
16
  # Combines two strings together with a separator.
17
17
  def combine(str, options={})
18
18
  strip = options.fetch(:strip, true)
19
- return compact ? self.strip : self.dup if str.nil? or str.empty?
20
- return compact ? str.strip : str.dup if self.empty?
19
+ (return strip ? self.strip : self.dup) if str.nil? or str.empty?
20
+ (return strip ? str.strip : str.dup) if self.empty?
21
21
  separator = options.fetch(:separator, " ")
22
22
 
23
23
  if strip
@@ -1,3 +1,3 @@
1
1
  module Corelib
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,6 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe String do
4
+ describe "#combine" do
5
+ it 'defaults work' do
6
+ "test".combine("test2").should == "test test2"
7
+ "".combine("test2").should=="test2"
8
+ "test".combine("").should == "test"
9
+ end
10
+ end
11
+
4
12
  describe "#to_bool" do
5
13
  it 'converts to true correctly' do
6
14
  "true".to_bool.should == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corlew Solutions