burocracias 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/burocracias.rb CHANGED
@@ -5,7 +5,7 @@ module Burocracias
5
5
  class Masks
6
6
  def self.format_cpf(string)
7
7
  if string.length <= 11
8
- ("%011d" % string).insert(9, '-').insert(6, '.').insert(3, '.')
8
+ string.to_s.rjust(11, '0').insert(9, '-').insert(6, '.').insert(3, '.')
9
9
  else
10
10
  string
11
11
  end
@@ -13,7 +13,7 @@ module Burocracias
13
13
 
14
14
  def self.format_cnpj(string)
15
15
  if string.length <= 14
16
- ("%014d" % string).insert(12, '-').insert(8, '/').insert(5, '.').insert(2, '.')
16
+ string.to_s.rjust(14, '0').insert(12, '-').insert(8, '/').insert(5, '.').insert(2, '.')
17
17
  else
18
18
  string
19
19
  end
@@ -21,7 +21,7 @@ module Burocracias
21
21
 
22
22
  def self.format_cep(string)
23
23
  if string.length <= 8
24
- ("%08d" % string).insert(5, '-').insert(2, '.')
24
+ string.to_s.rjust(8, '0').insert(5, '-').insert(2, '.')
25
25
  else
26
26
  string
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Burocracias
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-04 00:00:00.000000000 Z
12
+ date: 2013-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: 2400033685650213556
80
+ hash: -1813684070975990625
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: 2400033685650213556
89
+ hash: -1813684070975990625
90
90
  requirements: []
91
91
  rubyforge_project:
92
92
  rubygems_version: 1.8.24