kindler 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kindler/version.rb +1 -1
- data/lib/kindler.rb +4 -0
- metadata +4 -5
data/lib/kindler/version.rb
CHANGED
data/lib/kindler.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
require "open-uri"
|
4
4
|
require "nokogiri"
|
5
|
+
require "cgi"
|
5
6
|
# require 'mini_magick'
|
6
7
|
require_relative 'kindler/railtie' if defined?(Rails)
|
7
8
|
require_relative "kindler/version"
|
@@ -40,6 +41,9 @@ module Kindler
|
|
40
41
|
page[:count] = pages.count + 1
|
41
42
|
page[:file_name] = "#{page[:count].to_s.rjust(3,'0')}.html"
|
42
43
|
page[:author] = 'unknown' if (page[:author]==nil or page[:author]=='')
|
44
|
+
# escape special chars
|
45
|
+
page[:title] = CGI::escapeHTML(page[:title])
|
46
|
+
page[:author] = CGI::escapeHTML(page[:author])
|
43
47
|
pages << page
|
44
48
|
debug pages
|
45
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kindler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-05 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &2165462940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2165462940
|
25
25
|
description: kindler is a rubygem allow you to generate kindle mobi book very easily
|
26
26
|
email:
|
27
27
|
- mike.d.1984@gmail.com
|
@@ -67,4 +67,3 @@ summary: kindler is a rubygem allow you to generate kindle mobi book very easily
|
|
67
67
|
test_files:
|
68
68
|
- spec/cases/generator_spec.rb
|
69
69
|
- spec/spec_helper.rb
|
70
|
-
has_rdoc:
|