simple_text_reformatter 1.0.0 → 1.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.
- checksums.yaml +4 -4
- data/README.md +10 -36
- data/lib/simple_text_reformatter/phone_number_formatter.rb +0 -2
- data/lib/simple_text_reformatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b33414914245577f2379cab589207addfb06a6c795171fb5fb8a36f6dab864ad
|
4
|
+
data.tar.gz: bee312d64fb84d9ead645395763e4bbe827bc5fa103ade7bd9e5938bc3c1f28c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e928ff26086eba0b933cf2f48a1dc4a06633bf8f268661f08885fc55f11939ee373a4350b78a62257501c55aa72b80a091e464c06fd62f22a1ed3cad29a0f795
|
7
|
+
data.tar.gz: 56622ecc2488f8b6712f6d12f396c7566614a83dbfb70da267ffb15e6efc9812675f35ce9caf60d327ad71f1d4427ac5d0e5bb86c0e5ce0900730ffa5ae0aac4
|
data/README.md
CHANGED
@@ -1,43 +1,17 @@
|
|
1
1
|
# SimpleTextReformatter
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'simple_text_reformatter'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install simple_text_reformatter
|
3
|
+
This was a gem I created to be a pure ruby way of __very__ simple reformatting of text, I built it so I could use it in a different project, but feel free to use it wherever you want.
|
22
4
|
|
23
5
|
## Usage
|
24
6
|
|
25
|
-
|
7
|
+
As I need them I will continue to add more reformat types to this gem, but for now it does an extremely simple phone number reformatting. To use this you just need to call:
|
26
8
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/simple_text_reformatter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
-
|
37
|
-
## License
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
-
|
41
|
-
## Code of Conduct
|
9
|
+
```
|
10
|
+
SimpleTextReformatter.format_as_phone_number('1234567890')
|
11
|
+
```
|
42
12
|
|
43
|
-
|
13
|
+
This follows a few basic rules:
|
14
|
+
* The Phone Number will reformat to `(123) 456-7890`
|
15
|
+
* If a region code (really just '1' for now) is passed in it will get chopped off: `"11234567890" => "(123) 456-7890"`
|
16
|
+
* Any additional numbers passed after will be included as an extension: `"12345678901234" => "(123) 456-7890 x1234" `
|
17
|
+
* Any nondigits passed in will be excluded
|