nickel 0.1.5 → 0.1.6

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: 8b0361c1b72f9b007ecd54f8865c0ab83eb94601
4
- data.tar.gz: b3b322c5e5ae062c6ed01d9f8d77508b984bf3e7
3
+ metadata.gz: bb3fb5038dce53180878f8befd0fbc8950b21be4
4
+ data.tar.gz: 7650393829e885ce70d0f26a446cb0e6abe73fa4
5
5
  SHA512:
6
- metadata.gz: 4c2829ca72afe97825b23822f0eaebd757d546626ff80232ccd97d52455bd1389a5adfb66d78d8af515e7e12fd0c4f65ada64a9d8f45bcc219c1fa1db7f8ad54
7
- data.tar.gz: 78567c960f25b17273b125e020f3482fa905212bb47a37c6a6624dc6ddb02250c80d8dd619641ad2db6f75a4e1bf6fb779ce482b4349b97ba579347cd6725ab9
6
+ metadata.gz: 3d82d8327ff2860eb5c4f84de7061c60f4bdcf358f9199b6c0c4697979f4d8374a89cc73c0caa409d7323076a0f4db54a164b8e46e58e6f45687830dd2cbb7c4
7
+ data.tar.gz: b0f972ddc4e80131e47a5e2e65891e8b7d85e6fde4e8a2eaa56bf342aaef5c763c0b407a0e373ab214b0902f4b8b0be20cd99d266b35aeb3d89a3297412f58bb
@@ -4,8 +4,8 @@ rvm:
4
4
  - 2.1
5
5
  - 2.0
6
6
  - 1.9
7
- - jruby
8
- - rbx
7
+ - jruby-1.7
8
+ - rbx-2
9
9
  branches:
10
10
  only: master
11
11
  env:
@@ -1,3 +1,8 @@
1
+ 0.1.6
2
+ -----
3
+ * Removed type checking on dates passed to NLP
4
+ * Made explicit the ruby version required in the gemspec
5
+
1
6
  0.1.5
2
7
  -----
3
8
  * Better bugfix for queries containing "anytime"
@@ -6,6 +6,9 @@ module Nickel
6
6
  end
7
7
  end
8
8
 
9
+ class NullConstruct < Construct
10
+ end
11
+
9
12
  class DateConstruct < Construct
10
13
  attr_accessor :date
11
14
  def interpret
@@ -1011,7 +1011,7 @@ module Nickel
1011
1011
  end
1012
1012
 
1013
1013
  def found_all_day
1014
- @constructs << Construct.new(comp_start: @pos, comp_end: @pos += 1, found_in: __method__)
1014
+ @constructs << NullConstruct.new(comp_start: @pos, comp_end: @pos += 1, found_in: __method__)
1015
1015
  end
1016
1016
 
1017
1017
  def match_tomorrow
@@ -12,7 +12,6 @@ module Nickel
12
12
  attr_reader :occurrences, :message
13
13
 
14
14
  def initialize(query, date_time = Time.now)
15
- fail InvalidDateTimeError unless [DateTime, Time].include?(date_time.class)
16
15
  str_time = date_time.strftime('%Y%m%dT%H%M%S')
17
16
  validate_input query, str_time
18
17
  @query = query.dup
@@ -97,10 +96,4 @@ module Nickel
97
96
  fail 'NLP says: date_time is not in the correct format' unless date_time =~ /^\d{8}T\d{6}$/
98
97
  end
99
98
  end
100
-
101
- class InvalidDateTimeError < StandardError
102
- def message
103
- 'You must pass in a ruby DateTime or Time class object'
104
- end
105
- end
106
99
  end
@@ -1,3 +1,3 @@
1
1
  module Nickel
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -14,9 +14,11 @@ Gem::Specification.new do |s|
14
14
  s.authors = ["Lou Zell", "Iain Beeston"]
15
15
 
16
16
  s.files = `git ls-files`.split($/)
17
- s.test_files = s.files.grep(%r{^(test|spec)/})
17
+ s.test_files = s.files.grep(%r{^spec/})
18
18
  s.require_paths = ["lib"]
19
19
 
20
+ s.required_ruby_version = '>= 1.9'
21
+
20
22
  if RUBY_ENGINE == 'rbx'
21
23
  s.add_dependency 'rubysl-date'
22
24
  s.add_dependency 'rubysl-time'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nickel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Zell
@@ -9,34 +9,34 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-18 00:00:00.000000000 Z
12
+ date: 2014-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
@@ -57,42 +57,42 @@ dependencies:
57
57
  name: codeclimate-test-reporter
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: yard
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: kramdown
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  description: Extracts date, time, and message information from naturally worded text.
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .travis.yml
106
- - .yardopts
104
+ - ".gitignore"
105
+ - ".travis.yml"
106
+ - ".yardopts"
107
107
  - CHANGELOG.md
108
108
  - Gemfile
109
109
  - License.txt
@@ -123,7 +123,6 @@ files:
123
123
  - lib/nickel/ztime.rb
124
124
  - nickel.gemspec
125
125
  - spec/lib/nickel/construct_spec.rb
126
- - spec/lib/nickel/nlp_spec.rb
127
126
  - spec/lib/nickel/occurrence_spec.rb
128
127
  - spec/lib/nickel/zdate_spec.rb
129
128
  - spec/lib/nickel/ztime_spec.rb
@@ -139,23 +138,22 @@ require_paths:
139
138
  - lib
140
139
  required_ruby_version: !ruby/object:Gem::Requirement
141
140
  requirements:
142
- - - '>='
141
+ - - ">="
143
142
  - !ruby/object:Gem::Version
144
- version: '0'
143
+ version: '1.9'
145
144
  required_rubygems_version: !ruby/object:Gem::Requirement
146
145
  requirements:
147
- - - '>='
146
+ - - ">="
148
147
  - !ruby/object:Gem::Version
149
148
  version: '0'
150
149
  requirements: []
151
150
  rubyforge_project:
152
- rubygems_version: 2.1.11
151
+ rubygems_version: 2.2.2
153
152
  signing_key:
154
153
  specification_version: 4
155
154
  summary: Natural language date, time, and message parsing.
156
155
  test_files:
157
156
  - spec/lib/nickel/construct_spec.rb
158
- - spec/lib/nickel/nlp_spec.rb
159
157
  - spec/lib/nickel/occurrence_spec.rb
160
158
  - spec/lib/nickel/zdate_spec.rb
161
159
  - spec/lib/nickel/ztime_spec.rb
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
- require_relative '../../../lib/nickel/nlp'
3
-
4
- module Nickel
5
- describe NLP do
6
- describe '#new' do
7
- it 'raises an error if the current time argument is not a datetime or time object' do
8
- expect do
9
- NLP.new 'lunch 3 days from now', Date.new(2009, 05, 28)
10
- end.to raise_error('You must pass in a ruby DateTime or Time class object')
11
- end
12
- end
13
- end
14
- end