log_parser 1.1.0 → 1.1.1

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: 953677b838979552d086b794c76a77d1089ff4e9
4
- data.tar.gz: 91097424fb4ca19271f373694ed397f6d05affdb
3
+ metadata.gz: 15d8092dcda167e20e2f888d595cebf939a798f3
4
+ data.tar.gz: 2455005caffdbc22c87d4fa731e2d3c8fc83f334
5
5
  SHA512:
6
- metadata.gz: e278f0564dd27bd872fa1683e5f697164a938e853598137a1b1d47ad9a79ed04c610268f59aa4b12ca948b9ee71bfe12706f227d92302e67411c6e3a5a4cfda8
7
- data.tar.gz: e17cd306ca5ae5c6db98a3a83a361eb5b4683c06743093bf37b3f5eaab306739ee17fb866859b5580806753c121f8d5e7b9e62bd74a35a7f532255c4061753de
6
+ metadata.gz: 5a660f32b464dfbfbedafb7ae46ef653e6ced5ddae98dc5a4ac34453fc5cc18a184b59e9c2cf73c474827438418c479d758659a9773e73ae9e92de986acab13e
7
+ data.tar.gz: 07b79c5fba09c5ce41c3d00c380a8275583cf683172e9fa6f617cc178d2654ee49e4a4f8ca495e285f1a25f5ae9feab33db1383bce450c7fb399c0646f7a4dfd
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- The class overs a some methods for scanning through a log `by_message(msg)`, `erors`, `warnings`, `since(datetime)` and `uniq`.
21
+ The class offers a some methods for scanning through a log `by_message(msg)`, `erors`, `warnings`, `since(datetime)` and `uniq`.
22
22
  These methods can be chained together to refine your search. For example:
23
23
 
24
24
  ```Ruby
@@ -28,8 +28,8 @@ module LogParser
28
28
  #
29
29
  def initialize(log = '', options = {})
30
30
  @file = log.is_a?(String) ? LogParser.path_for(log) : log
31
- @lines = options.fetch :line_items, nil
32
- @pattern = options.fetch :pattern, LINE_PATTERN
31
+ @lines = options[:line_items]
32
+ @pattern = options.fetch(:pattern, LINE_PATTERN)
33
33
  end
34
34
 
35
35
  #
@@ -150,8 +150,7 @@ module LogParser
150
150
  end
151
151
 
152
152
  def lines
153
- @lines = scan if @lines.nil?
154
- @lines
153
+ @lines ||= scan
155
154
  end
156
155
 
157
156
  alias to_a lines
@@ -1,3 +1,3 @@
1
1
  module LogParser
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
data/lib/log_parser.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'date'
2
+ require 'pathname'
2
3
 
3
4
  require 'log_parser/version'
4
5
  require 'log_parser/line_item'
@@ -1,4 +1,3 @@
1
- require 'pathname'
2
1
  require 'minitest/autorun'
3
2
  require 'log_parser'
4
3
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler