epitools 0.5.103 → 0.5.105
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/README.rdoc +1 -1
- data/Rakefile +2 -2
- data/TODO +1 -1
- data/VERSION +1 -1
- data/lib/epitools.rb +1 -1
- data/lib/epitools/colored.rb +25 -25
- data/lib/epitools/core_ext/enumerable.rb +1 -1
- data/lib/epitools/core_ext/file.rb +6 -2
- data/lib/epitools/core_ext/hash.rb +43 -29
- data/lib/epitools/core_ext/misc.rb +21 -1
- data/lib/epitools/core_ext/object.rb +19 -19
- data/lib/epitools/core_ext/truthiness.rb +5 -5
- data/lib/epitools/daemonize.rb +1 -1
- data/lib/epitools/hexdump.rb +1 -1
- data/lib/epitools/iter.rb +26 -26
- data/lib/epitools/lcs.rb +3 -3
- data/lib/epitools/mimemagic.rb +7 -7
- data/lib/epitools/niceprint.rb +18 -18
- data/lib/epitools/numwords.rb +34 -34
- data/lib/epitools/path.rb +7 -0
- data/lib/epitools/permutations.rb +9 -9
- data/lib/epitools/pretty_backtrace.rb +11 -11
- data/lib/epitools/progressbar.rb +7 -7
- data/lib/epitools/rails.rb +2 -2
- data/lib/epitools/rash.rb +16 -16
- data/lib/epitools/ratio.rb +1 -1
- data/lib/epitools/sys.rb +47 -47
- data/lib/epitools/trie.rb +4 -4
- data/lib/epitools/typed_struct.rb +5 -5
- data/lib/epitools/wm.rb +6 -6
- data/lib/epitools/zopen.rb +2 -2
- data/spec/autoreq_spec.rb +5 -5
- data/spec/browser_spec.rb +1 -1
- data/spec/colored_spec.rb +5 -5
- data/spec/core_ext_spec.rb +1 -1
- data/spec/histogram_spec.rb +3 -3
- data/spec/iter_spec.rb +16 -16
- data/spec/lcs_spec.rb +5 -5
- data/spec/numwords_spec.rb +8 -8
- data/spec/permutations_spec.rb +9 -9
- data/spec/rash_spec.rb +7 -7
- data/spec/ratio_spec.rb +5 -5
- data/spec/sys_spec.rb +6 -6
- data/spec/term_spec.rb +7 -7
- data/spec/typed_struct_spec.rb +5 -5
- data/spec/wm_spec.rb +4 -4
- data/spec/zopen_spec.rb +11 -11
- metadata +2 -2
data/spec/term_spec.rb
CHANGED
@@ -15,14 +15,14 @@ describe Term do
|
|
15
15
|
#puts "columns"
|
16
16
|
#puts table.by_columns :border=>true
|
17
17
|
#puts "rows"
|
18
|
-
#puts table.by_rows
|
18
|
+
#puts table.by_rows
|
19
19
|
puts table.by_rows
|
20
20
|
|
21
21
|
table.by_columns.should_not be_nil
|
22
22
|
table.by_rows.should_not be_nil
|
23
23
|
|
24
24
|
table.border = true
|
25
|
-
|
25
|
+
|
26
26
|
table.by_columns.should_not be_nil
|
27
27
|
table.by_rows.should_not be_nil
|
28
28
|
|
@@ -37,22 +37,22 @@ describe Term do
|
|
37
37
|
# end
|
38
38
|
|
39
39
|
# Term::Table[
|
40
|
-
# [1,2,3],
|
41
|
-
# [4,5,6]
|
40
|
+
# [1,2,3],
|
41
|
+
# [4,5,6]
|
42
42
|
# ]
|
43
|
-
|
43
|
+
|
44
44
|
table = Term::Table.new
|
45
45
|
table.rows = [ [1,2,3], [4,5,6] ]
|
46
46
|
table.rows << [1,2,3]
|
47
47
|
table.rows << [4,5,6]
|
48
48
|
table.add_row [1,2,3,4,5]
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
it "tables nothing" do
|
52
52
|
table = Term::Table.new []
|
53
53
|
lambda { table.by_rows }.should_not raise_error
|
54
54
|
lambda { table.by_columns }.should_not raise_error
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
end
|
58
58
|
|
data/spec/typed_struct_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'epitools'
|
2
2
|
|
3
3
|
describe TypedStruct do
|
4
|
-
|
4
|
+
|
5
5
|
it "works" do
|
6
6
|
t = TypedStruct["a:int b c:boolean d:timestamp"].new
|
7
7
|
|
@@ -10,7 +10,7 @@ describe TypedStruct do
|
|
10
10
|
t.b = "111"; t.b.should == "111"
|
11
11
|
t.c = "yes"; t.c.should == true
|
12
12
|
#t.c?.should == true
|
13
|
-
end
|
13
|
+
end
|
14
14
|
|
15
15
|
it "compact syntaxes" do
|
16
16
|
t = TypedStruct["a,b:int c,d:bool"].new(1,2,1,0)
|
@@ -36,8 +36,8 @@ describe TypedStruct do
|
|
36
36
|
lambda { ts.new a: 1, b: 2 }.should raise_error
|
37
37
|
|
38
38
|
ts = TypedStruct["a:int -"]
|
39
|
-
lambda {
|
40
|
-
t = ts.new a: 1, b: 2
|
39
|
+
lambda {
|
40
|
+
t = ts.new a: 1, b: 2
|
41
41
|
t.a.should == 1
|
42
42
|
lambda { t.b }.should raise_error
|
43
43
|
}.should_not raise_error
|
@@ -46,6 +46,6 @@ describe TypedStruct do
|
|
46
46
|
it "can't use wildcard and drop unknown at once" do
|
47
47
|
lambda { TypedStruct["a:int - *"].new }.should raise_error
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
end
|
51
51
|
|
data/spec/wm_spec.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'epitools'
|
2
2
|
|
3
3
|
describe WM do
|
4
|
-
|
4
|
+
|
5
5
|
it "works" do
|
6
6
|
WM.windows.any?.should == true
|
7
7
|
WM.processes.any?.should == true
|
8
8
|
WM.desktops.any?.should == true
|
9
|
-
|
9
|
+
|
10
10
|
#WM.current_desktop.is_a?(WM::Desktop).should == true
|
11
11
|
WM.current_desktop.nil? == false
|
12
|
-
end
|
12
|
+
end
|
13
13
|
|
14
14
|
def to_events(keys)
|
15
15
|
WM::Window.new.keys_to_events(keys)
|
@@ -27,6 +27,6 @@ describe WM do
|
|
27
27
|
sublime_window = WM.current_desktop.windows.select{|w| w.title =~ /wm_spec\.rb.+Sublime/ }.first
|
28
28
|
sublime_window.send_keys('<Ctrl-`>print("Hello from send_keys()!")<Return>')
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
end
|
32
32
|
|
data/spec/zopen_spec.rb
CHANGED
@@ -2,25 +2,25 @@ require 'epitools/zopen'
|
|
2
2
|
require 'tempfile'
|
3
3
|
|
4
4
|
describe "zopen()" do
|
5
|
-
|
5
|
+
|
6
6
|
before :all do
|
7
7
|
@data = ("x"*100+"\n") * 1000
|
8
8
|
@tmp = Tempfile.new("zopen_spec")
|
9
|
-
|
9
|
+
|
10
10
|
@plainfile = @tmp.path
|
11
|
-
@gzfile = "#{@tmp.path}.gz"
|
11
|
+
@gzfile = "#{@tmp.path}.gz"
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
after :all do
|
15
15
|
File.unlink @plainfile
|
16
16
|
File.unlink @gzfile
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
it "writes/reads a gz" do
|
20
20
|
f = zopen(@gzfile, "w")
|
21
21
|
f.write(@data).should == @data.size
|
22
22
|
f.close
|
23
|
-
|
23
|
+
|
24
24
|
f = zopen(@gzfile, "r")
|
25
25
|
f.read.should == @data
|
26
26
|
f.close
|
@@ -28,22 +28,22 @@ describe "zopen()" do
|
|
28
28
|
|
29
29
|
it "writes/reads non-gz files" do
|
30
30
|
zopen(@plainfile, "w") {|f| f.write(@data) }
|
31
|
-
|
31
|
+
|
32
32
|
# readstyle
|
33
33
|
File.read(@plainfile).should == zopen(@plainfile).read
|
34
|
-
|
34
|
+
|
35
35
|
# blockstyle
|
36
36
|
open(@plainfile){|f| f.read }.should == zopen(@plainfile){|f| f.read }
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
it "is enumerable" do
|
40
40
|
zopen(@gzfile) do |f|
|
41
41
|
f.respond_to?(:each).should == true
|
42
42
|
f.respond_to?(:map).should == true
|
43
43
|
f.respond_to?(:inject).should == true
|
44
|
-
|
44
|
+
|
45
45
|
f.all?{|line| line =~ /^x+$/ }
|
46
|
-
end
|
46
|
+
end
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.105
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|