noble_names 0.1.4 → 0.1.5

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: 6efdc8370018eb99c8e94a21abb59f7ea0d6b99a
4
- data.tar.gz: 267a58e52253d8caab93db519568e16331365731
3
+ metadata.gz: c8577468ea38ce947a30e3d08d4b4ec276428027
4
+ data.tar.gz: a70419e9e7fd703dbab474274539ac4e018c7a45
5
5
  SHA512:
6
- metadata.gz: 486061cc648a081981a0411443bcfc03ba9bbc7e2a81def3ecb079f2590409d8e2aba36e73688e1552678f1ee096d007730c876dc65ae1603fb0d2b8993043ac
7
- data.tar.gz: b19cbeed4756a0ce0232427d5c3aecd8b585fd2dd45f85430527fd6a47b31ba3a8444204cbc784797d41a9d10c82c6559575cb7e27a0c1cbb462d827bef3ca75
6
+ metadata.gz: f91c330cb728a195129f87571205496a2e255be87a1e10892b65987701a8fe4d3a129ecfb060522f26bb584855337af6375dfa5bd97aabf0e3bc4e87a8e7b612
7
+ data.tar.gz: 458b24de1913870098e1e5aac7f5080fddd0b0b4bba36556456cae87f926d1085cfc4783c7f5340a3a6acbbd8452b8198fa8892cce9d06375e80872813a07173
data/.travis.yml CHANGED
@@ -9,6 +9,7 @@ before_install: gem install bundler flay flog rubocop
9
9
  install:
10
10
  - bundle install --retry=3
11
11
  script:
12
+ - bundle exec rake source_encoding
12
13
  - bundle exec rake test
13
14
  - bundle exec rubocop
14
15
  - bundle exec flay
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.pattern = 'test/**/*_test.rb'
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
- # Coding: UTF-8
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
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  # :nodoc:
2
3
  module NobleNames
3
4
  SUPPORTED_LANGUAGES =
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  module NobleNames
2
3
  module CoreExt
3
4
  # This Module gives {String} the capability to
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  module NobleNames
2
3
  # The module responsible for maintaining and delivering
3
4
  # the match data as defined in the `data` directory.
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  require_relative 'core_ext/string.rb'
2
3
 
3
4
  # :nodoc:
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  require 'yaml'
2
3
 
3
4
  module NobleNames
@@ -1,3 +1,4 @@
1
+ #-- encoding: UTF-8
1
2
  module NobleNames
2
- VERSION = '0.1.4'.freeze
3
+ VERSION = '0.1.5'.freeze
3
4
  end
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
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-05-27 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler