umlautify 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -3
- data/Rakefile +3 -0
- data/lib/umlautify/version.rb +1 -1
- data/lib/umlautify.rb +5 -12
- data/spec/spec_helper.rb +7 -0
- data/spec/umlautify_spec.rb +19 -0
- data/umlautify.gemspec +4 -3
- metadata +27 -7
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Umlautify
|
1
|
+
# Acme::Umlautify
|
2
2
|
|
3
|
-
A port of
|
3
|
+
A port of Philip Pollard's perl umlautify module. It will add umlauts to everything, now including the capital Y!
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,10 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
"Yes, Loincloth rocks!".umlautify!
|
22
|
+
=> "Ÿës, Löïnclöth röcks!"
|
23
|
+
|
24
|
+
|
22
25
|
|
23
26
|
## Contributing
|
24
27
|
|
data/Rakefile
CHANGED
data/lib/umlautify/version.rb
CHANGED
data/lib/umlautify.rb
CHANGED
@@ -1,21 +1,14 @@
|
|
1
1
|
require "umlautify/version"
|
2
2
|
|
3
3
|
module Umlautify
|
4
|
-
class
|
5
|
-
|
6
|
-
#
|
7
|
-
# Example:
|
8
|
-
# >> Umlautify.do("This string could use umlauts.")
|
9
|
-
# => "Thïs strïng cöüld üsë ümläüts."
|
10
|
-
|
11
|
-
def do(string)
|
4
|
+
class ::String
|
5
|
+
def umlautify!
|
12
6
|
umlaut_map = { "A" => "\u00C4", "E" => "\u00CB", "I" => "\u00CF",
|
13
|
-
"O" => "\u00D6", "U" => "\
|
7
|
+
"O" => "\u00D6", "U" => "\u00DC", "Y" => "\u0178",
|
14
8
|
"a" => "\u00E4", "e" => "\u00EB", "i" => "\u00EF",
|
15
9
|
"o" => "\u00F6", "u" => "\u00FC", "y" => "\u00FF" }
|
16
|
-
|
17
|
-
|
18
|
-
string
|
10
|
+
umlaut_map.each { |key, value| self.gsub!(key, value) }
|
11
|
+
self
|
19
12
|
end
|
20
13
|
end
|
21
14
|
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
module Umlautify
|
5
|
+
describe String do
|
6
|
+
describe ".umlautify!" do
|
7
|
+
|
8
|
+
it "should sprinkle band names with umlauts liberally" do
|
9
|
+
String.new("Motorhead").umlautify!.should == "Mötörhëäd"
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should handle all cases of vowels" do
|
13
|
+
String.new("aeiouAEIOUyY").umlautify!.should == "äëïöüÄËÏÖÜÿŸ"
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
data/umlautify.gemspec
CHANGED
@@ -8,16 +8,17 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Umlautify::VERSION
|
9
9
|
spec.authors = ["Tony Zanella"]
|
10
10
|
spec.email = ["tony.zanella@gmail.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{
|
11
|
+
spec.description = %q{Ädd ümläüts tö ëvërÿthïng!}
|
12
|
+
spec.summary = %q{Türn ÿöür strïngs üp tö ëlëvën.}
|
13
13
|
spec.homepage = "https://github.com/amz4f/umlautify"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files =
|
18
|
+
spec.test_files = Dir.glob("{spec,test}/**/*.rb")
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
23
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umlautify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -43,7 +43,23 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
-
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Ädd ümläüts tö ëvërÿthïng!
|
47
63
|
email:
|
48
64
|
- tony.zanella@gmail.com
|
49
65
|
executables: []
|
@@ -57,6 +73,8 @@ files:
|
|
57
73
|
- Rakefile
|
58
74
|
- lib/umlautify.rb
|
59
75
|
- lib/umlautify/version.rb
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
- spec/umlautify_spec.rb
|
60
78
|
- umlautify.gemspec
|
61
79
|
homepage: https://github.com/amz4f/umlautify
|
62
80
|
licenses:
|
@@ -73,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
91
|
version: '0'
|
74
92
|
segments:
|
75
93
|
- 0
|
76
|
-
hash:
|
94
|
+
hash: 661762810474807150
|
77
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
96
|
none: false
|
79
97
|
requirements:
|
@@ -82,11 +100,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
100
|
version: '0'
|
83
101
|
segments:
|
84
102
|
- 0
|
85
|
-
hash:
|
103
|
+
hash: 661762810474807150
|
86
104
|
requirements: []
|
87
105
|
rubyforge_project:
|
88
106
|
rubygems_version: 1.8.24
|
89
107
|
signing_key:
|
90
108
|
specification_version: 3
|
91
|
-
summary:
|
92
|
-
test_files:
|
109
|
+
summary: Türn ÿöür strïngs üp tö ëlëvën.
|
110
|
+
test_files:
|
111
|
+
- spec/spec_helper.rb
|
112
|
+
- spec/umlautify_spec.rb
|