bogo 0.1.14 → 0.1.16

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: 5cfd7e480292d255f881920e0ad55d713e98ca55
4
- data.tar.gz: c163ab2cc687608f257a90f0305d5434cc166ff3
3
+ metadata.gz: 38ce397fddefcad280d33a5ced77a73faa6b4671
4
+ data.tar.gz: 965758fe90de16bb54a17311360b0cadd4f381d8
5
5
  SHA512:
6
- metadata.gz: 50e85630e7c013930b600c64d8a34f4b711289f322b929dfa0609943bb3a784515ab2c7b4e6df8b0cf22deae6260f9cbd1d6d28d6cfe7d5a75f6e3680cf56b21
7
- data.tar.gz: 6546f6dc0bfde10d4c294d3a571d98279cdc054c0d4bf9dd7283a4067b26bd1092511e4749019ab9481466157e8619e684eb4b8e8c4d8c7717c5bfd48f2dfc6d
6
+ metadata.gz: 27a0131bb0b06b70f6595c3f53b3e89cbc7a7d8c44140764ce9c75ab4adba456e9735af9bef89aaaf800fe6070885d7e870aed5be486624183946a1c3ccf5077
7
+ data.tar.gz: 0b4c8a6dd4873fc15358b19ea16ebeccb537f1da8b057626d0a7c281df44b6d4bd0eddcf451bec3fa62f6d4954ba530d599c75864e2cc5d791ad8fde0c60f783
@@ -1,3 +1,6 @@
1
+ ## v0.1.16
2
+ * [EphemeralFile] Add new EphemeralFile class
3
+
1
4
  ## v0.1.14
2
5
  * [PriorityQueue] Add PriorityQueue#include? helper method
3
6
  * [PriorityQueue] Wrap sorting with synchronization
data/README.md CHANGED
@@ -295,5 +295,20 @@ puts q.pop
295
295
 
296
296
  This will print "a" as its score will be higher when popped.
297
297
 
298
+ ## EphemeralFile
299
+
300
+ This is just like a Tempfile (this is just a subclass) except that
301
+ it will delete itself when closed.
302
+
303
+ ```ruby
304
+ require 'bogo'
305
+
306
+ e_file = Bogo::EphemeralFile.new('bogo')
307
+ path = e_file.path
308
+ puts "File exists: #{File.exists?(path)}"
309
+ e_file.close
310
+ puts "File exists: #{File.exists?(path)}"
311
+ ```
312
+
298
313
  # Info
299
314
  * Repository: https://github.com/spox/bogo
@@ -3,6 +3,7 @@ require 'bogo/version'
3
3
  module Bogo
4
4
  autoload :AnimalStrings, 'bogo/animal_strings'
5
5
  autoload :Constants, 'bogo/constants'
6
+ autoload :EphemeralFile, 'bogo/ephemeral_file'
6
7
  autoload :Lazy, 'bogo/lazy'
7
8
  autoload :Memoization, 'bogo/memoization'
8
9
  autoload :PriorityQueue, 'bogo/priority_queue'
@@ -0,0 +1,15 @@
1
+ require 'bogo'
2
+ require 'tempfile'
3
+
4
+ module Bogo
5
+ # Tempfile that will destroy itself when closed
6
+ class EphemeralFile < Tempfile
7
+
8
+ # Override to remove file after close
9
+ def close
10
+ super
11
+ delete
12
+ end
13
+
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
1
  module Bogo
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.1.14')
3
+ VERSION = Gem::Version.new('0.1.16')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -80,6 +80,7 @@ files:
80
80
  - lib/bogo.rb
81
81
  - lib/bogo/animal_strings.rb
82
82
  - lib/bogo/constants.rb
83
+ - lib/bogo/ephemeral_file.rb
83
84
  - lib/bogo/lazy.rb
84
85
  - lib/bogo/memoization.rb
85
86
  - lib/bogo/priority_queue.rb