epitools 0.5.123 → 0.5.124
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/VERSION +1 -1
- data/lib/epitools/numwords.rb +1 -0
- data/lib/epitools/path.rb +19 -0
- data/lib/epitools/wm.rb +17 -0
- data/spec/core_ext_spec.rb +38 -0
- data/spec/path_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ccc18312dec46b4af2100239be52ac5db3ce4aaf7c3cbdb8a325ec656fff6f9
|
4
|
+
data.tar.gz: 2e68f10fc0006ef3dec61493d8950103a24e05f1ed24afc967bcfdb38e758282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d65bbb00c1359e587f18399dbd952386f6beceae05c04201c8d0e97aec735c70b573cc337f56657ac372334202081b4c2c568a7753bc79f1e52f347fea1786e0
|
7
|
+
data.tar.gz: 07c4623c4bd5217ebdce11fcb373ad27406e0d5d6eb8c0bd8f6c0e087c39c281a1146b757b9606da37026d01c791d8462bf62966ace409535f7f21e7d1d4b2a5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.124
|
data/lib/epitools/numwords.rb
CHANGED
data/lib/epitools/path.rb
CHANGED
@@ -1110,6 +1110,25 @@ class Path
|
|
1110
1110
|
}
|
1111
1111
|
end
|
1112
1112
|
|
1113
|
+
#
|
1114
|
+
# Path.mkcd(path) creates a path if it doesn't exist, and changes to it (temporarily, if a block is provided)
|
1115
|
+
#
|
1116
|
+
def self.mkcd(path, &block)
|
1117
|
+
path = path.to_Path unless path.is_a? Path
|
1118
|
+
path.mkdir_p unless path.exists?
|
1119
|
+
|
1120
|
+
raise "Error: #{path} couldn't be created." unless path.dir?
|
1121
|
+
|
1122
|
+
self.cd(path, &block)
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
#
|
1126
|
+
# Path.mkcd(self)
|
1127
|
+
#
|
1128
|
+
def mkcd(&block)
|
1129
|
+
Path.mkcd(self, &block)
|
1130
|
+
end
|
1131
|
+
|
1113
1132
|
def cp_r(dest)
|
1114
1133
|
FileUtils.cp_r(path, dest) #if Path[dest].exists?
|
1115
1134
|
dest
|
data/lib/epitools/wm.rb
CHANGED
@@ -106,6 +106,23 @@ module WM
|
|
106
106
|
system "wmctrl", "-i", "-a", window_id
|
107
107
|
end
|
108
108
|
|
109
|
+
def maximized?
|
110
|
+
end
|
111
|
+
|
112
|
+
def maximize!
|
113
|
+
system "wmctrl", "-i", "-a", window_id
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
def unmazimize!
|
118
|
+
end
|
119
|
+
|
120
|
+
def minimized?
|
121
|
+
end
|
122
|
+
|
123
|
+
def minimize!
|
124
|
+
end
|
125
|
+
|
109
126
|
#
|
110
127
|
# string is made up of regular text, plus <>'d keypresses
|
111
128
|
# eg: "Hello<Ctrl-T><Ctrl-L><Ctrl-Shift-K><Return>!!!"
|
data/spec/core_ext_spec.rb
CHANGED
@@ -147,6 +147,44 @@ describe Class do
|
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
150
|
+
it "traces messages (when $DEBUG is set)" do
|
151
|
+
$DEBUG = true
|
152
|
+
|
153
|
+
class TestButt
|
154
|
+
trace_messages_to :a, :b, :c
|
155
|
+
|
156
|
+
def a(x)
|
157
|
+
end
|
158
|
+
|
159
|
+
def b(x)
|
160
|
+
end
|
161
|
+
|
162
|
+
def c(x,y,z,&block)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
class ButtTest
|
167
|
+
trace_messages_to :*
|
168
|
+
|
169
|
+
def d
|
170
|
+
end
|
171
|
+
|
172
|
+
def e
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
t = TestButt.new
|
177
|
+
t.a(1)
|
178
|
+
t.b(2)
|
179
|
+
t.c(3,4,5) { :butt }
|
180
|
+
|
181
|
+
b = ButtTest.new
|
182
|
+
b.a
|
183
|
+
b.b
|
184
|
+
|
185
|
+
$DEBUG = false
|
186
|
+
end
|
187
|
+
|
150
188
|
end
|
151
189
|
|
152
190
|
|
data/spec/path_spec.rb
CHANGED
@@ -348,6 +348,25 @@ describe Path do
|
|
348
348
|
lambda { tmp2.mkdir_p }.should_not raise_error
|
349
349
|
end
|
350
350
|
|
351
|
+
it "mkcds" do
|
352
|
+
tmp = Path.tmpdir
|
353
|
+
tmp.dir?.should == true
|
354
|
+
tmp.rm
|
355
|
+
tmp.exists?.should == false
|
356
|
+
|
357
|
+
Path.mkcd(tmp) do
|
358
|
+
Path.pwd.path.should == tmp.path
|
359
|
+
end
|
360
|
+
|
361
|
+
tmp.rm
|
362
|
+
|
363
|
+
tmp.mkcd do
|
364
|
+
Path.pwd.path.should == tmp.path
|
365
|
+
end
|
366
|
+
|
367
|
+
tmp.rm
|
368
|
+
end
|
369
|
+
|
351
370
|
it "has classmethods" do
|
352
371
|
path = Path.tmpfile
|
353
372
|
|
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.124
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|