turkish_support 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf5b94d930d37d61a0712cf5153278d446977829e4a8f6b10f95d0e237953bb3
4
- data.tar.gz: 46bf4bd9b65029b24979315db8a5e0595665e267d9d739530ad9d77d39b2b2ec
3
+ metadata.gz: 21d687b0e2cd2035ebdc1b198340aaa12faa920bc458bc9920a7828215747baf
4
+ data.tar.gz: c2d0ac7f7debf20bbcf50a28ac7758bd721d30ab5cfb68e3fbaac8d97f1c13de
5
5
  SHA512:
6
- metadata.gz: 9b200823ace98c49c4e2c7be185771bb9bb9390ba3b6c693786a99b2caef83bbbd399a6df4af45358087016e45c39e4097f0697c4db6aca31950bdb6990f5f70
7
- data.tar.gz: e6d100a4395f0fc6c792aa2a105a7f9b739b34b97677e25693ab46ab152fffa2f345b9ce3ba14811b20ac27ebf8d3b1fa9b9d4246531fd9ab44d02b1455bb030
6
+ metadata.gz: 772a94afbe5c4d45333438ce3001fe210bd647b55fd0137cc644650da6acc214216fe31a2c074e087ba7791ae4b7e016167ac43d12bb6823f87d947a11aa6809
7
+ data.tar.gz: 78e2537eddc53678bcf432df6fe24bd254c94f01fc04fa9203d599c75306bf9cca3ddc7e3b4f41ea7c837a3b2fca0bdde374118c8c625c3bd7d192f19335015c
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at sbagdat@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -1,12 +1,12 @@
1
1
  module TurkishSupport
2
2
  refine Array do
3
3
  def sort
4
- sort_by do |item|
5
- item.chars.map do |ch|
6
- if ALPHABET.include?(ch)
7
- ASCII_ALPHABET[ch]
8
- else
9
- ch.ord
4
+ if block_given? && any? { |item| !item.is_a? String }
5
+ super
6
+ else
7
+ sort_by do |item|
8
+ item.chars.map do |ch|
9
+ ALPHABET.include?(ch) ? ASCII_ALPHABET[ch] : ch.ord
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module TurkishSupport
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
@@ -650,6 +650,14 @@ module TurkishSupport # rubocop:disable Metrics/ModuleLength
650
650
  it 'sorts array for random conditions' do
651
651
  expect(unsorted_array_for_block_using.sort {|a, b| a[1] <=> b[1]}).to eq(sorted_array_for_block_using)
652
652
  end
653
+
654
+ it 'sorts nested arrays' do
655
+ unsorted_nested_array = [["Şakir", 2], ["İsmet", 0], ["Zeliha", 1]]
656
+ expect(unsorted_nested_array.sort {|a, b| a[1] <=> b[1]})
657
+ .to eq([["İsmet", 0], ["Zeliha", 1], ["Şakir", 2]])
658
+ expect(unsorted_nested_array.sort {|a, b| b[0] <=> a[0]})
659
+ .to eq([["Zeliha", 1], ["Şakir", 2], ["İsmet", 0]])
660
+ end
653
661
  end
654
662
 
655
663
  context 'with destructive version' do
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 2.0.0'
22
22
  spec.add_development_dependency 'bundler', '~> 1.5'
23
- spec.add_development_dependency 'rake'
24
- spec.add_development_dependency 'rspec'
23
+ spec.add_development_dependency 'rake', '~> 12.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.5'
25
25
  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: 1.1.0
4
+ version: 1.1.1
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: 2017-12-22 00:00:00.000000000 Z
11
+ date: 2017-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,30 +28,30 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '12.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '12.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.5'
55
55
  description: |-
56
56
  Turkish character support for core ruby methods
57
57
  like String#upcase, String#gsub, String#match, Array#sort, and etc...)
@@ -66,6 +66,7 @@ files:
66
66
  - ".rspec"
67
67
  - ".rubocop.yml"
68
68
  - ".travis.yml"
69
+ - CODE_OF_CONDUCT.md
69
70
  - Gemfile
70
71
  - LICENSE.txt
71
72
  - README.md