im_reader 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16d4011ce1785af650ee6e0fee1f9086c3dc7e7f7699da7749dc486ead737bee
4
- data.tar.gz: 5e9d3fc80714da3b4fed4c9fb9b7bcfd12925c189acc5fcce13dce41bac8d22d
3
+ metadata.gz: f693637efa72f8b0c59dce1206e1e9716b3f5cac3335b2dac02bc1d6cc025548
4
+ data.tar.gz: feac962d03b51b08322c7beb9258be0f39b6811f2e1f0f848f3e1ab996797fd0
5
5
  SHA512:
6
- metadata.gz: 7e812b464dd5a8a99cc8e039599bcedf75fe22e244f5a37225f947b8370f0d71c8b1253809948524e46aab7e3ac4dead16b01b57e5146f4edac3e130fed7100e
7
- data.tar.gz: 6a2992b497ef8950165ac03c8e1459a01f92ff2ab6b11b1089cb7361dbf1850f95a3a663dd7abc7495ab0cbabe2c2699a75ec108034d38f3785c46eb1822e5c9
6
+ metadata.gz: '038aacfbf6507b20e57ce5cf156d0ceb4a666b1eb0e555595d2d719744e64ad3ddb88ec83ca5b62bfbb19e56ba35af5be9f394fa8da102f794c06a39fc434a65'
7
+ data.tar.gz: 746605c1a88fecbc0402082d58f5b54fcf93fced074182c20146da00d9d7aee7b8d756780b482c08592878e8350eece1566b2345fc02ddaf0f2c5871736e56b1
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # im_reader
2
2
 
3
- **im_reader** is a mountable Ruby on Rails engine that provides an elegant in-browser EPUB reader.
4
- It’s designed to integrate seamlessly into your Rails application, allowing users to read `.epub` files hosted remotely, with a built-in table of contents, cover display, and customizable UI labels.
3
+ **im_reader** is a mountable Ruby on Rails engine that encapsulates the [`epub.js`](https://github.com/intity/epub-js) JavaScript library to provide an elegant in-browser EPUB reader.
4
+ It integrates [`Semantic UI`](https://github.com/Semantic-Org/Semantic-UI) for the user interface styling, offering a modern and responsive reading experience.
5
+ Designed to fit seamlessly into any Rails application, it allows users to read `.epub` files hosted remotely, with a built-in table of contents, cover display, and customizable UI labels.
5
6
 
6
7
  ---
7
8
 
@@ -48,7 +49,7 @@ This will expose the following route inside your application:
48
49
  ### Example usage
49
50
 
50
51
  ```
51
- /reader/remote?url=https://your-server.com/path/to/book.epub
52
+ /reader/epub?url=https://your-server.com/path/to/book.epub
52
53
  ```
53
54
 
54
55
  This endpoint will download the EPUB file from the given URL, stream it securely to the client, and display it in the embedded reader.
@@ -76,6 +77,7 @@ fr:
76
77
  start: "Commencer la lecture"
77
78
  messages:
78
79
  loading: "Chargement du livre ..."
80
+ reading_error: "Impossible de récupérer l’EPUB"
79
81
  ```
80
82
 
81
83
  ---
@@ -108,3 +110,12 @@ http://localhost:3000/reader/epub?url=https://your-server.com/path/to/book.epub
108
110
 
109
111
  This project is distributed under the MIT License.
110
112
  See the `LICENSE` file for more details.
113
+
114
+ ## Credits
115
+
116
+ - **EPUB rendering:** [epub.js (Intity fork)](https://github.com/intity/epub-js)
117
+ Licensed under the BSD 2-Clause License.
118
+ - **UI framework:** [Semantic UI](https://github.com/Semantic-Org/Semantic-UI)
119
+ Licensed under the MIT License.
120
+
121
+ **im_reader** integrates and extends these open-source projects to provide a smooth EPUB reading experience inside Ruby on Rails.
@@ -4,32 +4,22 @@ module ImReader
4
4
 
5
5
  def show
6
6
  @remote_url = params[:url]
7
- puts "#### PLOP ####"
8
7
  @url = im_reader.remote_epub_reader_url(url: @remote_url)
9
- puts "***** OK *****"
10
8
  end
11
9
 
12
10
  def remote
13
- # Envoyer cette url depuis le BO immateriel
14
- # @book.book_previews&.last&.download_url
15
- puts "***** REMOTE 1 *****"
16
11
  url = params[:url]
17
12
  uri = URI.parse(url)
18
13
  response = fetch_with_redirect(uri)
19
14
 
20
- # on télécharge directement en mémoire
21
- puts "***** REMOTE 2 *****"
22
-
23
15
  if response.is_a?(Net::HTTPSuccess)
24
16
 
25
- puts "***** REMOTE 3.1 *****"
26
17
  send_data response.body,
27
18
  filename: File.basename(uri.path.presence || "remote.epub"),
28
19
  type: "application/epub+zip",
29
20
  disposition: "inline"
30
21
  else
31
- puts "***** REMOTE 3.2 *****"
32
- render plain: "Impossible de récupérer l’EPUB", status: 404
22
+ render plain: I18n.t('im_reader.messages.reading_error'), status: 404
33
23
  end
34
24
  end
35
25
 
@@ -8,3 +8,4 @@ de:
8
8
  start: "Lesen beginnen"
9
9
  messages:
10
10
  loading: "Buch wird geladen..."
11
+ reading_error: "EPUB-Datei konnte nicht abgerufen werden"
@@ -8,3 +8,4 @@ en:
8
8
  start: "Start to Read"
9
9
  messages:
10
10
  loading: "Book is loading ..."
11
+ reading_error: "Unable to retrieve the EPUB"
@@ -8,3 +8,4 @@ es:
8
8
  start: "Comenzar la lectura"
9
9
  messages:
10
10
  loading: "Cargando el libro..."
11
+ reading_error: "No se pudo recuperar el EPUB"
@@ -8,3 +8,4 @@ fr:
8
8
  start: "Commencer la lecture"
9
9
  messages:
10
10
  loading: "Chargement du livre ..."
11
+ reading_error: "Impossible de récupérer l’EPUB"
@@ -8,3 +8,4 @@ pt:
8
8
  start: "Começar a leitura"
9
9
  messages:
10
10
  loading: "Carregando o livro..."
11
+ reading_error: "Não foi possível recuperar o EPUB."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImReader
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: im_reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elodie Ailleaume
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-20 00:00:00.000000000 Z
11
+ date: 2025-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass