epuber 0.7.1 → 0.7.3

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
2
  SHA256:
3
- metadata.gz: d5f0a0a9ea184becf56e460ca8440c93808f3f36fc517ff98e7e573b49f3df0f
4
- data.tar.gz: 3070d122e6a5a6dda0755d0a15f5df756896318150e39e9708db986ce6d755c8
3
+ metadata.gz: 52fe047285b476bde13a682764c8a2040502e10d79511c007b4ce226a5284112
4
+ data.tar.gz: 48d189ecceec30367c4a565fef7eca73728b2e620ac510d889be6ecd5aef4204
5
5
  SHA512:
6
- metadata.gz: 8a010e7d5ce0554f6b22f0c28edd4454a53f9253753f4f9a350a420211ae0506843508ad074c09d5617aef79dbb2f4fed9321f3d6dfd34a413801ead3b1e515f
7
- data.tar.gz: 53031c9e1abd696a24727c37d24e1907466d50587efb83843eafded9469b608e0ad9caec0553b9635bd4c623b2e90fa3f4ca333456ed4fd4c402c70d5b3dcc85
6
+ metadata.gz: 28ab4f13842a57c0a62b4509dbc2ab352d857021045b831f6b7320fc432ba8272acd492ddbac9a449cd3c632885d513b3e30ccaf53116646cc734a2413e191af
7
+ data.tar.gz: b97a62b37d26bf6577e21b46fe6a56918fc3bbc04f5563ff0bbd5d0c92f54a342a5128d0f070b33015f474ec40756eaf94ee64f587666f550748489424ccc5f1
@@ -72,7 +72,7 @@ module Epuber
72
72
 
73
73
  archive_name = compiler.epub_name
74
74
 
75
- if ::File.exists?(archive_name)
75
+ if ::File.exist?(archive_name)
76
76
  FileUtils.remove_file(archive_name)
77
77
  end
78
78
 
@@ -64,7 +64,7 @@ module Epuber
64
64
  # @return nil
65
65
  #
66
66
  def self.write_to_file?(content, to_path)
67
- return true unless File.exists?(to_path)
67
+ return true unless File.exist?(to_path)
68
68
 
69
69
  File.read(to_path) != content.to_s
70
70
  end
@@ -113,7 +113,7 @@ module Epuber
113
113
  Dir.chdir(@file_resolver.destination_path) do
114
114
  new_paths = @file_resolver.package_files.map(&:pkg_destination_path)
115
115
 
116
- if ::File.exists?(epub_path)
116
+ if ::File.exist?(epub_path)
117
117
  Zip::File.open(epub_path, true) do |zip_file|
118
118
  old_paths = zip_file.instance_eval { @entry_set.entries.map(&:name) }
119
119
  diff = old_paths - new_paths
@@ -18,7 +18,7 @@ module Epuber
18
18
  # @return [self]
19
19
  #
20
20
  def self.from_file(file_path)
21
- if File.exists?(file_path)
21
+ if File.exist?(file_path)
22
22
  hash = YAML.safe_load(File.read(file_path))
23
23
  else
24
24
  hash = {}
data/lib/epuber/server.rb CHANGED
@@ -485,9 +485,11 @@ module Epuber
485
485
  # @param [String] file_path
486
486
  #
487
487
  def handle_file(file_path)
488
- return not_found unless File.exists?(file_path)
488
+ return not_found unless File.exist?(file_path)
489
489
 
490
- last_modified(File.mtime(file_path))
490
+ mtime = File.mtime(file_path)
491
+ last_modified(mtime)
492
+ etag(mtime.to_s)
491
493
 
492
494
  case File.extname(file_path)
493
495
  when '.styl'
@@ -507,7 +509,7 @@ module Epuber
507
509
  end
508
510
  end
509
511
 
510
- send_file(file_path, type: type)
512
+ send_file(file_path, type: type, last_modified: mtime)
511
513
  end
512
514
  end
513
515
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.3'
5
5
 
6
6
  HOME_URL = 'https://github.com/epuber-io/epuber'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epuber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kříž
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-29 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -585,7 +585,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
585
585
  - !ruby/object:Gem::Version
586
586
  version: '0'
587
587
  requirements: []
588
- rubygems_version: 3.3.9
588
+ rubygems_version: 3.4.3
589
589
  signing_key:
590
590
  specification_version: 4
591
591
  summary: Epuber is simple tool to compile and pack source files into EPUB format.