string_namify 0.1.0 → 0.1.1
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 +4 -4
- data/.gitignore +0 -1
- data/README.md +1 -1
- data/lib/string_namify.rb +5 -3
- data/lib/string_namify/version.rb +1 -1
- data/string_namify.gemspec +10 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38bc10b040f1b9fe440438a15cda9feefa8bc139
|
4
|
+
data.tar.gz: 357241f357ea20a5bebd1f832c6e5fdb573aa0b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09b41f50bfcd48caa51fcc30a285f33eb427a478b30dae8fb4f55b963ec8c509a739193753ed65b4eb1cac205b110516a58c46ecb42bccd312b6285f6e119274
|
7
|
+
data.tar.gz: 6344e342d505a4a3702c8385678a13830f68dc7a1b2aa121eb843adca78411f09e308e52685b3470e5dbb1b274f2fb8e72f7ff2bc713ec0cba6909534de67788
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lib/string_namify.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
String.class_eval do
|
2
2
|
def namify
|
3
|
-
return self if self.
|
3
|
+
return self if self.empty?
|
4
4
|
capitalized = self.split.map(&:capitalize).join(' ')
|
5
|
-
capitalized.gsub!(/'(?<str>[a-z]{2})/) do |str|
|
6
|
-
|
5
|
+
capitalized.gsub!(/['-](?<str>[a-z]{2})/) do |str|
|
6
|
+
pivot = str[0]
|
7
|
+
str.slice!(0)
|
8
|
+
"#{pivot}#{str.capitalize}"
|
7
9
|
end
|
8
10
|
capitalized
|
9
11
|
end
|
data/string_namify.gemspec
CHANGED
@@ -9,10 +9,19 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Andrea Rampin"]
|
10
10
|
spec.email = ["andrea.rampin@gmail.com"]
|
11
11
|
|
12
|
-
spec.description = %q{Namify even
|
12
|
+
spec.description = %q{Namify any string even strings with apostrophe.}
|
13
13
|
spec.summary = spec.description
|
14
14
|
spec.homepage = "https://github.com/andrearampin/string_namify"
|
15
15
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
if spec.respond_to?(:metadata)
|
19
|
+
spec.metadata['allowed_push_host'] = "http://mygemserver.com"
|
20
|
+
else
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
"public gem pushes."
|
23
|
+
end
|
24
|
+
|
16
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
26
|
f.match(%r{^(test|spec|features)/})
|
18
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_namify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Rampin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Namify even
|
69
|
+
description: Namify any string even strings with apostrophe.
|
70
70
|
email:
|
71
71
|
- andrea.rampin@gmail.com
|
72
72
|
executables: []
|
@@ -86,7 +86,8 @@ files:
|
|
86
86
|
- string_namify.gemspec
|
87
87
|
homepage: https://github.com/andrearampin/string_namify
|
88
88
|
licenses: []
|
89
|
-
metadata:
|
89
|
+
metadata:
|
90
|
+
allowed_push_host: http://mygemserver.com
|
90
91
|
post_install_message:
|
91
92
|
rdoc_options: []
|
92
93
|
require_paths:
|
@@ -106,5 +107,5 @@ rubyforge_project:
|
|
106
107
|
rubygems_version: 2.0.14.1
|
107
108
|
signing_key:
|
108
109
|
specification_version: 4
|
109
|
-
summary: Namify even
|
110
|
+
summary: Namify any string even strings with apostrophe.
|
110
111
|
test_files: []
|