yoga 0.3.0 → 0.3.2

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: c9d32e62917dfcbbdd0993469ee617970ab77073
4
- data.tar.gz: 5646e21cfdd27da322f1fad4de9af2e71a9474c9
3
+ metadata.gz: e30bbc7d17d9d4847b096576cc5efb39c71eec4e
4
+ data.tar.gz: 5813baee5ef2e6704fa2db41a3f77316e478ec3f
5
5
  SHA512:
6
- metadata.gz: 9577807b96c3475d6c7848db1e91bd3946d2216f3a9f2d525f5f95e47a6e97fefc7ab0db501feb5c47f68c056d2841b3bc006fdf5f2edc18e9040011f12f31c6
7
- data.tar.gz: fb11c522ff6206c6ff75f9c03f301b76f30aab93e19bb891b87cda1ebb89757b0d12e20247237ef4372560717715f5ed20e5ee9ed9ec723aa1bffae1bf4d068b
6
+ metadata.gz: 0d6a878a6eaaf68427d1c4b873c465d82d82a61bef900f5f53cd173dc2e12b83e17e0bca277511edf3bfde66b009755a2272e75a9c6f6232a45cad8e253d0458
7
+ data.tar.gz: 642ddf68de1ce8acd8d69d198eaa4f7af87abd45c1deaba76e230b738f3abcb8aedad2dfec061bb4f01b1816f4d5527be5c8b9f59e0f755b057b50491ec2d277
data/lib/yoga/scanner.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "strscan"
5
+
4
6
  module Yoga
5
7
  # A scanner. This performs scanning over a series of tokens.
6
8
  # It is built to lazily scan whenever it is required, instead
@@ -94,7 +96,7 @@ module Yoga
94
96
  # A regular expression to match all kinds of lines. All of them.
95
97
  #
96
98
  # @return [::Regexp]
97
- LINE_MATCHER = /\r\n|\n\r|\n|\r/
99
+ LINE = /\r\n|\n\r|\n|\r/
98
100
 
99
101
  # Attempts to match the given token. The first argument can be a string,
100
102
  # a symbol, or a regular expression. If the matcher is a symbol, it's
@@ -129,7 +131,7 @@ module Yoga
129
131
  #
130
132
  # @return [Boolean] If the line was matched.
131
133
  def match_line(kind = false)
132
- match(LINE_MATCHER, kind)
134
+ match(LINE, kind)
133
135
  end
134
136
 
135
137
  # Returns the number of lines that have been covered so far in the scanner.
@@ -167,10 +169,10 @@ module Yoga
167
169
  # @api private
168
170
  # @return [void]
169
171
  def update_line_information
170
- return unless (lines = @scanner[0].scan(LINE_MATCHER)).any?
172
+ return unless (lines = @scanner[0].scan(LINE)).any?
171
173
  @line += lines.size
172
174
  @last_line_at =
173
- @scanner.string.rindex(LINE_MATCHER, @scanner.charpos) + 1
175
+ @scanner.string.rindex(LINE, @scanner.charpos) + 1
174
176
  end
175
177
  end
176
178
  end
data/lib/yoga/version.rb CHANGED
@@ -5,5 +5,5 @@ module Yoga
5
5
  # The version of the module.
6
6
  #
7
7
  # @return [::String]
8
- VERSION = "0.3.0"
8
+ VERSION = "0.3.2"
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi