smoothsort 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/smoothsort/smoothsort.c +5 -6
- data/lib/smoothsort.rb +5 -0
- data/lib/smoothsort/version.rb +1 -0
- metadata +27 -42
- data/LICENSE.txt +0 -20
- data/README.rdoc +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4bcbda8bad522553a47be52b05ab246c9653b8f
|
4
|
+
data.tar.gz: 270c1fd8744574cb49732a99123cb67860eb49e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8443eed1fbc88d43341d4e4e49ed25d367ce54e0dfe10ddd08c5f24c0dfb1180df026549e9f8e8b4f3367be14c31b7dabda795139bec611907bab74a32d4d586
|
7
|
+
data.tar.gz: e820c9a056aadeb2800e5ffbd94882e6feabaee7ec758b8d6efb4a77f653fcb69114b2e2a96f3d85da6003a8f90b3f4c9374517cf486b4334f23d36af2b20127
|
data/ext/smoothsort/smoothsort.c
CHANGED
@@ -150,18 +150,17 @@ void smoothsort(VALUE self, const int N){
|
|
150
150
|
/* element 0 processed */
|
151
151
|
}
|
152
152
|
|
153
|
+
/* Sorts an array in-place using the smoothsort algorithm
|
154
|
+
*
|
155
|
+
* @return [Array] The sorted array
|
156
|
+
*/
|
157
|
+
|
153
158
|
static VALUE smoothsort_ssort_bang(VALUE self) {
|
154
159
|
//return RTEST(rb_funcall(rb_ary_entry(self, 0), rb_intern("<="), 1, rb_ary_entry(self, 1))) ? Qtrue : Qfalse;
|
155
160
|
smoothsort(self, (int)RARRAY_LEN(self));
|
156
161
|
return self;
|
157
162
|
}
|
158
163
|
|
159
|
-
/* static VALUE smoothsort_ssort(VALUE self){ */
|
160
|
-
/* //rb_funcall(self, rb_intern("print"), 1, A); */
|
161
|
-
/* //rb_funcall(self, rb_intern("print"), 1, rb_str_new2("\n")); */
|
162
|
-
/* VALUE clone = rb_funcall(self, rb_intern("clone")) */
|
163
|
-
|
164
|
-
/* } */
|
165
164
|
|
166
165
|
void Init_smoothsort(void) {
|
167
166
|
VALUE module = rb_define_module("Enumerable");
|
data/lib/smoothsort.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'smoothsort/smoothsort'
|
2
|
+
require 'smoothsort/version'
|
2
3
|
|
3
4
|
module Enumerable
|
5
|
+
# Returns an array containing the items in enum sorted, according to their own <=> method,
|
6
|
+
# using the smoothsort algorithm
|
7
|
+
#
|
8
|
+
# @return [Array] The sorted array
|
4
9
|
def ssort
|
5
10
|
a = self.clone
|
6
11
|
a.ssort!
|
@@ -0,0 +1 @@
|
|
1
|
+
VERSION = "1.0.1"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smoothsort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katherine Whitlock
|
@@ -11,49 +11,35 @@ cert_chain: []
|
|
11
11
|
date: 2013-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
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: '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
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rdoc
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.12'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.12'
|
40
|
+
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: minitest
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - '>='
|
@@ -67,48 +53,46 @@ dependencies:
|
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: minitest-reporters
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - '>='
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
61
|
+
version: 0.5.0
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - '>='
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
68
|
+
version: 0.5.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: yard
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- -
|
73
|
+
- - ~>
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
75
|
+
version: '0.7'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- -
|
80
|
+
- - ~>
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
82
|
+
version: '0.7'
|
97
83
|
description: This is an implementation of Djikstra's smoothsort sorting algorithm,
|
98
84
|
usable on Enumerable objects
|
99
|
-
email:
|
85
|
+
email:
|
86
|
+
- toroidalcode@gmail.com
|
100
87
|
executables: []
|
101
88
|
extensions:
|
102
89
|
- ext/smoothsort/extconf.rb
|
103
|
-
extra_rdoc_files:
|
104
|
-
- LICENSE.txt
|
105
|
-
- README.rdoc
|
90
|
+
extra_rdoc_files: []
|
106
91
|
files:
|
107
|
-
- ext/smoothsort/extconf.rb
|
108
|
-
- ext/smoothsort/smoothsort.c
|
109
92
|
- lib/smoothsort.rb
|
110
|
-
-
|
111
|
-
-
|
93
|
+
- lib/smoothsort/version.rb
|
94
|
+
- ext/smoothsort/smoothsort.c
|
95
|
+
- ext/smoothsort/extconf.rb
|
112
96
|
homepage: http://github.com/toroidal-code/smoothsort-rb
|
113
97
|
licenses:
|
114
98
|
- MIT
|
@@ -134,3 +118,4 @@ signing_key:
|
|
134
118
|
specification_version: 4
|
135
119
|
summary: The smoothsort algorithm as a gem
|
136
120
|
test_files: []
|
121
|
+
has_rdoc:
|
data/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2013 Katherine Whitlock
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= smoothsort
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to smoothsort
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2013 Katherine Whitlock. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|