dmoz_sax_doc 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dmoz_sax/path.rb CHANGED
@@ -11,7 +11,7 @@ module DmozSax
11
11
  @name = resource.first if resource.length == 2
12
12
 
13
13
  unless resource.empty?
14
- @path = resource.last.split('/').reject {|a| a =~ /^[A-Z]$/}
14
+ @path = resource.last.split('/').reject {|a| a =~ /^[A-Z0-9]$/}
15
15
  @path.shift if 'Top' == @path.first
16
16
  else
17
17
  @path = []
@@ -3,6 +3,8 @@ module DmozSax
3
3
  def time_from string
4
4
  arr = string.split(/[-\s:]/).map(&:to_i)
5
5
  Time.utc(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5])
6
+ rescue Exception => e
7
+ nil
6
8
  end
7
9
  end
8
10
  end
@@ -1,3 +1,3 @@
1
1
  module DmozSax
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/spec/path_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe DmozSax::Path do
8
8
 
9
9
  it "removes the 'Top' category and English index categories (e.g. 'a' to 'z')" do
10
10
 
11
- ('A'..'Z').each do |char|
11
+ (('A'..'Z').to_a + (0..9).to_a).each do |char|
12
12
  path = DmozSax::Path.new("Top/This/Topic/#{ char }/Path")
13
13
  path.to_a.should == ['This','Topic','Path']
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmoz_sax_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-02 00:00:00.000000000 Z
12
+ date: 2013-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri