signed_multiset 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +17 -2
- data/lib/signed_multiset.rb +4 -9
- data/test/signed_multiset_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe13f4864a194a40086fa0e4664bdb5eac7240b2
|
4
|
+
data.tar.gz: 4979034474a5bea562d031e381af7f91951e7cf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40240d2831373f64a42e72a8db05a4898fd15e5280802e80fd19f0ad15d870e60ae87165365ac42e91b6483a4ea4520a4762d349db4f5ae1fdd7baa210c26760
|
7
|
+
data.tar.gz: 737f83b86065beeba47cc296e278477ed8fd5ef68c52e7b03af9042446e189fb8655cd6e537301b28ea23c8beaa1e688e66907c9e132d632d5994fe3716992b3
|
data/.travis.yml
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
bundler_args: --without yard pry
|
2
4
|
rvm:
|
3
|
-
- 1.9.2
|
4
5
|
- 1.9.3
|
5
|
-
- 2.0.0
|
6
|
+
- 2.0.0
|
7
|
+
- 2.1.0
|
8
|
+
- ruby-head
|
9
|
+
- rbx
|
10
|
+
- rbx-2
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- rvm: jruby-19mode
|
14
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
15
|
+
- rvm: jruby-head
|
16
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
17
|
+
allow_failure:
|
18
|
+
- rvm: ruby-head
|
19
|
+
- rvm: jruby-head
|
20
|
+
fast_finish: true
|
data/lib/signed_multiset.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
class SignedMultiset
|
2
|
-
VERSION = "0.2.
|
2
|
+
VERSION = "0.2.1"
|
3
3
|
|
4
4
|
include Enumerable
|
5
5
|
include Comparable
|
6
6
|
|
7
|
+
attr_reader :entries
|
8
|
+
|
7
9
|
# Create a new SignedMultiset instance.
|
8
10
|
#
|
9
11
|
# @param object [Enumerable, nil] An array of keys, or key-muliplicity pairs.
|
10
12
|
def initialize(*args)
|
13
|
+
@entries = {}
|
11
14
|
obj = args.count == 1 ? args.first : args
|
12
15
|
if obj.respond_to?(:each)
|
13
16
|
obj.each { |k, v| increment(k, v || 1) }
|
@@ -191,14 +194,6 @@ class SignedMultiset
|
|
191
194
|
"<#{self.class} #{to_s}>"
|
192
195
|
end
|
193
196
|
|
194
|
-
private
|
195
|
-
|
196
|
-
# Get the key-multiplicity pairs (even those with zero multiplicities).
|
197
|
-
#
|
198
|
-
# @return [Hash]
|
199
|
-
def entries
|
200
|
-
@entries ||= {}
|
201
|
-
end
|
202
197
|
end
|
203
198
|
|
204
199
|
def SignedMultiset(input)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signed_multiset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lewis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|