noble_names 0.1.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 +7 -0
- data/lib/noble_names.rb +28 -0
- metadata +90 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: ace660f0424c63de5937d950c7442f706976f18d
|
|
4
|
+
data.tar.gz: e26dc771b958b344a201e30a11dc862ee22b277e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: d9942342c95d151c76717f0163230cf9159a6ce969280d4948b4c8e7c041bb876be50ec5d32ef0b7eeeaa62c5c0da96959e4854faa3461628b80e29191349fa4
|
|
7
|
+
data.tar.gz: 840c0a06b942238fb1016a33ed0d25e7b49862bc7ccb78ee2e8b53e00b39309274f146d56369d835cf8bdc3967b29913900cf77175c18ff8e5dac82f8c90c79b
|
data/lib/noble_names.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'noble_names/version'
|
|
2
|
+
require 'noble_names/config'
|
|
3
|
+
require 'noble_names/initializer'
|
|
4
|
+
require 'yaml'
|
|
5
|
+
|
|
6
|
+
module NobleNames
|
|
7
|
+
SUPPORTED_LANGUAGES = [:german, :english, :french, :spanish, :portuguese].freeze
|
|
8
|
+
|
|
9
|
+
DATA_PATH = File.expand_path('../../data/', __FILE__).freeze
|
|
10
|
+
|
|
11
|
+
PARTICLES = YAML.load_file(File.expand_path(
|
|
12
|
+
'particles.yml', DATA_PATH
|
|
13
|
+
))['particles'].freeze
|
|
14
|
+
|
|
15
|
+
def self.noble_capitalize(word)
|
|
16
|
+
in_particle_list?(word) ? word : word.capitalize
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.in_particle_list?(word)
|
|
20
|
+
particles = PARTICLES
|
|
21
|
+
.select { |lang| NobleNames.configuration.languages.include?(lang.to_sym) }
|
|
22
|
+
.values.flatten
|
|
23
|
+
particles.include? word
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Extends String
|
|
27
|
+
initialize
|
|
28
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: noble_names
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Paul Martensen
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.11'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.11'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: minitest
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 5.8.4
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 5.8.4
|
|
55
|
+
description: "This Gem uses a list of nobility particles to keep track of what to
|
|
56
|
+
\n capitalize and what not."
|
|
57
|
+
email:
|
|
58
|
+
- paul.martensen@gmx.de
|
|
59
|
+
executables: []
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- lib/noble_names.rb
|
|
64
|
+
homepage: https://github.com/Haniyya/noble_names
|
|
65
|
+
licenses:
|
|
66
|
+
- MIT
|
|
67
|
+
metadata:
|
|
68
|
+
allowed_push_host: https://rubygems.org
|
|
69
|
+
post_install_message:
|
|
70
|
+
rdoc_options: []
|
|
71
|
+
require_paths:
|
|
72
|
+
- lib
|
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
|
+
requirements:
|
|
75
|
+
- - ">="
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
requirements: []
|
|
84
|
+
rubyforge_project:
|
|
85
|
+
rubygems_version: 2.4.8
|
|
86
|
+
signing_key:
|
|
87
|
+
specification_version: 4
|
|
88
|
+
summary: A gem that titleizes strings while respecting certain linguistic differences.
|
|
89
|
+
test_files: []
|
|
90
|
+
has_rdoc:
|