burocracias 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Burocracias
2
2
 
3
- TODO: Write a gem description
3
+ Facilidades para lidar com as burocracias de nosso Brasil.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,14 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ### Formatação
22
+ ````ruby
23
+ "12345678909".as_cpf # => "123.456.789-09"
24
+ "12345678000195".as_cnpj # => "12.345.678-0001/95"
25
+ "20071004".as_cep # => "20.071-004"
26
+ "2122223333".as_phone_number # => "(21) 2222-3333"
27
+ "11999888777".as_phone_number # => "(11) 999-888-777"
28
+ ````
22
29
 
23
30
  ## Contributing
24
31
 
@@ -1,3 +1,3 @@
1
1
  module Burocracias
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/string.rb CHANGED
@@ -10,4 +10,8 @@ class String
10
10
  def as_cep
11
11
  Burocracias::Masks.format_cep(self)
12
12
  end
13
+
14
+ def as_phone_number
15
+ Burocracias::Masks.format_phone_number(self)
16
+ end
13
17
  end
data/spec/string_spec.rb CHANGED
@@ -16,4 +16,10 @@ describe String do
16
16
  '12345678'.as_cep.should eq '12.345-678'
17
17
  end
18
18
  end
19
+
20
+ describe '#as_phone_number' do
21
+ it 'formats string as phone number' do
22
+ '1122223333'.as_phone_number.should eq '(11) 2222-3333'
23
+ end
24
+ end
19
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burocracias
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: 1646754669709975798
80
+ hash: 2400033685650213556
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  segments:
88
88
  - 0
89
- hash: 1646754669709975798
89
+ hash: 2400033685650213556
90
90
  requirements: []
91
91
  rubyforge_project:
92
92
  rubygems_version: 1.8.24