turkish_support 0.3.0 → 1.0.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +7 -0
- data/README.md +173 -41
- data/Rakefile +3 -3
- data/lib/turkish_support.rb +6 -6
- data/lib/turkish_support/array_methods.rb +5 -1
- data/lib/turkish_support/constants.rb +47 -14
- data/lib/turkish_support/helpers.rb +112 -0
- data/lib/turkish_support/string_methods.rb +33 -21
- data/lib/turkish_support/version.rb +1 -1
- data/spec/helpers_spec.rb +264 -0
- data/spec/turkish_support_spec.rb +482 -122
- data/turkish_support.gemspec +15 -14
- metadata +13 -9
- data/lib/turkish_support/destructives.rb +0 -17
- data/lib/turkish_support/string_helpers.rb +0 -42
data/turkish_support.gemspec
CHANGED
@@ -4,22 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'turkish_support/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'turkish_support'
|
8
8
|
spec.version = TurkishSupport::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
|
14
|
-
spec.
|
9
|
+
spec.authors = ['Sıtkı Bağdat']
|
10
|
+
spec.email = ['sbagdat@gmail.com']
|
11
|
+
spec.summary = 'Turkish character support for core ruby methods.'
|
12
|
+
spec.description = 'Turkish character support for core ruby methods \
|
13
|
+
like String#upcase, String#gsub, String#match, Array#sort, and etc...)'
|
14
|
+
spec.homepage = 'https://github.com/sbagdat/turkish_support'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(
|
18
|
-
spec.test_files = spec.files.grep(
|
19
|
-
spec.require_paths = [
|
18
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
20
|
+
spec.require_paths = ['lib']
|
20
21
|
|
21
|
-
spec.required_ruby_version =
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
22
|
+
spec.required_ruby_version = '>= 2.0.0'
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec'
|
25
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turkish_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.pre.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sıtkı Bağdat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,8 +52,9 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
56
|
-
|
55
|
+
description: |-
|
56
|
+
Turkish character support for core ruby methods \
|
57
|
+
like String#upcase, String#gsub, String#match, Array#sort, and etc...)
|
57
58
|
email:
|
58
59
|
- sbagdat@gmail.com
|
59
60
|
executables: []
|
@@ -61,7 +62,9 @@ extensions: []
|
|
61
62
|
extra_rdoc_files: []
|
62
63
|
files:
|
63
64
|
- ".gitignore"
|
65
|
+
- ".hound.yml"
|
64
66
|
- ".rspec"
|
67
|
+
- ".rubocop.yml"
|
65
68
|
- ".travis.yml"
|
66
69
|
- Gemfile
|
67
70
|
- LICENSE.txt
|
@@ -70,10 +73,10 @@ files:
|
|
70
73
|
- lib/turkish_support.rb
|
71
74
|
- lib/turkish_support/array_methods.rb
|
72
75
|
- lib/turkish_support/constants.rb
|
73
|
-
- lib/turkish_support/
|
74
|
-
- lib/turkish_support/string_helpers.rb
|
76
|
+
- lib/turkish_support/helpers.rb
|
75
77
|
- lib/turkish_support/string_methods.rb
|
76
78
|
- lib/turkish_support/version.rb
|
79
|
+
- spec/helpers_spec.rb
|
77
80
|
- spec/spec_helper.rb
|
78
81
|
- spec/turkish_support_spec.rb
|
79
82
|
- turkish_support.gemspec
|
@@ -92,16 +95,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
95
|
version: 2.0.0
|
93
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
97
|
requirements:
|
95
|
-
- - "
|
98
|
+
- - ">"
|
96
99
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
100
|
+
version: 1.3.1
|
98
101
|
requirements: []
|
99
102
|
rubyforge_project:
|
100
103
|
rubygems_version: 2.4.5
|
101
104
|
signing_key:
|
102
105
|
specification_version: 4
|
103
|
-
summary: Turkish character support for
|
106
|
+
summary: Turkish character support for core ruby methods.
|
104
107
|
test_files:
|
108
|
+
- spec/helpers_spec.rb
|
105
109
|
- spec/spec_helper.rb
|
106
110
|
- spec/turkish_support_spec.rb
|
107
111
|
has_rdoc:
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module TurkishSupport
|
2
|
-
refine String do
|
3
|
-
DESTRUCTIVE_STRING_METHODS.each do |method_name|
|
4
|
-
define_method "#{method_name}!" do
|
5
|
-
send(:replace, eval("#{method_name}"))
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
refine Array do
|
11
|
-
DESTRUCTIVE_ARRAY_METHODS.each do |method_name|
|
12
|
-
define_method "#{method_name}!" do
|
13
|
-
send(:replace, eval("#{method_name}"))
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module TurkishSupport
|
2
|
-
refine String do
|
3
|
-
def change_chars_for_upcase
|
4
|
-
tr UNSUPPORTED_DOWNCASE_CHARS, UNSUPPORTED_UPCASE_CHARS
|
5
|
-
end
|
6
|
-
|
7
|
-
def change_chars_for_downcase
|
8
|
-
tr UNSUPPORTED_UPCASE_CHARS, UNSUPPORTED_DOWNCASE_CHARS
|
9
|
-
end
|
10
|
-
|
11
|
-
def change_chars_for_capitalize
|
12
|
-
[chr.change_chars_for_upcase.send(:upcase), self[1..-1].downcase].join
|
13
|
-
end
|
14
|
-
|
15
|
-
def unsupported_downcase?
|
16
|
-
UNSUPPORTED_DOWNCASE_CHARS.include? chr
|
17
|
-
end
|
18
|
-
|
19
|
-
def unsupported_upcase?
|
20
|
-
UNSUPPORTED_UPCASE_CHARS.include? chr
|
21
|
-
end
|
22
|
-
|
23
|
-
def unsupported?
|
24
|
-
unsupported_upcase? or unsupported_downcase?
|
25
|
-
end
|
26
|
-
|
27
|
-
def transform_regex
|
28
|
-
MATCH_TRANSFORMATIONS.each { |k, v| self.gsub!(k, v) }
|
29
|
-
self.force_encoding("UTF-8")
|
30
|
-
end
|
31
|
-
|
32
|
-
def conjuction?
|
33
|
-
CONJUCTIONS.include? self
|
34
|
-
end
|
35
|
-
|
36
|
-
def start_with_a_special_char?
|
37
|
-
self =~ /^[#{SPECIAL_CHARS}]/
|
38
|
-
end
|
39
|
-
|
40
|
-
alias_method :words, :split
|
41
|
-
end
|
42
|
-
end
|