duct_tape 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/duct_tape.gemspec +6 -6
- data/lib/duct_tape.rb +4 -1
- data/lib/ext/kernel.rb +1 -0
- data/spec/algorithms/containers/heap_spec.rb +24 -22
- data/spec/algorithms/containers/priority_queue_spec.rb +24 -22
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08305210421c9be84becfc9eda231ac12606758c
|
4
|
+
data.tar.gz: 5e6904290bdea44e2b45cf19defbdfb5f4080fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf2b444c2ff61ee4e7bd577219ca877efe8d57b5a37e8cb6941e5325db46f1a94ffeb34990a60e13f39458d2ae109d471fbaa96f8d32a875365e56fb9b1fcba
|
7
|
+
data.tar.gz: 35959e82fc3c530a4a9d96096d3f405f9ac80e18e5dd4198443bb7b4388bbf9d2f80a23ba456a9f63bad12685b46dcd365638676bb05f94361914e1c95246072
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/duct_tape.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: duct_tape 0.5.
|
5
|
+
# stub: duct_tape 0.5.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "duct_tape"
|
9
|
-
s.version = "0.5.
|
9
|
+
s.version = "0.5.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Tim Rodriguez"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-02-20"
|
15
15
|
s.description = "A general-purpose utility library for Ruby"
|
16
16
|
s.email = ["tw.rodriguez@gmail.com"]
|
17
17
|
s.extra_rdoc_files = [
|
@@ -81,7 +81,7 @@ Gem::Specification.new do |s|
|
|
81
81
|
s.specification_version = 4
|
82
82
|
|
83
83
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
84
|
-
s.add_runtime_dependency(%q<facets>, ["
|
84
|
+
s.add_runtime_dependency(%q<facets>, ["~> 2.9.3"])
|
85
85
|
s.add_runtime_dependency(%q<backports>, [">= 0"])
|
86
86
|
s.add_runtime_dependency(%q<bundler>, [">= 0"])
|
87
87
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
@@ -90,7 +90,7 @@ Gem::Specification.new do |s|
|
|
90
90
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
91
91
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
92
92
|
else
|
93
|
-
s.add_dependency(%q<facets>, ["
|
93
|
+
s.add_dependency(%q<facets>, ["~> 2.9.3"])
|
94
94
|
s.add_dependency(%q<backports>, [">= 0"])
|
95
95
|
s.add_dependency(%q<bundler>, [">= 0"])
|
96
96
|
s.add_dependency(%q<yard>, [">= 0"])
|
@@ -100,7 +100,7 @@ Gem::Specification.new do |s|
|
|
100
100
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
101
101
|
end
|
102
102
|
else
|
103
|
-
s.add_dependency(%q<facets>, ["
|
103
|
+
s.add_dependency(%q<facets>, ["~> 2.9.3"])
|
104
104
|
s.add_dependency(%q<backports>, [">= 0"])
|
105
105
|
s.add_dependency(%q<bundler>, [">= 0"])
|
106
106
|
s.add_dependency(%q<yard>, [">= 0"])
|
data/lib/duct_tape.rb
CHANGED
@@ -14,7 +14,10 @@ require 'facets/regexp'
|
|
14
14
|
#########################################
|
15
15
|
# Can't require facets/string directly because there are no guards
|
16
16
|
# against re-defining certain functions
|
17
|
-
|
17
|
+
begin
|
18
|
+
require 'facets/kernel/require_relative'
|
19
|
+
rescue LoadError
|
20
|
+
end
|
18
21
|
|
19
22
|
require 'facets/string/acronym.rb'
|
20
23
|
require 'facets/string/align.rb'
|
data/lib/ext/kernel.rb
CHANGED
@@ -447,6 +447,7 @@ module Kernel
|
|
447
447
|
cmds = [
|
448
448
|
%<free -ob %s | grep "Mem:" | awk '{print $2}'>, # Linux
|
449
449
|
%<sysctl -a %s | grep hw.physmem>, # FreeBSD, Mac OSX
|
450
|
+
%<sysctl -a %s | grep hw.memsize>, # Mac OSX Yosemite
|
450
451
|
%<sysinfo %s | grep -i "bytes\\s*free" | grep -o "[0-9]*)" | grep -o "[0-9]*">, # Haiku
|
451
452
|
%<top -d1 -q %s | grep "Mem" | awk '{print $2}'>, # Solaris
|
452
453
|
%<systeminfo %s | findstr /C:"Total Physical Memory">, # Windows
|
@@ -1,31 +1,33 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper.rb")
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
if defined? Containers::Heap
|
4
|
+
#
|
5
|
+
# Containers::Heap#to_a
|
6
|
+
#
|
7
|
+
describe Containers::Heap, "#to_a" do
|
8
|
+
it "should have the method defined" do
|
9
|
+
expect(Containers::Heap.method_defined?(:to_a)).to be(true)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "remains unchanged" do
|
13
|
+
# TODO
|
14
|
+
end
|
10
15
|
|
11
|
-
|
12
|
-
# TODO
|
16
|
+
pending "More tests"
|
13
17
|
end
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
#
|
20
|
+
# Containers::Heap#each
|
21
|
+
#
|
22
|
+
describe Containers::Heap, "#each" do
|
23
|
+
it "should have the method defined" do
|
24
|
+
expect(Containers::Heap.method_defined?(:each)).to be(true)
|
25
|
+
end
|
17
26
|
|
18
|
-
|
19
|
-
#
|
20
|
-
|
21
|
-
describe Containers::Heap, "#each" do
|
22
|
-
it "should have the method defined" do
|
23
|
-
expect(Containers::Heap.method_defined?(:each)).to be(true)
|
24
|
-
end
|
27
|
+
it "remains unchanged" do
|
28
|
+
# TODO
|
29
|
+
end
|
25
30
|
|
26
|
-
|
27
|
-
# TODO
|
31
|
+
pending "More tests"
|
28
32
|
end
|
29
|
-
|
30
|
-
pending "More tests"
|
31
33
|
end
|
@@ -1,31 +1,33 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper.rb")
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
if defined? Containers::PriorityQueue
|
4
|
+
#
|
5
|
+
# Containers::PriorityQueue#to_a
|
6
|
+
#
|
7
|
+
describe Containers::PriorityQueue, "#to_a" do
|
8
|
+
it "should have the method defined" do
|
9
|
+
expect(Containers::PriorityQueue.method_defined?(:to_a)).to be(true)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "remains unchanged" do
|
13
|
+
# TODO
|
14
|
+
end
|
10
15
|
|
11
|
-
|
12
|
-
# TODO
|
16
|
+
pending "More tests"
|
13
17
|
end
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
#
|
20
|
+
# Containers::PriorityQueue#each
|
21
|
+
#
|
22
|
+
describe Containers::PriorityQueue, "#each" do
|
23
|
+
it "should have the method defined" do
|
24
|
+
expect(Containers::PriorityQueue.method_defined?(:each)).to be(true)
|
25
|
+
end
|
17
26
|
|
18
|
-
|
19
|
-
#
|
20
|
-
|
21
|
-
describe Containers::PriorityQueue, "#each" do
|
22
|
-
it "should have the method defined" do
|
23
|
-
expect(Containers::PriorityQueue.method_defined?(:each)).to be(true)
|
24
|
-
end
|
27
|
+
it "remains unchanged" do
|
28
|
+
# TODO
|
29
|
+
end
|
25
30
|
|
26
|
-
|
27
|
-
# TODO
|
31
|
+
pending "More tests"
|
28
32
|
end
|
29
|
-
|
30
|
-
pending "More tests"
|
31
33
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duct_tape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.9.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.9.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -207,3 +207,4 @@ signing_key:
|
|
207
207
|
specification_version: 4
|
208
208
|
summary: A bunch of useful patches for core Ruby classes
|
209
209
|
test_files: []
|
210
|
+
has_rdoc:
|