format_engine 0.5.2 → 0.5.4

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: 09f96049d5a1aec1f68f2c4f999c5c0138c0bd83
4
- data.tar.gz: 26d8f175cb85f9307c2d0f93bebedc7dfe682bd6
3
+ metadata.gz: d4ae6ded21313ff4d99c029eb6e278e5f5de82e8
4
+ data.tar.gz: 6c3db7919e7a21366f7ca7d835a86b37e1404719
5
5
  SHA512:
6
- metadata.gz: d9f42b5c1a1e0ba22a89b3fb9531e9b4ed874d3f618b0b8cdbe47d393e4a8a978860a07efcf7cdb805bb32199bb2b4e597464aae413252da2795c7691c04dfca
7
- data.tar.gz: c0d18a3b94da1251e12e1d66166f42359adb08553005e5bd0bad7c6d722f64946758a1706e9bc309ea9bb8f1a7802b8b0efe1520ab63770c1b9776710dd544f2
6
+ metadata.gz: f7cfb0b7d0bd449b0996d281bb59989fa5578a752007cd7b1d9add50e765bc3658054456898dec3ded0d83cfe50aae84f33ce91934bab3fe787d43e6de769995
7
+ data.tar.gz: bca710cf89db0b058a24b35a735902b1f33ca7db0e3f001ee4c7f2b105ee9c51c0e7fabf430d888806f5f02c0e33083a7fed23a0b09374ee5f6937a063b31f5d
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency 'minitest', "~> 5.5.1"
27
- spec.add_development_dependency 'minitest_visible', "~> 0.0.2"
27
+ spec.add_development_dependency 'minitest_visible', ">= 0.1.0"
28
28
  spec.add_development_dependency 'rdoc', "~> 4.0.1"
29
29
  end
@@ -61,11 +61,5 @@ module FormatEngine
61
61
  end
62
62
  end
63
63
 
64
- #Validate the specs of this format against the engine.
65
- def validate(engine)
66
- specs.each {|item| item.validate(engine)}
67
- self
68
- end
69
-
70
64
  end
71
65
  end
@@ -72,14 +72,16 @@ module FormatEngine
72
72
 
73
73
  #Grab some text
74
74
  def grab
75
- if (width = fmt.width) > 0
75
+ width = fmt.width
76
+
77
+ if width > 0
76
78
  result, @src = src[0...width], src[width..-1] || ""
79
+ elsif width == 0
80
+ result, @src = src[0...1], src[1..-1] || ""
77
81
  elsif width == -1
78
82
  result, @src = src, ""
79
- elsif width < 0
80
- result, @src = src[0..width], src[(width+1)..-1] || ""
81
83
  else
82
- result, @src = src[0...1], src[1..-1] || ""
84
+ result, @src = src[0..width], src[(width+1)..-1] || ""
83
85
  end
84
86
 
85
87
  result
@@ -1,5 +1,5 @@
1
1
 
2
2
  module FormatEngine
3
3
  # The version of the format_engine gem.
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.4"
5
5
  end
@@ -6,7 +6,7 @@ require 'minitest_visible'
6
6
  class EngineBaseTester < Minitest::Test
7
7
 
8
8
  #Track mini-test progress.
9
- MinitestVisible.track self, __FILE__
9
+ include MinitestVisible
10
10
 
11
11
  def test_that_it_has_a_library
12
12
  test = FormatEngine::Engine.new({"%A" => 42})
@@ -9,7 +9,7 @@ require_relative '../mocks/demo'
9
9
  class FormatEngineTester < Minitest::Test
10
10
 
11
11
  #Track mini-test progress.
12
- MinitestVisible.track self, __FILE__
12
+ include MinitestVisible
13
13
 
14
14
  def test_basic_formatting
15
15
  cust = Customer.new("Jane", "Doe", 21)
@@ -6,7 +6,7 @@ require 'minitest_visible'
6
6
  class FormatSpecTester < Minitest::Test
7
7
 
8
8
  #Track mini-test progress.
9
- MinitestVisible.track self, __FILE__
9
+ include MinitestVisible
10
10
 
11
11
  def test_that_it_scans_literal_formats
12
12
  test = FormatEngine::FormatSpec.get_spec "ABCDEFG!"
@@ -9,7 +9,7 @@ require_relative '../mocks/test_person_mock'
9
9
  class FormatterTester < Minitest::Test
10
10
 
11
11
  #Track mini-test progress.
12
- MinitestVisible.track self, __FILE__
12
+ include MinitestVisible
13
13
 
14
14
  def make_formatter
15
15
  FormatEngine::Engine.new(
@@ -6,7 +6,7 @@ require 'minitest_visible'
6
6
  class LiteralSpecTester < Minitest::Test
7
7
 
8
8
  #Track mini-test progress.
9
- MinitestVisible.track self, __FILE__
9
+ include MinitestVisible
10
10
 
11
11
  def test_that_it_formats
12
12
  spec_info = FormatEngine::SpecInfo.new(nil, "", nil)
@@ -9,7 +9,7 @@ require_relative '../mocks/test_person_mock'
9
9
  class ParserTester < Minitest::Test
10
10
 
11
11
  #Track mini-test progress.
12
- MinitestVisible.track self, __FILE__
12
+ include MinitestVisible
13
13
 
14
14
  def make_parser
15
15
  FormatEngine::Engine.new(
data/tests/scan_tests.rb CHANGED
@@ -8,7 +8,7 @@ require 'minitest_visible'
8
8
  class ScanTester < Minitest::Test
9
9
 
10
10
  #Track mini-test progress.
11
- MinitestVisible.track self, __FILE__
11
+ include MinitestVisible
12
12
 
13
13
  DECIMAL = /[+-]?\d+/
14
14
  HEX = /[+-]?(0[xX])?\h+/
@@ -6,7 +6,7 @@ require 'minitest_visible'
6
6
  class VariableSpecTester < Minitest::Test
7
7
 
8
8
  #Track mini-test progress.
9
- MinitestVisible.track self, __FILE__
9
+ include MinitestVisible
10
10
 
11
11
  def test_the_parms
12
12
  test = FormatEngine::FormatVariable.new("%B")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: format_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-15 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: minitest_visible
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.2
61
+ version: 0.1.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.2
68
+ version: 0.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
71
  requirement: !ruby/object:Gem::Requirement