sorted_set 1.0.0-java → 1.0.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +3 -0
- data/lib/sorted_set.rb +18 -18
- data/sorted_set.gemspec +4 -4
- metadata +3 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 591941e2df94bac0072186aaa04f342c2633c593d58cba73d9a4aded808d422d
|
4
|
+
data.tar.gz: 3aacb139a64c8f1e28523f629f687d1a77764ee7eed9ae24eb1773fd82b51447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7c40ae79da17d29f3ebbc87e16369ca334546e116014b912ea8fa4d54beca59fad36629bd56bca4ea3c77bc64f77c623e0d143b5c1a216ab09b87231bc36f77
|
7
|
+
data.tar.gz: ecd3b585a76e33bda7e79528258c5b308aca2c5b617b8981454c00d0d1f40161bbc58e234c9d2222ccdd3d884c85d5f631bd73fce57968a16919f1ea61d92677
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# SortedSet Changelog
|
2
2
|
|
3
|
+
## 1.0.1 (2020-12-22)
|
4
|
+
|
5
|
+
* Enhancements
|
6
|
+
* Be a no-op library for JRuby, as it has its own version of Set and SortedSet.
|
7
|
+
|
3
8
|
## 1.0.0 (2020-12-22)
|
4
9
|
|
5
10
|
This is the first release of sorted_set as a gem. Here lists the changes since the version bundled with Ruby 2.7.
|
6
11
|
|
7
12
|
* Breaking Changes
|
8
|
-
* The pure-ruby fallback implementation has been removed. It now requires an RBTree library (rbtree
|
13
|
+
* The pure-ruby fallback implementation has been removed. It now requires an RBTree library (rbtree) to install and run.
|
data/README.md
CHANGED
@@ -8,6 +8,9 @@ Every element in SortedSet must be *mutually comparable* to every
|
|
8
8
|
other: comparison with `<=>` must not return nil for any pair of
|
9
9
|
elements. Otherwise ArgumentError will be raised.
|
10
10
|
|
11
|
+
Currently this library does nothing for JRuby, as it has its own
|
12
|
+
version of Set and SortedSet.
|
13
|
+
|
11
14
|
## Installation
|
12
15
|
|
13
16
|
Add this line to your application's Gemfile:
|
data/lib/sorted_set.rb
CHANGED
@@ -1,8 +1,26 @@
|
|
1
1
|
# :markup: markdown
|
2
2
|
|
3
3
|
require 'set'
|
4
|
+
|
5
|
+
return if defined?(JRUBY_VERSION)
|
6
|
+
|
4
7
|
require 'rbtree'
|
5
8
|
|
9
|
+
Object.instance_exec do
|
10
|
+
# Undefine SortedSet for two reasons.
|
11
|
+
#
|
12
|
+
# 1. We should wipe out an existing implementation if Ruby 2.x loads
|
13
|
+
# this library after loading the standard set library which
|
14
|
+
# defines SortedSet.
|
15
|
+
#
|
16
|
+
# 2. Ruby >=3.0 (set >=1.0.0) sets autoload on SortedSet, and we
|
17
|
+
# shouldn't let the following reference to SortedSet fire it
|
18
|
+
# because it would end up requiring this library, leading to
|
19
|
+
# circular require.
|
20
|
+
#
|
21
|
+
remove_const :SortedSet if const_defined?(:SortedSet)
|
22
|
+
end
|
23
|
+
|
6
24
|
##
|
7
25
|
# SortedSet implements a Set whose elements are sorted in ascending
|
8
26
|
# order (according to the return values of their `<=>` methods) when
|
@@ -31,27 +49,9 @@ require 'rbtree'
|
|
31
49
|
# ```
|
32
50
|
|
33
51
|
class SortedSet < Set
|
34
|
-
# Remove the existing implementation in case Ruby 2.x loads this
|
35
|
-
# library after loading the standard set library which defines
|
36
|
-
# SortedSet.
|
37
|
-
if class_variable_defined?(:@@setup)
|
38
|
-
# a hack to shut up warning
|
39
|
-
alias_method :old_init, :initialize
|
40
|
-
|
41
|
-
instance_methods(false).each { |m| remove_method(m) }
|
42
|
-
end
|
43
|
-
|
44
52
|
# Creates a SortedSet. See Set.new for details.
|
45
53
|
def initialize(*args)
|
46
54
|
@hash = RBTree.new
|
47
55
|
super
|
48
56
|
end
|
49
|
-
|
50
|
-
if class_variable_defined?(:@@setup)
|
51
|
-
remove_class_variable(:@@setup)
|
52
|
-
remove_class_variable(:@@mutex) if class_variable_defined?(:@@mutex)
|
53
|
-
|
54
|
-
# a hack to shut up warning
|
55
|
-
remove_method :old_init
|
56
|
-
end
|
57
57
|
end
|
data/sorted_set.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "sorted_set"
|
3
|
-
spec.version = "1.0.
|
3
|
+
spec.version = "1.0.1"
|
4
4
|
spec.authors = ["Akinori MUSHA"]
|
5
5
|
spec.email = ["knu@idaemons.org"]
|
6
6
|
|
@@ -22,11 +22,11 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.bindir = "exe"
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
|
-
|
25
|
+
|
26
26
|
if defined?(JRUBY_VERSION)
|
27
|
-
spec.platform =
|
28
|
-
spec.add_runtime_dependency "rbtree-jruby"
|
27
|
+
spec.platform = "java"
|
29
28
|
else
|
29
|
+
spec.add_runtime_dependency "set", "~> 1.0"
|
30
30
|
spec.add_runtime_dependency "rbtree"
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorted_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
@@ -9,35 +9,7 @@ autorequire:
|
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-12-22 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
15
|
-
requirements:
|
16
|
-
- - "~>"
|
17
|
-
- !ruby/object:Gem::Version
|
18
|
-
version: '1.0'
|
19
|
-
name: set
|
20
|
-
prerelease: false
|
21
|
-
type: :runtime
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
name: rbtree-jruby
|
34
|
-
prerelease: false
|
35
|
-
type: :runtime
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
12
|
+
dependencies: []
|
41
13
|
description: Implements a variant of Set whose elements are sorted in ascending order
|
42
14
|
email:
|
43
15
|
- knu@idaemons.org
|
@@ -62,7 +34,7 @@ licenses:
|
|
62
34
|
metadata:
|
63
35
|
homepage_uri: https://github.com/knu/sorted_set
|
64
36
|
source_code_uri: https://github.com/knu/sorted_set
|
65
|
-
changelog_uri: https://github.com/knu/sorted_set/blob/v1.0.
|
37
|
+
changelog_uri: https://github.com/knu/sorted_set/blob/v1.0.1/CHANGELOG.md
|
66
38
|
post_install_message:
|
67
39
|
rdoc_options: []
|
68
40
|
require_paths:
|