extensobr 0.1.2 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8259c19e8da47eb88e3750a217fc60057f99551b
4
- data.tar.gz: 2d3447665586e989262a3af7d77d5fd6466ae765
2
+ SHA256:
3
+ metadata.gz: 47761fcd0aadc7f026970577b3cb526493179f0385f1e66c0138d017191a806f
4
+ data.tar.gz: 3c8c0f4ede5cc204a7707d28b38e37491d5204a645c2467e25f5424e383c95a8
5
5
  SHA512:
6
- metadata.gz: 945037856c554adccf8b9a7086e4afaafb61aac02918b4aafd5d22ca777b839a1a030fd8ab5b4d36400ed323a1bfd2d52fa7ef035430ac723a1a556467e77cd1
7
- data.tar.gz: 8ad533d6886f1151f0574c098a458d2739a1eec93881187b312d020691940ffbfc4b4cf0e196fe1c97eee452febd400f0259b0b89038d914d7707098b6b2d19d
6
+ metadata.gz: 3952552c3c843939cd9fc46ef94dc844b7be36aa678627b7d15782567d860baac257e49423b95c4b6dddf9d91e655c8cbf503b3f58a3cae0c9f0d97aca45dde8
7
+ data.tar.gz: 246b3f4d254338a0b9d95050e597cf8a42e3cb64120ca4adec304dcbac3333fdd16e1c1533b07ea7a489d2a1da999120787a76e3d887c9d8f6ac45590ae28510
data/.gitignore CHANGED
@@ -1,10 +1,10 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.gem
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,74 +1,74 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at rickmaxg3@hotmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at rickmaxg3@hotmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in extensobr.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in extensobr.gemspec
4
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 MacBook Pro
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 MacBook Pro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,63 +1,63 @@
1
- # Extensobr
2
-
3
- Esta gem foi desenvolvida para auxiliar no desenvolvimento de aplicações onde é necessário escrever ou imprimir números ou moedas por extenso como por exemplo em recibos, contratos entre outros.
4
-
5
-
6
- ## Instalação
7
-
8
- Adicionando em sua Gemfile:
9
-
10
- ```ruby
11
- gem 'extensobr'
12
- ```
13
-
14
- Ou instale você mesmo:
15
-
16
- $ gem install extensobr
17
-
18
- ## Exemplos de uso
19
-
20
- Para obter o extenso de um número, utilize Extenso.numero.
21
-
22
- irb
23
-
24
- require 'Extensobr.rb'
25
-
26
- puts Extenso.numero(832); # oitocentos e trinta e dois
27
- puts Extenso.numero(832, Extenso::GENERO_FEM) # oitocentas e trinta e duas
28
-
29
- Para obter o extenso de um valor monetário, utilize Extenso.moeda.
30
-
31
- require 'Extenso.rb'
32
-
33
- ## IMPORTANTE: este método recebe um valor inteiro(int), para a contagem das casas decimais!
34
-
35
- puts Extenso.moeda(15402) # cento e cinquenta e quatro reais e dois centavos
36
- puts Extenso.moeda(47) # quarenta e sete centavos
37
- puts Extenso.moeda(357082, 2, ['peseta', 'pesetas', Extenso::GENERO_FEM], ['cêntimo', 'cêntimos', Extenso::GENERO_MASC])
38
-
39
- ## três mil, quinhentas e setenta pesetas e oitenta e dois cêntimos
40
-
41
- Para obter o valor em real de um número, utilize Extenso.real_formatado.
42
-
43
- Extenso.real_formatado(154.55) # R$ 154,55
44
- Extenso.real_formatado(0) # R$ 0,00
45
- Extenso.real_formatado(1) # R$ 1,00
46
-
47
- # Developers
48
-
49
- [Henrique Max](https://github.com/rickmax),
50
- [Fausto G. Cintra](https://github.com/goncin),
51
- [Victor Eduardo](https://github.com/victoreduardo)
52
-
53
- ## Como contribuir?
54
-
55
- 1. Fazer um fork do projeto
56
- 1. Fazer os devidos ajustes com os respectivos testes
57
- 1. Fazer pull request
58
-
59
-
60
- ## Licença
61
-
62
- Está Gem esta disponível sob ostermos de licença [MIT License](http://opensource.org/licenses/MIT).
63
-
1
+ # Extensobr
2
+
3
+ Esta gem foi desenvolvida para auxiliar no desenvolvimento de aplicações onde é necessário escrever ou imprimir números ou moedas por extenso como por exemplo em recibos, contratos entre outros.
4
+
5
+
6
+ ## Instalação
7
+
8
+ Adicionando em sua Gemfile:
9
+
10
+ ```ruby
11
+ gem 'extensobr'
12
+ ```
13
+
14
+ Ou instale você mesmo:
15
+
16
+ $ gem install extensobr
17
+
18
+ ## Exemplos de uso
19
+
20
+ Para obter o extenso de um número, utilize Extenso.numero() OBS: Ovalor deve ser do tipo "INTEGER".
21
+
22
+ irb
23
+
24
+ require 'Extensobr.rb'
25
+
26
+ puts Extenso.numero(832); # oitocentos e trinta e dois
27
+ puts Extenso.numero(832, Extenso::GENERO_FEM) # oitocentas e trinta e duas
28
+
29
+ Para obter o extenso de um valor monetário, utilize Extenso.moeda() OBS: Ovalor deve ser do tipo "FLOAT".
30
+
31
+ require 'Extenso.rb'
32
+
33
+ ## IMPORTANTE: este método recebe um valor inteiro(int), para a contagem das casas decimais!
34
+
35
+ puts Extenso.moeda(154.02) # cento e cinquenta e quatro reais e dois centavos
36
+ puts Extenso.moeda(0.47) # quarenta e sete centavos
37
+ puts Extenso.moeda(3570.82, 2, ['peseta', 'pesetas', Extenso::GENERO_FEM], ['cêntimo', 'cêntimos', Extenso::GENERO_MASC])
38
+
39
+ ## três mil, quinhentas e setenta pesetas e oitenta e dois cêntimos
40
+
41
+ Para obter o valor em real de um número, utilize Extenso.real_formatado.
42
+
43
+ Extenso.real_formatado(154.55) # R$ 154,55
44
+ Extenso.real_formatado(0) # R$ 0,00
45
+ Extenso.real_formatado(1) # R$ 1,00
46
+
47
+ # Developers
48
+
49
+ [Henrique Max](https://github.com/rickmax),
50
+ [Fausto G. Cintra](https://github.com/goncin),
51
+ [Victor Eduardo](https://github.com/victoreduardo)
52
+
53
+ ## Como contribuir?
54
+
55
+ 1. Fazer um fork do projeto
56
+ 1. Fazer os devidos ajustes com os respectivos testes
57
+ 1. Fazer pull request
58
+
59
+
60
+ ## Licença
61
+
62
+ Está Gem esta disponível sob ostermos de licença [MIT License](http://opensource.org/licenses/MIT).
63
+
data/Rakefile CHANGED
@@ -1,2 +1,2 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "extensobr"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "extensobr"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/extensobr.gemspec CHANGED
@@ -1,29 +1,29 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'extensobr/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "extensobr"
8
- spec.version = Extensobr::VERSION
9
- spec.authors = ["Henrique Max"]
10
- spec.email = ["rickmaxg3@hotmail.com"]
11
-
12
- spec.summary = %q{ExtendoBr escreve números e moeda por extenso.}
13
- spec.description = %q{ExtensoBr é uma gem que foi desenvolvida para auxiliar na impressão de números e moedas por extenso em portugês do Brasil.}
14
- spec.homepage = "https://github.com/rickmax/extensobr"
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
-
20
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
- f.match(%r{^(test|spec|features)/})
22
- end
23
- spec.bindir = "exe"
24
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
- spec.require_paths = ["lib"]
26
-
27
- spec.add_development_dependency "bundler", "~> 1.13"
28
- spec.add_development_dependency "rake", "~> 12.3.3"
29
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'extensobr/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "extensobr"
8
+ spec.version = Extensobr::VERSION
9
+ spec.authors = ["Henrique Max"]
10
+ spec.email = ["rickmaxg3@hotmail.com"]
11
+
12
+ spec.summary = %q{ExtendoBr escreve números e moeda por extenso.}
13
+ spec.description = %q{ExtensoBr é uma gem que foi desenvolvida para auxiliar na impressão de números e moedas por extenso em portugês do Brasil.}
14
+ spec.homepage = "https://github.com/rickmax/extensobr"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+ spec.add_development_dependency "bundler", "~> 2.2.15"
27
+ spec.add_development_dependency "rake", "~> 12.3.3"
28
+ spec.add_development_dependency "rspec"
29
+ end