greek_names 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecb16d81f53a7558f0c4b1cee6a35675a1c71568
4
+ data.tar.gz: 32d67c4190de20ee7add7df4b53dd31b91f7818f
5
+ SHA512:
6
+ metadata.gz: 57254610807356ffdfe2f6991f9e0f9efa2cf42d5fa149bae0d7c0c9832bd5bb7de59606820f9cd4de63c987901dfa1e0e6201fb52d9cc29b16009e999207f99
7
+ data.tar.gz: 349dbe199d4681a1d37726ff0e5cfb934dd54a3e9fae736c39522b61e65021eaf30fbd0d1b68546c6c5203e6f7eb9a7f21e61b14b12345af517af008fb70d9db
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea/
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in greek_names.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Antonios Falegkos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # GreekNames
2
+
3
+ A library for correct appearance Greek names as appropriate.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'greek_names'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install greek_names
20
+
21
+ ## Usage
22
+
23
+ **vocative(string)**
24
+
25
+ ```ruby
26
+ GreekNames.vocative("Αλέξανδρος") # => "Αλέξανδρε"
27
+ GreekNames.vocative("Γιώργος") # => "Γιώργο"
28
+ GreekNames.vocative("Αντώνης") # => "Αντώνη"
29
+ GreekNames.vocative("Δήμητρα") # => "Δήμητρα"
30
+ GreekNames.vocative("Παππαδόπουλος") # => "Παππαδόπουλε"
31
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'greek_names/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "greek_names"
8
+ spec.version = GreekNames::VERSION
9
+ spec.authors = ["Antony Falegkos"]
10
+ spec.email = ["falegk1@gmail.com"]
11
+
12
+ spec.summary = "A library for correct appearance Greek names as appropriate"
13
+ spec.description = "A library for correct appearance Greek names as appropriate"
14
+ spec.homepage = "https://github.com/falegk/greek_names"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.8"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+
25
+ end
@@ -0,0 +1,3 @@
1
+ module GreekNames
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ require "greek_names/version"
3
+
4
+ module GreekNames
5
+ extend self
6
+
7
+ # returns the vocative name
8
+ # GreekNames.vocative("Γιώργος")
9
+ # => "Γιώργο"
10
+ # GreekNames.vocative("Αλέξανδρος")
11
+ # => "Αλέξανδρε"
12
+ # 2.1.3 :001 > GreekNames.vocative("Αντώνης")
13
+ # => "Αντώνη"
14
+ # 2.1.3 :002 > GreekNames.vocative("Μαρία")
15
+ # => "Μαρία"
16
+ def vocative(string)
17
+ if string[-2..-1].match(/(ας)|(ης)|(ΑΣ)|(ΗΣ)/)
18
+ string.chop
19
+ elsif string[-2..-1].match(/(ος|ός)|(ΟΣ)/)
20
+ maleInOS(string)
21
+ else
22
+ string
23
+ end
24
+ end
25
+
26
+
27
+ def maleInOS(string)
28
+ case string.to_s[-4..-1]
29
+ when /(γος)|(άνος|ανος)|(τος)|(ΓΟΣ)|(ΑΝΟΣ)|(ΓΟΣ)/ then string.chop
30
+ else string[-2..-1].match(/(ΟΣ)/) ? string.gsub('ΟΣ','Ε') : string.gsub(/(ός|ος)/,'ε')
31
+ end
32
+ end
33
+
34
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: greek_names
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Antony Falegkos
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-03-25 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.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
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
+ description: A library for correct appearance Greek names as appropriate
42
+ email:
43
+ - falegk1@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CODE_OF_CONDUCT.md
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - greek_names.gemspec
55
+ - lib/greek_names.rb
56
+ - lib/greek_names/version.rb
57
+ homepage: https://github.com/falegk/greek_names
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.4.6
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: A library for correct appearance Greek names as appropriate
81
+ test_files: []