evt-collection 1.0.0.2 → 1.1.0.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
  SHA256:
3
- metadata.gz: 94c1a5732a69bbfbbfd19f8fb2500bae6063c516ea6198502c7ac93d71b30154
4
- data.tar.gz: 16aebc9429c4616f9a0d75784e6c6fcae71f27eab784b9de911c94719e268b58
3
+ metadata.gz: e40759e369360b8227fd4e37fc25f3336d0bd6ce0a4e4a9b368b8a878d69f39e
4
+ data.tar.gz: 8eb2d63c51b55be8a897534072418dab744144a1f0a1977a14ac278782857cae
5
5
  SHA512:
6
- metadata.gz: b5028258f11acfa0bd8e10b6ebabcc7af629d3320116adf6c0fda793fb6e7f2c4210263f26ea22a17074ee0cfa1cb6112b731431bd4302acff3cacb66b7853fd
7
- data.tar.gz: 62927d8b8a68f96f12420744d6ee09350a43a612b1793851bdc09cc24c4acf60a0a7e4d4621eda02a7f99b81085a69d12e1178115e7a3d7e3b83585ebd1b4cf1
6
+ metadata.gz: 7ebcdd8cb6718c9f5adb545de726d77683922652a49c295cfea8eb557caac46c2e571bb89334e5dcbb93bf09d247bcda7052dcd5154c9eb5234fbddec20dec30
7
+ data.tar.gz: 8c1fb5c00e664ad8d2512bfe8d8f62ca767a76677426da6c3730bad8a22fa998e8a014b4f22f3386e846fefb01e4602d63d366251a7a2764ec30da8a3df54a48
@@ -1,5 +1,4 @@
1
1
  require 'set'
2
2
 
3
3
  require 'collection/set'
4
- require 'collection/refinement'
5
4
  require 'collection/collection'
@@ -2,4 +2,20 @@ module Collection
2
2
  def self.[](type_parameter)
3
3
  Set[type_parameter]
4
4
  end
5
+
6
+ def self.Set(items)
7
+ items = Array(items)
8
+
9
+ raise ArgumentError, "Collection can't be empty" if items.empty?
10
+
11
+ type_parameter = items[0].class
12
+
13
+ set = Set[type_parameter].new
14
+
15
+ items.each do |member|
16
+ set.add member
17
+ end
18
+
19
+ set
20
+ end
5
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.2
4
+ version: 1.1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-29 00:00:00.000000000 Z
11
+ date: 2019-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench
@@ -35,7 +35,6 @@ files:
35
35
  - lib/collection/controls.rb
36
36
  - lib/collection/controls/array.rb
37
37
  - lib/collection/controls/member.rb
38
- - lib/collection/refinement.rb
39
38
  - lib/collection/set.rb
40
39
  homepage: https://github.com/eventide-project/collection
41
40
  licenses:
@@ -56,8 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
55
  - !ruby/object:Gem::Version
57
56
  version: '0'
58
57
  requirements: []
59
- rubyforge_project:
60
- rubygems_version: 2.7.3
58
+ rubygems_version: 3.0.1
61
59
  signing_key:
62
60
  specification_version: 4
63
61
  summary: Type-checked set
@@ -1,19 +0,0 @@
1
- module Collection
2
- refine Object do
3
- def Collection(items)
4
- items = Array(items)
5
-
6
- raise ArgumentError, "Collection can't be empty" if items.empty?
7
-
8
- type_parameter = items[0].class
9
-
10
- set = Set[type_parameter].new
11
-
12
- items.each do |member|
13
- set.add member
14
- end
15
-
16
- set
17
- end
18
- end
19
- end