nickel 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nickel/query.rb +4 -4
- data/nickel.gemspec +1 -1
- data/test/zdate_test.rb +3 -2
- data/test/ztime_test.rb +3 -2
- metadata +4 -4
data/lib/nickel/query.rb
CHANGED
@@ -474,10 +474,10 @@ module Nickel
|
|
474
474
|
if mdata = match(a_b)
|
475
475
|
am_pm = mdata[2]
|
476
476
|
case mdata[1].length # this may look a bit confusing, but all we are doing is interpreting
|
477
|
-
when 1
|
478
|
-
when 2
|
479
|
-
when 3
|
480
|
-
when 4
|
477
|
+
when 1 then hstr = "0" + mdata[1] # what the user meant based on the number of digits they provided
|
478
|
+
when 2 then hstr = mdata[1] # e.g. "11" means 11:00
|
479
|
+
when 3 then hstr = "0" + mdata[1][0..0]; mstr = mdata[1][1..2] # e.g. "530" means 5:30
|
480
|
+
when 4 then hstr = mdata[1][0..1]; mstr = mdata[1][2..3] # e.g. "1215" means 12:15
|
481
481
|
end
|
482
482
|
elsif mdata = match(c_d_e)
|
483
483
|
am_pm = mdata[3]
|
data/nickel.gemspec
CHANGED
data/test/zdate_test.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
|
3
|
-
require File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', '
|
2
|
+
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ruby_ext', 'to_s2.rb'))
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'zdate.rb'))
|
4
5
|
|
5
6
|
include Nickel
|
6
7
|
|
data/test/ztime_test.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
|
3
|
-
require File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', '
|
2
|
+
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ruby_ext', 'to_s2.rb'))
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'nickel', 'ztime.rb'))
|
4
5
|
|
5
6
|
include Nickel
|
6
7
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nickel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lou Zell
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-18 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|