latias-string-commas 0.1.0 → 0.1.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/README.md +2 -2
  3. data/lib/latias/string.rb +7 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 464c9efaaf089f39a9167a148bb8dc98117fc3018c0fb43fbfa98d67d7323b83
4
- data.tar.gz: bf459bd05963b26f62eaed543d34499a8b9af7bfc22c2bcaf763c04fcf1a734e
3
+ metadata.gz: a359576c0ec4dd07baa1ea2668af3f1d7efb18fad8c7adcbc43b0e09b35cce8f
4
+ data.tar.gz: c62287f2a9f21175534e4e2670a5cce20f89c953489d5d2730be921c92be7be5
5
5
  SHA512:
6
- metadata.gz: 3cba2ed1233be4760a68e15a39d63058736c85dbbfee3642d2dbff73f975b34b77c2cb93b7209f5fc21d83508642bd8d539c96b8d1056d45b993c9b2bd1052a1
7
- data.tar.gz: f0874c18a9cab39875b314ae62210d4d13d74f210100e9786e07871265c152cde0f42e571e2f98ed0c4da2bbe567df592178bf9a23ffd667f7c8a8974bebc4ab
6
+ metadata.gz: 3e97f8f8e6f9b96ad1ec3d02b6cee0fdf8e40a1f638f0d178f9586eda991be384fb08f9cc2aed4641041327ac4f6923284fadb627fbe275f581c6aaafef1f04a
7
+ data.tar.gz: 6a350b4a5438c1b8da77c70f7c3e972788883c88293e628661fd3d59863f6c912c6d1718c0e0b0fc25b6198a9120c0a58cd3e73e7df1dca7aedf5bbc9596022c
data/README.md CHANGED
@@ -8,12 +8,12 @@ How to use my plugin.
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'latias-string-commas', '0.1.0', git: 'https://nattanon:dT1Lcvf8pvGoU7LX4Uqr@gitlab.opensource-technology.com/nattanon/latias-string-commas.git'
11
+ gem 'latias-string-commas', '~> 0.1.1'
12
12
  ```
13
13
 
14
14
  ## Examples
15
15
  ```ruby
16
- require 'latias-string-commas'
16
+ include Latias::String
17
17
  ```
18
18
 
19
19
  ```ruby
@@ -1,7 +1,11 @@
1
1
  module Latias
2
- class String
3
- def add_commas
4
- reverse.scan(/\d{3}|.+/).join(',').reverse
2
+ module String
3
+ def add_commas(m_str)
4
+ m_str.to_s.reverse.scan(/\d{3}|.+/).join(',').reverse
5
+ rescue StandardError # optionally: `rescue Exception => ex`
6
+ m_str
5
7
  end
6
8
  end
7
9
  end
10
+
11
+ extend Latias::String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latias-string-commas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nattanon