rika 0.9.5-java → 0.9.6-java

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rika.rb CHANGED
@@ -26,7 +26,7 @@ module Rika
26
26
  @tika.set_max_string_length(max_content_length)
27
27
  @metadata = Metadata.new
28
28
 
29
- @is_file = File.exists?(@uri)
29
+ @is_file = File.exists?(@uri) && File.directory?(@uri) == false
30
30
  is_http = URI(@uri).scheme == "http" && Net::HTTP.get_response(URI(@uri)).is_a?(Net::HTTPSuccess) if !@is_file
31
31
 
32
32
  if !@is_file && !is_http
data/lib/rika/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rika
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
data/spec/rika_spec.rb CHANGED
@@ -40,6 +40,10 @@ describe Rika::Parser do
40
40
  parser.metadata["Content-Type"].should == "text/plain; charset=ISO-8859-1"
41
41
  end
42
42
 
43
+ it "should not be possible to trick the parser to read a folder with an extension" do
44
+ lambda { Rika::Parser.new(file_path("folder.js")).content }.should raise_error(IOError, "File does not exist or can't be reached.")
45
+ end
46
+
43
47
  describe '#content' do
44
48
  it "should return the content in a text file" do
45
49
  @txt_parser.content.strip.should == @qoute
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rika
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  prerelease:
6
6
  platform: java
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-29 00:00:00.000000000 Z
12
+ date: 2012-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec