kindleclippings 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/kindleclippings.rb +10 -1
  2. metadata +2 -2
@@ -5,7 +5,16 @@ module KindleClippings
5
5
  ['clipping', 'clippingresult'].each { |file| require File.expand_path(File.dirname(__FILE__) + '/' + file) }
6
6
 
7
7
  def parse_file(path)
8
- parse(File.open(path, :encoding => "UTF-8").read)
8
+
9
+ file_content = String.new
10
+
11
+ if RUBY_VERSION =~ /^1\.8/
12
+ file_content = open(path).read
13
+ else
14
+ file_content = File.open(path, :encoding => "UTF-8").read
15
+ end
16
+
17
+ parse(file_content)
9
18
  end
10
19
 
11
20
  def parse(filecontent)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Georg Alexander Boe