epub_book 0.1.14 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2ccac2bdfbd8f7b1da996a0f39e98d735e96bb38
4
- data.tar.gz: 6f1209e9fa71fa63dae98a110622b62dd796cd07
2
+ SHA256:
3
+ metadata.gz: 3133e96a495f48615e516915174884e95f30298bb03323126e89f9547786f194
4
+ data.tar.gz: f8ddee829c2cbb6339ce27d9cd6e8661976c3c05323a3a8ad264c445b726e0ef
5
5
  SHA512:
6
- metadata.gz: d7f38e856293d0559cad6ae2f540c001b2d491757ea0c3353c4a5d151dba464a954fe1ef55738e07d4377c5e137c1e1521eab9b3141e4b5e64b09c71b1a0bfb5
7
- data.tar.gz: c0817ecd9d06a10440e3dd42e054d7a941291a9965a2a867eaa7598f9310f34a6a887bf66cfff4af849df94a2faf70cbbfd89dd5322efc423de83ef413f4f800
6
+ metadata.gz: 78b3ee21ec5c21169925ab31f225f0f5da862d84b5dc756f536464e08a05e2f822abc3678f102fb28462b7249827c4a8c3026f7fdb3046858534a5d11e2adbad
7
+ data.tar.gz: 59dbd929d5f2c1d2e1d2f2622d20dcba661efeace5cd7422812f791d731207ae8bb627ee1aaca26c3cd27cd954154fbb41c9aa9b0ca1eaa4bafb4022a33e52c6
data/README.md CHANGED
@@ -29,6 +29,7 @@ Or install it yourself as:
29
29
  book.body_css = '.wrapper #content'
30
30
  book.creator = 'javy_liu'
31
31
  book.path = '/tmp'
32
+ book.ext_name = 'txt'
32
33
  end
33
34
  ```
34
35
 
@@ -44,6 +45,7 @@ Or install it yourself as:
44
45
  config.mail_user_name = 'ex@example.com'
45
46
  config.mail_password = 'password'
46
47
  config.mail_from = 'yourmail@example.com'
48
+ config.ext_name = 'epub'
47
49
  end
48
50
  ```
49
51
  Or use a ./default_setting.yml file have following content
@@ -69,6 +71,7 @@ Or use a ./default_setting.yml file have following content
69
71
  creator: 'user name'
70
72
  path: '/'
71
73
  mail_to: 'yourmail@example.com'
74
+ ext_name: 'txt'
72
75
 
73
76
  #special host book setting(the key is book_url's host which replacing the dot with underline)
74
77
  #http://www.piaotian.net/html/0/431/index.html
@@ -111,6 +114,7 @@ if you have setting file , you can create book like following
111
114
  book.creator #epub creator
112
115
  book.path #epub book save path
113
116
  book.mail_to #if your want send by email when epub created, set this to your email
117
+ book.ext_name #can create epub or txt file
114
118
  ```
115
119
  ## Perform `create_book` in your terminal
116
120
  ```bash
data/epub_book.gemspec CHANGED
@@ -27,15 +27,18 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency 'nokogiri','~> 1.6.8'
31
- spec.add_dependency 'eeepub'
32
- spec.add_dependency 'zip-zip'
33
- spec.add_dependency 'mail'
30
+ spec.add_dependency 'http','~> 2.1'
31
+ #spec.add_dependency 'nokogiri','1.6.8.1'
32
+ spec.add_dependency "nokogiri", ">= 1.11.4"
33
+ spec.add_dependency 'eeepub', '~> 0.8.1'
34
+ spec.add_dependency 'zip-zip', '~> 0.3'
35
+ spec.add_dependency 'mail', '~>2.7.0'
34
36
 
35
37
 
36
- spec.add_development_dependency "bundler", "~> 1.12"
38
+ spec.add_development_dependency "bundler", ">= 2.2.10"
37
39
  spec.add_development_dependency "rake", "~> 10.0"
38
40
  spec.add_development_dependency "rspec", "~> 3.0"
39
- spec.add_development_dependency "pry"
40
- spec.add_development_dependency "pry-doc"
41
+ spec.add_development_dependency "pry", "~> 0.14.1"
42
+ spec.add_development_dependency "pry-byebug", "~> 3.9"
43
+ spec.add_development_dependency "pry-doc", "~>1.1.0"
41
44
  end
data/lib/epub_book.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "epub_book/version"
2
2
  require 'epub_book/book'
3
+ require 'epub_book/loggable'
3
4
  require 'mail'
4
5
 
5
6
  module EpubBook
@@ -7,15 +8,18 @@ module EpubBook
7
8
  autoload :Book, "epub_book/book"
8
9
  autoload :Mailer, "epub_book/mailer"
9
10
 
10
- Config = Struct.new(:setting_file,:mail_from,:mail_subject,:mail_body,:mail_address,:mail_port,:mail_user_name,:mail_password) do
11
+ Config = Struct.new(:setting_file,:mail_from,:mail_subject,:mail_body,:mail_address,:mail_port,:mail_user_name,:mail_password,:log_level, :ext_name) do
11
12
  include Singleton
12
13
  def initialize
13
14
  self.mail_subject = 'epub 电子书'
14
15
  #self.mail_body = "您创建的电子书见附件\n"
15
16
  self.mail_port = 25
17
+ self.log_level = "info"
16
18
  end
17
19
  end
18
20
 
21
+ extend Loggable
22
+
19
23
  #book initialize, and the block will prior the yml setting
20
24
  def self.create_book(url,bookname=nil,des_url=nil)
21
25
 
@@ -1,4 +1,4 @@
1
- require 'open-uri'
1
+ require 'http'
2
2
  require 'nokogiri'
3
3
  require 'eeepub'
4
4
  require 'base64'
@@ -16,13 +16,13 @@ require 'yaml'
16
16
  #user_agent 访问代理
17
17
  #referer 访问原地址
18
18
  #creator 责任人
19
+ #ext_name 扩展名 epub,txt
19
20
 
20
21
  module EpubBook
21
22
  class Book
22
23
  UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36"
23
24
  Referer = "http://www.baidu.com/"
24
- attr_accessor :title_css, :index_item_css, :body_css, :limit, :item_attr, :page_css, :page_attr,:cover
25
- attr_accessor :cover_css, :description_css,:path,:user_agent,:referer,:creator,:mail_to
25
+ attr_accessor :title_css, :index_item_css, :body_css, :limit, :item_attr, :page_css, :page_attr,:cover,:cover_css, :description_css,:path,:user_agent,:referer,:creator,:mail_to, :folder_name,:des_url,:ext_name
26
26
 
27
27
 
28
28
  Reg = /<script.*?>.*?<\/script>/m
@@ -39,22 +39,27 @@ module EpubBook
39
39
  @cover = 'cover.jpg'
40
40
  @body_css = '.articlebody'
41
41
  @item_attr = "href"
42
+ @ext_name = 'epub'
42
43
  yield self if block_given?
43
- @book_path = File.join((@path || `pwd`.strip), @folder_name)
44
44
  end
45
45
 
46
+ def book_path
47
+ @book_path ||= File.join((@path || `pwd`.strip), @folder_name)
48
+ end
46
49
 
47
50
  def link_host
48
- @link_host ||= @index_url[/\A(http:\/\/.*?)\/\w+/,1]
51
+ @link_host ||= @index_url[/\A(https?:\/\/.*?)\/\w+/,1]
49
52
  end
50
53
 
51
54
  def book
52
- Dir.mkdir(@book_path) unless test(?d,@book_path)
53
- @book ||= test(?s,File.join(@book_path,'index.yml')) ? YAML.load(File.open(File.join(@book_path,'index.yml'))) : ({files: []})
55
+ return @book if @book
56
+ Dir.mkdir(book_path) unless test(?d,book_path)
57
+ @book = test(?s,File.join(book_path,'index.yml')) ? YAML.load(File.open(File.join(book_path,'index.yml'))) : {files: []}
54
58
  end
55
59
 
60
+ #save catalog file
56
61
  def save_book
57
- File.open(File.join(@book_path,'index.yml' ),'w') do |f|
62
+ File.open(File.join(book_path,'index.yml' ),'w') do |f|
58
63
  f.write(@book.to_yaml)
59
64
  end
60
65
  end
@@ -63,68 +68,78 @@ module EpubBook
63
68
  #创建书本
64
69
  def generate_book(book_name=nil)
65
70
  #获取epub源数据
66
- fetch_book
67
- if !@cover_css && @cover
68
- generate_cover = <<-eof
69
- convert #{File.expand_path("../../../#{@cover}",__FILE__)} -font tsxc.ttf -gravity center -fill red -pointsize 16 -draw "text 0,0 '#{book[:title]}'" #{File.join(@book_path,@cover)}
70
- eof
71
- system(generate_cover)
72
- end
73
-
74
- epub = EeePub.make
71
+ fetch_index if !test(?s,File.join(book_path,'index.yml'))
75
72
 
76
- epub.title book[:title]
77
- epub.creator @creator
78
- epub.publisher @creator
79
- epub.date Time.now
80
- epub.identifier "http://javy_liu.com/book/#{@folder_name}", :scheme => 'URL'
81
- epub.uid "http://javy_liu.com/book/#{@folder_name}"
82
- epub.cover @cover
83
- epub.subject book[:title]
84
- epub.description book[:description] if book[:description]
85
-
86
- book[:files] = book[:files][0...limit] if limit
87
-
88
- epub.files book[:files].map{|item| File.join(@book_path,item[:content])}.push(File.join(@book_path,@cover))
89
- epub.nav book[:files]
73
+ book[:file_abs_name] = File.join(book_path,"#{book[:title]}.#{ext_name}")
90
74
 
75
+ fetch_book
76
+ if ext_name == 'epub'
77
+ if !@cover_css && @cover
78
+ generate_cover = <<-eof
79
+ convert #{File.expand_path("../../../#{@cover}",__FILE__)} -font tsxc.ttf -gravity center -fill red -pointsize 16 -draw "text 0,0 '#{book[:title]}'" #{File.join(book_path,@cover)}
80
+ eof
81
+ system(generate_cover)
82
+ end
91
83
 
92
- epub_file = File.join(@book_path,"#{book_name || @folder_name}.epub")
84
+ epub = EeePub.make
85
+
86
+ epub.title book[:title]
87
+ epub.creator @creator
88
+ epub.publisher @creator
89
+ epub.date Time.now
90
+ epub.identifier "http://javy_liu.com/book/#{@folder_name}", :scheme => 'URL'
91
+ epub.uid "http://javy_liu.com/book/#{@folder_name}"
92
+ epub.cover @cover
93
+ epub.subject book[:title]
94
+ epub.description book[:description] if book[:description]
95
+
96
+ book[:files] = book[:files][0...limit] if limit
97
+ _files = []
98
+ book[:files].collect! do |item|
99
+ _file = File.join(book_path,item[:content])
100
+ if test(?f, _file)
101
+ _files.push(_file)
102
+ item
103
+ end
104
+ end
105
+ book[:files].compact!
93
106
 
94
- epub.save(epub_file)
107
+ epub.files _files.push(File.join(book_path,@cover))
108
+ epub.nav book[:files]
109
+ yield self if block_given?
95
110
 
111
+ epub.save(book[:file_abs_name])
112
+ end
96
113
  #send mail
97
- puts mail_to
114
+
98
115
  if mail_to
99
116
  mailer = Mailer.new
100
117
  mailer.to = mail_to
101
- mailer.add_file epub_file
118
+ mailer.add_file book[:file_abs_name]
102
119
  mailer.body = "您创建的电子书[#{book[:title]}]见附件\n"
103
-
104
120
  mailer.send_mail
105
121
  end
106
122
 
107
123
  end
108
124
 
109
-
110
-
111
-
112
125
  #得到书目索引
113
126
  def fetch_index(url=nil)
127
+ book[:files] = []
114
128
  url ||= @index_url
115
- doc = Nokogiri::HTML(judge_encoding(open(URI.encode(url),"User-Agent" => @user_agent ,'Referer'=> @referer).read))
129
+ doc = Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(URI.encode(url)).to_s))
116
130
  #generate index.yml
131
+ EpubBook.logger.info "------Fetch index--#{url}---------------"
117
132
 
118
133
  if !book[:title]
119
134
  doc1 = if @des_url.nil?
120
135
  doc
121
136
  else
122
- Nokogiri::HTML(judge_encoding(open(URI.encode(@des_url),"User-Agent" => @user_agent ,'Referer'=> @referer).read))
137
+ Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent ,'Referer'=> @referer).get(URI.encode(generate_abs_url(doc.css(@des_url).attr("href").to_s))).to_s))
123
138
  end
124
139
  get_des(doc1)
125
140
  end
126
141
 
127
-
142
+ #binding.pry
128
143
  doc.css(@index_item_css).each do |item|
129
144
  _href = URI.encode(item.attr(@item_attr).to_s)
130
145
  next if _href.start_with?('javascript') || _href.start_with?('#')
@@ -151,49 +166,72 @@ module EpubBook
151
166
 
152
167
  def fetch_book
153
168
  #重新得到书目,如果不存在或重新索引的话
154
- fetch_index if !test(?s,File.join(@book_path,'index.yml'))
169
+ #fetch_index if !test(?s,File.join(book_path,'index.yml'))
170
+ EpubBook.logger.info "------Fetch book----------"
171
+ #open a txt file to write
172
+ if ext_name == 'txt'
173
+ txt_file = File.open(book[:file_abs_name], 'a')
174
+ end
155
175
  book[:files].each_with_index do |item,index|
156
176
  break if limit && index >= limit
157
177
 
158
- content_path = File.join(@book_path,item[:content])
178
+ content_path = File.join(book_path,item[:content])
159
179
 
160
180
  #如果文件存在且长度不为0则获取下一个
181
+ #binding.pry
161
182
  next if test(?s,content_path)
162
183
 
163
184
  begin
164
- doc_file = Nokogiri::HTML(judge_encoding(open(item[:url],"User-Agent" => @user_agent,'Referer'=> @referer).read))
165
-
166
- File.open(content_path,'w') do |f|
167
- f.write("<h3>#{item[:label]}</h3>")
168
- f.write(doc_file.css(@body_css).to_s.gsub(Reg,''))
185
+ doc_file = Nokogiri::HTML(judge_encoding(HTTP.headers("User-Agent" => @user_agent,'Referer'=> @referer).get(item[:url]).to_s))
186
+
187
+ EpubBook.logger.info item[:label]
188
+ #binding.pry
189
+ if ext_name == 'pub'
190
+ File.open(content_path,'w') do |f|
191
+ f.write("<h3>#{item[:label]}</h3>")
192
+ f.write(doc_file.css(@body_css).to_s.gsub(Reg,''))
193
+ end
194
+ else
195
+ txt_file.write("\n\n")
196
+ txt_file.write(item[:label])
197
+ txt_file.write("\n ")
198
+ txt_file.write(doc_file.css(@body_css).text)
169
199
  end
170
-
171
- puts item[:label]
172
-
173
200
  rescue Exception => e
174
- puts "Error:#{e.message}"
175
- puts e.backtrace.inspect
201
+ EpubBook.logger.info "Error:#{e.message},#{item.inspect}"
202
+ #EpubBook.logger.info e.backtrace
176
203
  next
177
204
  end
178
205
  end
179
206
 
207
+ txt_file.close if ext_name == 'txt'
208
+
180
209
  end
181
210
 
182
211
 
183
212
  private
184
213
  #is valid encoding
185
214
  def judge_encoding(str)
215
+ EpubBook.logger.info str.encoding
216
+ /<meta.*?charset\s*=[\s\"\']?utf-8/i =~ str ? str : str.force_encoding('gbk').encode!('utf-8',invalid: :replace, undef: :replace)
186
217
  str.scrub! unless str.valid_encoding?
187
- /<meta.*?charset\s*=[\s\"\']?utf-8/i =~ str ? str : str.force_encoding('gbk').encode('utf-8')
218
+
219
+ EpubBook.logger.info "-------encode 后 #{str.encoding}"
220
+ str
188
221
  end
189
222
 
190
223
  #得到书名,介绍,及封面
191
224
  def get_des(doc)
192
225
  book[:title] = doc.css(@title_css).text.strip
193
- if @cover_css && !book[:cover]
226
+
227
+ #EpubBook.logger.info doc
228
+ #EpubBook.logger.info @title_css
229
+
230
+ #binding.pry
231
+ if @cover_css && !book[:cover] && ext_name == 'epub'
194
232
  cover_url = doc.css(@cover_css).attr("src").to_s
195
233
  cover_url = generate_abs_url(cover_url) #link_host + cover_url unless cover_url.start_with?("http")
196
- cover_path = File.join(@book_path,@cover)
234
+ cover_path = File.join(book_path,@cover)
197
235
  system("curl #{cover_url} -o #{cover_path} ")
198
236
  book[:cover] = cover_path
199
237
  end
@@ -204,9 +242,9 @@ module EpubBook
204
242
  end
205
243
 
206
244
  def generate_abs_url(url)
207
- if _href.start_with?("http")
245
+ if url.start_with?("http")
208
246
  url
209
- elsif _href.start_with?("/")
247
+ elsif url.start_with?("/")
210
248
  "#{link_host}#{url}"
211
249
  else
212
250
  @path_name ||= @index_url[/.*\//]
@@ -0,0 +1,69 @@
1
+ require 'logger'
2
+ module EpubBook
3
+
4
+ # Contains logging behaviour.
5
+ module Loggable
6
+
7
+ # Get the logger.
8
+ #
9
+ # @note Will try to grab Rails' logger first before creating a new logger
10
+ # with stdout.
11
+ #
12
+ # @example Get the logger.
13
+ # Loggable.logger
14
+ #
15
+ # @return [ Logger ] The logger.
16
+ #
17
+ # @since 3.0.0
18
+ def logger
19
+ return @logger if defined?(@logger)
20
+ @logger = rails_logger || default_logger
21
+ end
22
+
23
+ # Set the logger.
24
+ #
25
+ # @example Set the logger.
26
+ # Loggable.logger = Logger.new($stdout)
27
+ #
28
+ # @param [ Logger ] The logger to set.
29
+ #
30
+ # @return [ Logger ] The new logger.
31
+ #
32
+ # @since 3.0.0
33
+ def logger=(logger)
34
+ @logger = logger
35
+ end
36
+
37
+ private
38
+
39
+ # Gets the default EpubBook logger - stdout.
40
+ #
41
+ # @api private
42
+ #
43
+ # @example Get the default logger.
44
+ # Loggable.default_logger
45
+ #
46
+ # @return [ Logger ] The default logger.
47
+ #
48
+ # @since 3.0.0
49
+ def default_logger
50
+ logger = ::Logger.new($stdout)
51
+ logger.level = EpubBook.config.log_level
52
+ logger
53
+ end
54
+
55
+ # Get the Rails logger if it's defined.
56
+ #
57
+ # @api private
58
+ #
59
+ # @example Get Rails' logger.
60
+ # Loggable.rails_logger
61
+ #
62
+ # @return [ Logger ] The Rails logger.
63
+ #
64
+ # @since 3.0.0
65
+ def rails_logger
66
+ defined?(::Rails) && ::Rails.respond_to?(:logger) && ::Rails.logger
67
+ end
68
+ end
69
+ end
@@ -1,3 +1,3 @@
1
1
  module EpubBook
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.19"
3
3
  end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub_book
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - qmliu
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-06 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: http
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.8
19
+ version: '2.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.6.8
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: eeepub
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.11.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.11.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: eeepub
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.8.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.8.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: zip-zip
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ">="
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '0'
61
+ version: '0.3'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ">="
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '0'
68
+ version: '0.3'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: mail
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: 2.7.0
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: 2.7.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '1.12'
89
+ version: 2.2.10
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '1.12'
96
+ version: 2.2.10
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rake
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -112,30 +126,44 @@ dependencies:
112
126
  name: pry
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: '0'
131
+ version: 0.14.1
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: '0'
138
+ version: 0.14.1
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.9'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.9'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: pry-doc
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
- - - ">="
157
+ - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: '0'
159
+ version: 1.1.0
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
- - - ">="
164
+ - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: '0'
166
+ version: 1.1.0
139
167
  description: 'create epub from a book index url and mail to you. by setting a default_setting.yml
140
168
  you can use it in shell. '
141
169
  email:
@@ -153,13 +181,12 @@ files:
153
181
  - LICENSE.txt
154
182
  - README.md
155
183
  - Rakefile
156
- - bin/console
157
- - bin/setup
158
184
  - cover.jpg
159
185
  - epub_book.gemspec
160
186
  - exe/create_book
161
187
  - lib/epub_book.rb
162
188
  - lib/epub_book/book.rb
189
+ - lib/epub_book/loggable.rb
163
190
  - lib/epub_book/mailer.rb
164
191
  - lib/epub_book/version.rb
165
192
  - tsxc.ttf
@@ -168,7 +195,7 @@ licenses:
168
195
  - MIT
169
196
  metadata:
170
197
  allowed_push_host: https://rubygems.org
171
- post_install_message:
198
+ post_install_message:
172
199
  rdoc_options: []
173
200
  require_paths:
174
201
  - lib
@@ -183,9 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
210
  - !ruby/object:Gem::Version
184
211
  version: '0'
185
212
  requirements: []
186
- rubyforge_project:
187
- rubygems_version: 2.4.8
188
- signing_key:
213
+ rubygems_version: 3.2.3
214
+ signing_key:
189
215
  specification_version: 4
190
216
  summary: create epub from a book index url and mail to you.
191
217
  test_files: []
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "epub_book"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- require "pry"
11
- Pry.start
12
-
13
- #require "irb"
14
- #IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here