string-utility 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/utils.rb +8 -7
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f92b1066574eae3c7e4ce1e67373585e0281d66
4
- data.tar.gz: d8ece5bd0236fd66f7145eacdc7454cba36a458c
3
+ metadata.gz: c07c4048933918e138ae01dd24da04e05da748f6
4
+ data.tar.gz: 878598e93962656a0121a5ef0455cda8bc97e64b
5
5
  SHA512:
6
- metadata.gz: 1d898cd1faf347f593f501d4cf0ce6e3a366f8e777c7bf790d7c5c3e3306dbbf0873fa074cc256adc52b2dd03bb4c1a0553d9a26a968106cbe0c5175fb831b06
7
- data.tar.gz: 7e77a383f86c55df46e4a6e0110860c8cd92faa8d32fec02da30e0babfd85b7f08c3331378ad6d1d4825769735a75c471d431db01ea6d3b44ca0e6efe4e8a821
6
+ metadata.gz: 64ed9853a139ce45d12174ed1f175cd35ce2dcea98a74b23804f0fb10a0c6776ff58e3731b067924c7593453cfc470addc8e6508d9857c8fb655746bb12899b3
7
+ data.tar.gz: c59ac5af0d4d974ac7a92b21ed7632063faa2fedf5e99a700d6bea6b34d5522de462c3667c63c3cd4eee97025db709c9957516f82f6262ba01321464cb06bf8b
data/CHANGELOG.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # Changelog
2
2
  ## Version 2
3
+ ### Version 2.0.1
4
+ * Fixed style issues thanks to Rubocop.
5
+
3
6
  ### Version 2.0.0
4
7
  * There is no longer an initialize method.
5
8
  * separate is now a monkeypatch using the refine keyword.
6
9
 
10
+ ## Version 1
7
11
  ### Version 1.0.1
8
12
  * No longer need to create an instance of StringUtility. Not really sure why I made that the case in the first place.
9
13
  ### Version 1.0.0
data/lib/utils.rb CHANGED
@@ -1,20 +1,21 @@
1
1
  module StringUtility
2
-
3
2
  refine String do
4
- # Separates the string by another string. Useful for converting integers into human-readable numbers.
3
+ # Separates the string by another string. Useful for converting integers
4
+ # into human-readable numbers.
5
5
  # @param count [Int] The number of integers to separate by. Defaults to 3.
6
- # @param separator [String] The string to use as a separator. Can only be 1 character long. Will use the first character if it is greater than 1 character long. Defaults to a comma.
6
+ # @param separator [String] The string to use as a separator. Can only be
7
+ # 1 character long. Will use the first character if it is greater than
8
+ # 1 character long. Defaults to a comma.
7
9
  # @return [String] Formatted version of the provided string.
8
10
  def separate(count = 3, separator = ',')
9
- if separator.length > 1
10
- separator = separator[0]
11
- end
11
+ separator = separator[0] if separator.length > 1
12
12
  string = self
13
13
  string = string.reverse
14
14
  array = string.scan(/.{1,#{count}}/)
15
15
  string = array.join(separator)
16
16
  string = string.reverse
17
- return string
17
+
18
+ string
18
19
  end
19
20
  end
20
21
  end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string-utility
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
  - Eli Foster
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: |2
14
- Some simple but handy methods to interact with string objects.
13
+ description: " Some simple but handy methods to interact with string objects.\n"
15
14
  email: elifosterwy@gmail.com
16
15
  executables: []
17
16
  extensions: []