plata 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74f073764b3f0a79d93481b2c725fd0fcbaea92bc4dc766034f3ca05b262dac7
4
- data.tar.gz: 0c8d5bc4ca800d7c2747c8a743179656b2aea7649b2904878cf94fe21d1dbdc0
3
+ metadata.gz: ddede170dc49d1016d0d2ddadbbc2e86bb789ec3928c41ae2584dd3f944dc783
4
+ data.tar.gz: 322b1394c53f825e1eca6815a5ab0bfc5435c77efa4941d8ab2cb91c89ba9c85
5
5
  SHA512:
6
- metadata.gz: 67ecf89e51fea9f609347f8ec9343d34281c75b37287daa63294afb362ca59837a3ecf150da8d59967690ef72f0756d7b2d73187786c13a82476386283430e4d
7
- data.tar.gz: f372af5cf3be38ca3b279ca4939c8c798f35fa2531203c93873288cb902f088a4b60f1af7402860d6d59ffb7b95e501f3940bcd6196ed8df533c21a3bfdbc557
6
+ metadata.gz: 959a61dece9398c107e3806285903b9220b9a37ac75ec28c8c5c776d95f1544344d16f5ab10d19ac0303fd57433f6b36a440cff55b837babeb08b29377071cb3
7
+ data.tar.gz: 7a4adf2bf4bdb7c7d00ebed4e083b6abace7103df4105f45a95772f62a6be2fa83e62b6de63d2bd0c92794566f6fc64b0ccb4293857dea7ecf825d5a5e5e9932
@@ -5,8 +5,6 @@ en:
5
5
  thousand: 'thousand'
6
6
  conector:
7
7
  with: 'with'
8
- and: 'and'
9
- zero: 'zero'
10
8
  units:
11
9
  one: 'one'
12
10
  two: 'two'
@@ -53,4 +51,4 @@ en:
53
51
  bill: 'bill'
54
52
  trill: 'trill'
55
53
  cuatrill: 'cuatrill'
56
- quintill: 'quintill'
54
+ quintill: 'quintill'
@@ -6,7 +6,6 @@ es:
6
6
  conector:
7
7
  with: 'con'
8
8
  and: 'y'
9
- zero: 'cero'
10
9
  units:
11
10
  one: 'uno'
12
11
  two: 'dos'
@@ -54,4 +53,4 @@ es:
54
53
  bill: 'billi'
55
54
  trill: 'trilli'
56
55
  cuatrill: 'cuatrilli'
57
- quintill: 'quintilli'
56
+ quintill: 'quintilli'
@@ -5,8 +5,6 @@ pt:
5
5
  thousand: 'mil'
6
6
  conector:
7
7
  with: 'com'
8
- and: 'e'
9
- zero: 'zero'
10
8
  units:
11
9
  one: 'um'
12
10
  two: 'dois'
@@ -53,4 +51,4 @@ pt:
53
51
  bill: 'bilhão'
54
52
  trill: 'trilhão'
55
53
  cuatrill: 'mil bilhões'
56
- quintill: 'quintilhões'
54
+ quintill: 'quintilhões'
data/lib/plata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plata
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/plata.rb CHANGED
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  require 'i18n'
3
2
  require "plata/version"
4
3
  I18n.load_path += Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'locales', '*.yml')]
@@ -17,7 +16,6 @@ module Plata
17
16
  end
18
17
 
19
18
  module InstanceMethods
20
-
21
19
  def humanize_foo
22
20
  return self.zero_string self.zero?
23
21
  words = []
@@ -29,9 +27,11 @@ module Plata
29
27
 
30
28
  number = self.to_f
31
29
 
32
- if number.to_i == 0
30
+ if number.zero?
33
31
  words << self.zero_string
34
- decimal = number.to_s.split('.')[1]
32
+ elsif number > 0 && number < 1
33
+ words << I18n.t('plata.zero')
34
+ decimal = number.to_s.split('.').last
35
35
  else
36
36
  decimal = number.to_s.split(".")[1].nil? ? 0 : number.to_s.split(".")[1].to_i
37
37
  number = number.to_s.split(".")[0]
@@ -58,7 +58,8 @@ module Plata
58
58
  end
59
59
  end
60
60
  end
61
- return "#{words.reverse.join(' ')} #{conector} #{decimal}/100"
61
+
62
+ "#{words.reverse.join(' ')} #{conector} #{decimal}/100"
62
63
  end
63
64
 
64
65
  protected
data/plata.gemspec CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_development_dependency "bundler", "~> 1.11"
30
- spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "bundler", "~> 2.1.4"
30
+ spec.add_development_dependency "rake", "~> 13.0.1"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ga6ix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-30 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 13.0.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 13.0.1
41
41
  description: Describe a number in words for English, Spanish and Portugues.
42
42
  email:
43
43
  - gab.edera@gmail.com
@@ -61,7 +61,7 @@ files:
61
61
  homepage: https://github.com/gedera/plata
62
62
  licenses: []
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,9 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubyforge_project:
80
- rubygems_version: 2.7.7
81
- signing_key:
79
+ rubygems_version: 3.5.18
80
+ signing_key:
82
81
  specification_version: 4
83
82
  summary: Describe a number in words for English, Spanish and Portugues.
84
83
  test_files: []