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 +4 -4
- data/format_engine.gemspec +1 -1
- data/lib/format_engine/format_spec.rb +0 -6
- data/lib/format_engine/spec_info.rb +6 -4
- data/lib/format_engine/version.rb +1 -1
- data/tests/engine_base_tests.rb +1 -1
- data/tests/format_engine_tests.rb +1 -1
- data/tests/format_spec_tests.rb +1 -1
- data/tests/formatter_engine_tests.rb +1 -1
- data/tests/literal_spec_tests.rb +1 -1
- data/tests/parser_engine_tests.rb +1 -1
- data/tests/scan_tests.rb +1 -1
- data/tests/variable_spec_tests.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4ae6ded21313ff4d99c029eb6e278e5f5de82e8
|
4
|
+
data.tar.gz: 6c3db7919e7a21366f7ca7d835a86b37e1404719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7cfb0b7d0bd449b0996d281bb59989fa5578a752007cd7b1d9add50e765bc3658054456898dec3ded0d83cfe50aae84f33ce91934bab3fe787d43e6de769995
|
7
|
+
data.tar.gz: bca710cf89db0b058a24b35a735902b1f33ca7db0e3f001ee4c7f2b105ee9c51c0e7fabf430d888806f5f02c0e33083a7fed23a0b09374ee5f6937a063b31f5d
|
data/format_engine.gemspec
CHANGED
@@ -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', "
|
27
|
+
spec.add_development_dependency 'minitest_visible', ">= 0.1.0"
|
28
28
|
spec.add_development_dependency 'rdoc', "~> 4.0.1"
|
29
29
|
end
|
@@ -72,14 +72,16 @@ module FormatEngine
|
|
72
72
|
|
73
73
|
#Grab some text
|
74
74
|
def grab
|
75
|
-
|
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
|
84
|
+
result, @src = src[0..width], src[(width+1)..-1] || ""
|
83
85
|
end
|
84
86
|
|
85
87
|
result
|
data/tests/engine_base_tests.rb
CHANGED
data/tests/format_spec_tests.rb
CHANGED
data/tests/literal_spec_tests.rb
CHANGED
data/tests/scan_tests.rb
CHANGED
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.
|
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-
|
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
|
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
|
68
|
+
version: 0.1.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rdoc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|