embossing_name 0.1.7 → 0.2.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
2
  SHA1:
3
- metadata.gz: 0a8c035a9fdaa31b04432f761bae893be58a8e02
4
- data.tar.gz: 1c1455add704f566dbb26a22d876a794bf76fa5e
3
+ metadata.gz: 123337d72448cb7ed002bfee46757b11ca64b3d6
4
+ data.tar.gz: 013c2108a4678d7299f0d7864ad968c1ac7616bb
5
5
  SHA512:
6
- metadata.gz: 3b4da528c65c834be6e9846f056c13380bd0bacc31ff7fa7f5bae5a845dcd974139054e48b9ef2e699d49d275ad8fe9ceab089539f443bce2fc065f32e66eaa5
7
- data.tar.gz: f63b6da468434b1c62a7e8638ede0402324eec1283aba521c09a22867d075dcd91d3c7b7322b4300d854ebe0e8cb6e7352e32c7eb4639263b6b1bc955a535f3a
6
+ metadata.gz: 48bd6d0df0ac363e143d78295424aadc2f2c24ab8c5b54875fc01ef3341bee55c5ca5cbc293fc8b2a2e68448abec02d07ab354796ee4fb70c4f9f7b7ea792391
7
+ data.tar.gz: e6aba7fe4637f0d3ee843032e28d88e517225a25e8d84f81ffb8031321fc7ac373a53643427f848254d1437f6c3fda66dbcb16c42a70e6371050c645f18f0843
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in embossing_name.gemspec
4
4
  gemspec
5
+ gem 'activesupport'
data/README.md CHANGED
@@ -23,17 +23,18 @@ Or install it yourself as:
23
23
  ## Usage
24
24
 
25
25
  Full format:
26
-
27
- EmbossingName::EmbossingName.normalize_name_to_embossing('Wickaninnish Muscowequan Aputsiaq Goyathlay') #=> "WICKANINNISH M A GOY"
26
+ ```ruby
27
+ Embossing::Name.normalize_name_to_embossing('Wickaninnish Muscowequan Aputsiaq Goyathlay') #=> "WICKANINNISH M A GOY"
28
+ ```
28
29
 
29
30
  Only reducing the name:
30
-
31
- EmbossingName::EmbossingName.reduct_name('Nanook Quidel Kaneonuskatew Qillaq') #=> "Nanook Q K Qillaq"
32
-
31
+ ```ruby
32
+ Embossing::Name.reduct_name('Nanook Quidel Kaneonuskatew Qillaq') #=> "Nanook Q K Qillaq"
33
+ ```
33
34
  Only removing the accents:
34
-
35
- EmbossingName::EmbossingName.remove_accents('Nanóók Quídél Kaneonuskatew Qillaq') #=> "Nanook Quidel Kaneonuskatew Qillaq"
36
-
35
+ ```ruby
36
+ Embossing::Name.remove_accents('Nanóók Quídél Kaneonuskatew Qillaq') #=> "Nanook Quidel Kaneonuskatew Qillaq"
37
+ ```
37
38
 
38
39
  ## Development
39
40
 
@@ -43,7 +44,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
43
44
 
44
45
  ## Contributing
45
46
 
46
- Bug reports and pull requests are welcome on GitHub at https://github.com/jhonatannascimento1994/embossing_name. 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.
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jinascimento/embossing_name. 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.
47
48
 
48
49
 
49
50
  ## License
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "embossing_name"
4
+ require "embossing"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -5,13 +5,13 @@ require 'embossing_name/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "embossing_name"
8
- spec.version = "0.1.7"
8
+ spec.version = "0.2.0"
9
9
  spec.authors = ["Jhonatan I. Nascimento"]
10
- spec.email = ["jhonatan-nascimento94@hotmail.com.br"]
10
+ spec.email = ["jhonatan-nascimento94@hotmail.com"]
11
11
 
12
12
  spec.summary = "A gem of embossing of card"
13
13
  spec.description = "This gem is used for embossing of card, also have methods of normalization of name"
14
- spec.homepage = "https://github.com/jhonatannascimento1994"
14
+ spec.homepage = "https://github.com/jinascimento"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
@@ -1,21 +1,20 @@
1
- module EmbossingName
2
- class EmbossingName
3
- require "active_support/inflector"
1
+ module Embossing
2
+ class Name
3
+ require 'active_support/inflector'
4
4
 
5
5
  class << self
6
-
7
6
  def normalize_name_to_embossing(full_name, size_name = 19)
8
- embossing_name = remove_accents(full_name)
9
- embossing_name = remove_abreviate(embossing_name)
10
- embossing_name = reduct_name(embossing_name, size_name)
11
- embossing_name = embossing_name.upcase[0..size_name]
7
+ embossing_name = remove_accents(full_name)
8
+ embossing_name = remove_abreviate(embossing_name)
9
+ embossing_name = reduct_name(embossing_name, size_name)
10
+ embossing_name = embossing_name.upcase[0..size_name]
12
11
  end
13
12
 
14
13
  def reduct_name(full_name, size_name = 19)
15
14
  if full_name.size > size_name
16
15
  full_name = full_name.split
17
- reduce_name = ""
18
- full_name.each_with_index { |n, i| reduce_name += (i == 0 || i == full_name.size-1 ? " #{n}" : " #{n[0]}") }
16
+ reduce_name = ''
17
+ full_name.each_with_index { |n, i| reduce_name += (i == 0 || i == full_name.size - 1 ? " #{n}" : " #{n[0]}") }
19
18
  reduce_name[1...reduce_name.size]
20
19
  else
21
20
  full_name
@@ -24,15 +23,14 @@ module EmbossingName
24
23
 
25
24
  def remove_abreviate(name_card)
26
25
  name_card = name_card.split
27
- abreviate = ['da', 'do', 'das', 'dos']
26
+ abreviate = %w[da do das dos]
28
27
  abreviate.each { |ab| name_card.delete(ab) }
29
- name_card.join(" ")
28
+ name_card.join(' ')
30
29
  end
31
30
 
32
31
  def remove_accents(full_name)
33
32
  ActiveSupport::Inflector.transliterate(full_name)
34
33
  end
35
-
36
34
  end
37
35
  end
38
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embossing_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jhonatan I. Nascimento
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,7 +55,7 @@ dependencies:
55
55
  description: This gem is used for embossing of card, also have methods of normalization
56
56
  of name
57
57
  email:
58
- - jhonatan-nascimento94@hotmail.com.br
58
+ - jhonatan-nascimento94@hotmail.com
59
59
  executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
@@ -71,9 +71,9 @@ files:
71
71
  - bin/console
72
72
  - bin/setup
73
73
  - embossing_name.gemspec
74
- - lib/embossing_name.rb
74
+ - lib/embossing.rb
75
75
  - lib/embossing_name/version.rb
76
- homepage: https://github.com/jhonatannascimento1994
76
+ homepage: https://github.com/jinascimento
77
77
  licenses:
78
78
  - MIT
79
79
  metadata: {}
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.6.10
96
+ rubygems_version: 2.6.14
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: A gem of embossing of card