super_tailer 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a2c2976aa080dc687b158bb22750d89ad36075f
4
- data.tar.gz: 3f4742773010bb9b880652f0bf8b407f02391478
3
+ metadata.gz: 837a44a964c0912fd0ee847cb59aeb05291b5ac4
4
+ data.tar.gz: 21b93923f54d4aa28fe669fa5e4f4ebe8fecc254
5
5
  SHA512:
6
- metadata.gz: 5758ccf430e5818a735bc0c9dc14a0c51fbbe92ba6b6135a662e482d61f595be9fc95eee354ce96f41ebfea1c74b1ead3e0414cd106254a98a6c0e0c96184b01
7
- data.tar.gz: 68d6e1fee9d719d2b5444df98a1a786e8a5ee24bb554e51742d31d2526c08a3e76eecb35bd08ed4b07f08099446fb1c67ecf39a4890f8f007644825e71078d7d
6
+ metadata.gz: 74c866af65c35b5039069951ebae961f4b85a90c110cf5bd59c57bbde33982fb2e54d281b21a54b0f808c60f3b75b89c9b84fbaf1dca81582f28ddd9dcde57ea
7
+ data.tar.gz: 8b61dffaa8d2ec80200e965f2ba09f7a6183030e634bad95673ad415dc798166c060adb3984280f60f0a02ec103ebab7cf32c9d63d02e85568223aa51586270a
@@ -1,9 +1,10 @@
1
1
  module SuperTailer
2
2
  class Base
3
3
  attr_accessor :origin
4
+ attr_accessor :seek_start
4
5
  attr_accessor :sleep_interval
5
6
 
6
- def initialize(file, sleep_interval = 0.1)
7
+ def initialize(file, sleep_interval = 0.1, seek_start = File::SEEK_END)
7
8
  self.origin = initialize_origin(file)
8
9
  self.sleep_interval = sleep_interval
9
10
  end
@@ -12,7 +13,7 @@ module SuperTailer
12
13
 
13
14
  def initialize_origin(file_path)
14
15
  File.new(file_path).tap do |file|
15
- file.seek(0, File::SEEK_END)
16
+ file.seek(0, seek_start)
16
17
  end
17
18
  end
18
19
 
@@ -1,7 +1,7 @@
1
1
  require 'timers'
2
2
 
3
3
  module SuperTailer
4
- class ExpireWhenIdle < SuperTailer::Tail
4
+ class ExpireWhenIdle < SuperTailer::Base
5
5
  def watch(timeout)
6
6
  watching = { enable: true }
7
7
  chrono = timer(timeout) { watching[:enable] = false }
@@ -1,3 +1,3 @@
1
1
  module SuperTailer
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_tailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrerocker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers