nyuudou 1.1.0 → 1.2.0

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
  SHA1:
3
- metadata.gz: 3acda42ffb3fe7dd998f7e71f872aae378995e73
4
- data.tar.gz: 63ec91c7343a5840590899f92dfc61c591864e4b
3
+ metadata.gz: 8ede8a541de37409a70c871b19f467af54f1732b
4
+ data.tar.gz: 117cab9caad47002c914226cd2d3f68466cc6126
5
5
  SHA512:
6
- metadata.gz: 464fefff7e2b05f1ef4bcda151d3bce853d0d90f6ec6d2dc9f4c36b60513567dba2cdf3e40c74b389d5061c55a08a306055b47f1dec76749db5a20eb468aa938
7
- data.tar.gz: 618a93adc4b81b9da2180034474b20ec297589cc7d8c844d5823cad6ff0f5b6084e4df2944fc45992154057434aa571a4dda6af2a91d201d038be5e55b4c951e
6
+ metadata.gz: 5c726d0f27ad212de4831533a2fcfae7f46ae66aaf67146a5dd042a2ed22d0ede1f3a9baec3bf578f86365615f038e5148eac5cca93f51c3b2d457c6bb660b1e
7
+ data.tar.gz: db9c4f9f1476ddd635a509f7ecf9e100efb234e64ce94d36cf8b88f22bcfc4b44ce8fe50116669f29c29fffe7b2d3747d1cec0a1e60fab07402ee5b7cac48edb
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 tmp1024
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 all
13
+ 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 THE
21
+ SOFTWARE.
22
+
data/README.md CHANGED
@@ -32,4 +32,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/tmp102
32
32
 
33
33
  ## License
34
34
 
35
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
35
+ The gem is available as open source under the terms of the [MIT License](https://github.com/tmp1024/nyuudou/blob/master/LICENSE).
@@ -40,4 +40,25 @@ class Array
40
40
  }
41
41
  self
42
42
  end
43
+
44
+ def insertion_sort
45
+ ary = self.dup
46
+ (1...ary.length).each { |i|
47
+ (1..i).reverse_each { |j|
48
+ break if ary[j-1] <= ary[j]
49
+ ary[j-1], ary[j] = ary[j], ary[j-1]
50
+ }
51
+ }
52
+ ary
53
+ end
54
+
55
+ def insertion_sort!
56
+ (1...self.length).each { |i|
57
+ (1..i).reverse_each { |j|
58
+ break if self[j-1] <= self[j]
59
+ self[j-1], self[j] = self[j], self[j-1]
60
+ }
61
+ }
62
+ self
63
+ end
43
64
  end
@@ -1,3 +1,3 @@
1
1
  module Nyuudou
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyuudou
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tmp1024
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".travis.yml"
64
64
  - Gemfile
65
+ - LICENSE
65
66
  - LICENSE.txt
66
67
  - README.md
67
68
  - Rakefile