epitools 0.5.67 → 0.5.68
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 +4 -4
- data/VERSION +1 -1
- data/lib/epitools/core_ext/enumerable.rb +21 -0
- data/lib/epitools/core_ext/misc.rb +2 -2
- data/lib/epitools/path.rb +1 -0
- 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: cf33dd375363508818c6ac7d6c1e68fce555e684
|
|
4
|
+
data.tar.gz: fe79ff4bb2eba59fb018c39f3b0e85ccfbb204bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4fa7a7517870a0e5db81be2f9a24996ee09519d97b72b12c041a899cd4ea35beeb3344afcc9ccd7793df3db85a49ccbb5704d6ec29b3b8d23dd65beea9074d06
|
|
7
|
+
data.tar.gz: e893e9ec0cd8a8fafd8918929d56f8ab61a47f818d851504d8e5f4a90aeb517f9a4a59547bd14b76e6b8645773ad0eed955d3983b2efb8580247fcbc3a892066
|
data/README.rdoc
CHANGED
|
@@ -12,14 +12,14 @@ Enhanced base classes: {Enumerable}[http://rdoc.info/github/epitron/epitools/mas
|
|
|
12
12
|
|
|
13
13
|
Extras:
|
|
14
14
|
|
|
15
|
-
* {Path}[http://rdoc.info/github/epitron/epitools/master/Path] (an object-oriented interface to the
|
|
15
|
+
* {Path}[http://rdoc.info/github/epitron/epitools/master/Path] (an object-oriented interface to the filesytem -- it's File, Dir, FileUtils, and Pathname all rolled into one!)
|
|
16
|
+
* {Browser}[http://rdoc.info/github/epitron/epitools/master/Browser] (a fake browser, with a cache, cookies, download progress bars, plus the rest of the mechanize/nokogiri API you know and love)
|
|
17
|
+
* {Colored}[http://rdoc.info/github/epitron/epitools/master/Colored] (enhanced version of defunkt's colored -- adds ANSI colouring methods to String, eg: #red, #green, #light_blue, etc.)
|
|
16
18
|
* {TypedStruct}[http://rdoc.info/github/epitron/epitools/master/TypedStruct] (like Struct, but setters always coerce input to a certain type, eg: boolean, integer, etc.)
|
|
17
19
|
* {WM}[http://rdoc.info/github/epitron/epitools/master/WM] (control/query desktop windows in X. Note: `wmctrl` must be installed)
|
|
18
20
|
* {Sys}[http://rdoc.info/github/epitron/epitools/master/Sys] (system tools -- determine operating system, list processes, view network statistics, etc.)
|
|
19
|
-
* {Colored}[http://rdoc.info/github/epitron/epitools/master/Colored] (enhanced version of defunkt's colored -- adds ANSI colouring methods to String, eg: #red, #green, #light_blue, etc.)
|
|
20
21
|
* {Term}[http://rdoc.info/github/epitron/epitools/master/Term] (a toolbox for making terminal-based scripts -- get terminal size, create tables, etc.)
|
|
21
22
|
* {Iter}[http://rdoc.info/github/epitron/epitools/master/Iter] (a "stable iterator" -- lets you write algorithms that modify the array as you're iterating; good for clustering.)
|
|
22
|
-
* {Browser}[http://rdoc.info/github/epitron/epitools/master/Browser] (a fake browser, with a cache, cookies, download progress bars, plus the rest of the mechanize/nokogiri API you know and love)
|
|
23
23
|
* {Rash}[http://rdoc.info/github/epitron/epitools/master/Rash] (a hash which can have Regexps as keys, so that many input keys can map to a single value.)
|
|
24
24
|
* {Progressbar}[http://rdoc.info/github/epitron/epitools/master/Progressbar] (better than the progressbar gem)
|
|
25
25
|
* {MimeMagic}[http://rdoc.info/github/epitron/epitools/master/MimeMagic] (a port of the Unix `file` utility for automatically recognizing files based on their contents; faster than running `file` on every file if you have to process large batches of files. This is originally from the mimemagic gem by {Daniel Mendler}[https://github.com/minad], and has been slightly modified and enhanced.)
|
|
@@ -36,7 +36,7 @@ or check out the rdoc: http://rdoc.info/github/epitron/epitools/master/frames
|
|
|
36
36
|
|
|
37
37
|
== Copyright
|
|
38
38
|
|
|
39
|
-
Copyright (c) 2009-
|
|
39
|
+
Copyright (c) 2009-2015 epitron
|
|
40
40
|
|
|
41
41
|
== License
|
|
42
42
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.68
|
|
@@ -410,6 +410,27 @@ class Enumerator
|
|
|
410
410
|
end
|
|
411
411
|
|
|
412
412
|
|
|
413
|
+
#
|
|
414
|
+
# Pass in a bunch of indexes to elements in the Enumerator, and this method
|
|
415
|
+
# lazily returns them as a new Enumerator.
|
|
416
|
+
#
|
|
417
|
+
def values_at(*indexes)
|
|
418
|
+
return if indexes.empty?
|
|
419
|
+
|
|
420
|
+
indexes.flatten!
|
|
421
|
+
|
|
422
|
+
indexes = Set.new(indexes)
|
|
423
|
+
|
|
424
|
+
Enumerator.new do |yielder|
|
|
425
|
+
each_with_index do |e,i|
|
|
426
|
+
yielder << e if indexes.delete(i)
|
|
427
|
+
break if indexes.empty?
|
|
428
|
+
end
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
413
434
|
#
|
|
414
435
|
# Concatenates two Enumerators, returning a new Enumerator.
|
|
415
436
|
#
|
|
@@ -62,8 +62,8 @@ end
|
|
|
62
62
|
class Proc
|
|
63
63
|
|
|
64
64
|
#
|
|
65
|
-
#
|
|
66
|
-
# with the same input arguments. The return value is an array of all the procs
|
|
65
|
+
# Join two procs together, returning a new proc. Each proc is executed one after the other,
|
|
66
|
+
# with the same input arguments. The return value is an array of the return values from all the procs.
|
|
67
67
|
#
|
|
68
68
|
# You can use either the .join method, or the overloaded & operator.
|
|
69
69
|
#
|
data/lib/epitools/path.rb
CHANGED
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.68
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- epitron
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|