noble_names 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Rakefile +32 -1
- data/lib/noble_names.rb +2 -2
- data/lib/noble_names/config.rb +1 -0
- data/lib/noble_names/core_ext/string.rb +1 -0
- data/lib/noble_names/data.rb +1 -0
- data/lib/noble_names/initializer.rb +1 -0
- data/lib/noble_names/match_index.rb +1 -0
- data/lib/noble_names/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8577468ea38ce947a30e3d08d4b4ec276428027
|
4
|
+
data.tar.gz: a70419e9e7fd703dbab474274539ac4e018c7a45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91c330cb728a195129f87571205496a2e255be87a1e10892b65987701a8fe4d3a129ecfb060522f26bb584855337af6375dfa5bd97aabf0e3bc4e87a8e7b612
|
7
|
+
data.tar.gz: 458b24de1913870098e1e5aac7f5080fddd0b0b4bba36556456cae87f926d1085cfc4783c7f5340a3a6acbbd8452b8198fa8892cce9d06375e80872813a07173
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,38 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
require 'rake/testtask'
|
2
3
|
|
3
4
|
desc 'Run tests'
|
4
5
|
task default: :test
|
5
6
|
Rake::TestTask.new do |t|
|
6
|
-
t.
|
7
|
+
t.verbose = true
|
8
|
+
t.libs << 'test'
|
9
|
+
t.test_files = FileList['test/**/*_test.rb']
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Set the magic encoding comment everywhere to UTF-8'
|
13
|
+
task :source_encoding do
|
14
|
+
shebang = '\s*#!.*?(\n|\r\n)'
|
15
|
+
magic_regex = /\A(#{shebang})?\s*(#\W*(en)?coding:.*?$)/mi
|
16
|
+
|
17
|
+
magic_comment = '#-- encoding: UTF-8'
|
18
|
+
|
19
|
+
([Dir.pwd] + Dir['**/**{.rb,.rake}']).each do |file_name|
|
20
|
+
next unless File.file?(file_name)
|
21
|
+
|
22
|
+
# We don't skip code here, as we need ALL code files to have UTF-8
|
23
|
+
# source encoding
|
24
|
+
file_content = File.read(file_name)
|
25
|
+
if file_content =~ magic_regex
|
26
|
+
file_content.gsub!(magic_regex, "\\1#{magic_comment}")
|
27
|
+
elsif file_content.start_with?('#!')
|
28
|
+
# We have a shebang. Encoding comment is to put on the second line
|
29
|
+
file_content.sub!(/(\n|\r\n)/, "\\1#{magic_comment}\\1")
|
30
|
+
else
|
31
|
+
file_content = magic_comment + "\n" + file_content
|
32
|
+
end
|
33
|
+
|
34
|
+
File.open(file_name, 'w') do |file|
|
35
|
+
file.write file_content
|
36
|
+
end
|
37
|
+
end
|
7
38
|
end
|
data/lib/noble_names.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#-- encoding: UTF-8
|
2
2
|
require 'noble_names/match_index'
|
3
3
|
require 'noble_names/version'
|
4
4
|
require 'noble_names/config'
|
@@ -89,7 +89,7 @@ module NobleNames
|
|
89
89
|
word
|
90
90
|
.replace(Data.business_particles.particles[word.downcase])
|
91
91
|
else
|
92
|
-
word
|
92
|
+
noble_capitalize(word)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
data/lib/noble_names/config.rb
CHANGED
data/lib/noble_names/data.rb
CHANGED
data/lib/noble_names/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noble_names
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Martensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|