range_sentence_parser 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require 'range_sentence_parser/invalid_sentence_error'
1
2
  require 'range_sentence_validator' if defined? ActiveModel
2
3
 
3
4
  class RangeSentenceParser
@@ -54,7 +55,7 @@ class RangeSentenceParser
54
55
  end
55
56
 
56
57
  def valid?
57
- sentence.empty? || sentence =~ /^\d+(-\d+)?(\s*;\s*\d+(-\d+)?)*;?$/
58
+ sentence.empty? || sentence =~ /\A\d+(-\d+)?(\s*;\s*\d+(-\d+)?)*;?\z/
58
59
  end
59
60
 
60
61
  def invalid?
@@ -1,3 +1,3 @@
1
1
  class RangeSentenceParser
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = RangeSentenceParser::VERSION
17
17
 
18
+ gem.add_development_dependency 'rake', '>= 0.10'
18
19
  gem.add_development_dependency 'activemodel', '>= 3.0'
19
20
  gem.add_development_dependency 'rspec', '>= 2.9'
20
21
  end
@@ -61,6 +61,7 @@ describe RangeSentenceParser do
61
61
  it 'should be for invalid sentences' do
62
62
  '1990..1995'.should be_an_invalid_sentence
63
63
  '1990, 1995, 2000'.should be_an_invalid_sentence
64
+ "1990\n1995".should be_an_invalid_sentence
64
65
  end
65
66
  end
66
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: range_sentence_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-12 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.10'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0.10'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: activemodel
16
- requirement: &70271713878800 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
17
33
  none: false
18
34
  requirements:
19
35
  - - ! '>='
@@ -21,10 +37,15 @@ dependencies:
21
37
  version: '3.0'
22
38
  type: :development
23
39
  prerelease: false
24
- version_requirements: *70271713878800
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '3.0'
25
46
  - !ruby/object:Gem::Dependency
26
47
  name: rspec
27
- requirement: &70271713878300 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
28
49
  none: false
29
50
  requirements:
30
51
  - - ! '>='
@@ -32,7 +53,12 @@ dependencies:
32
53
  version: '2.9'
33
54
  type: :development
34
55
  prerelease: false
35
- version_requirements: *70271713878300
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '2.9'
36
62
  description: Parser for range sentences like '1990; 1995-2000; 2005'
37
63
  email:
38
64
  - gabriel.sobrinho@gmail.com
@@ -68,15 +94,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
94
  - - ! '>='
69
95
  - !ruby/object:Gem::Version
70
96
  version: '0'
97
+ segments:
98
+ - 0
99
+ hash: -1339053180270480241
71
100
  required_rubygems_version: !ruby/object:Gem::Requirement
72
101
  none: false
73
102
  requirements:
74
103
  - - ! '>='
75
104
  - !ruby/object:Gem::Version
76
105
  version: '0'
106
+ segments:
107
+ - 0
108
+ hash: -1339053180270480241
77
109
  requirements: []
78
110
  rubyforge_project:
79
- rubygems_version: 1.8.11
111
+ rubygems_version: 1.8.23
80
112
  signing_key:
81
113
  specification_version: 3
82
114
  summary: Parser for range sentences like '1990; 1995-2000; 2005'