epitools 0.5.67 → 0.5.68

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
  SHA1:
3
- metadata.gz: f2271ae81c6b0b63bc52231e263ed3eaf4d556cf
4
- data.tar.gz: d94254c24fe5d6bedb163adbfedea3870f249b05
3
+ metadata.gz: cf33dd375363508818c6ac7d6c1e68fce555e684
4
+ data.tar.gz: fe79ff4bb2eba59fb018c39f3b0e85ccfbb204bf
5
5
  SHA512:
6
- metadata.gz: 45d4cdf94d0425dd4e05a6906872ecb01470bff766c59608e5faa8d8cc4d2fb9fb4716b88278e073f51544502f7966b530867faedd481098f654c10a5a7fb7ad
7
- data.tar.gz: f02a980973a1c1543101e1ef2ae3dbe4618aa61f590bf875c7285388fe3485e50bc720d3895590846c3045fd24541ec062dd9914a1dba20cf5cbc52cc3a480fa
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 filessytem -- like File, Dir, Pathname, and FileUtils all rolled into one)
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-2013 epitron
39
+ Copyright (c) 2009-2015 epitron
40
40
 
41
41
  == License
42
42
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.67
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
- # Chain 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 all the procs' return values.
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
@@ -630,6 +630,7 @@ class Path
630
630
  def ls; Path[File.join(path, "*")]; end
631
631
 
632
632
  def ls_r; Path[File.join(path, "**/*")]; end
633
+ alias_method :ls_R, :ls_r
633
634
 
634
635
  def ls_dirs
635
636
  ls.select(&:dir?)
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.67
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-01-13 00:00:00.000000000 Z
11
+ date: 2015-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec