himg 0.0.2 → 0.0.3
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 +4 -4
- data/.rubocop.yml +20 -0
- data/Appraisals +7 -0
- data/CHANGELOG.md +18 -0
- data/Cargo.lock +1 -1
- data/README.md +38 -14
- data/Rakefile +8 -2
- data/Steepfile +0 -10
- data/ext/himg/Cargo.toml +1 -1
- data/ext/himg/examples/file.rs +1 -1
- data/ext/himg/src/html_to_image.rs +10 -2
- data/ext/himg/src/lib.rs +23 -12
- data/ext/himg/src/writer.rs +8 -7
- data/gemfiles/plain_ruby.gemfile +0 -7
- data/gemfiles/plain_ruby.gemfile.lock +10 -21
- data/gemfiles/rails_6.gemfile +0 -6
- data/gemfiles/rails_6.gemfile.lock +18 -28
- data/gemfiles/rails_7_0.gemfile +0 -6
- data/gemfiles/rails_7_0.gemfile.lock +18 -28
- data/gemfiles/rails_7_1.gemfile +0 -6
- data/gemfiles/rails_7_1.gemfile.lock +18 -28
- data/gemfiles/rails_7_2.gemfile +0 -6
- data/gemfiles/rails_7_2.gemfile.lock +18 -28
- data/gemfiles/rails_8.gemfile +0 -6
- data/gemfiles/rails_8.gemfile.lock +18 -28
- data/lib/himg/railtie/template_handler.rb +8 -4
- data/lib/himg/railtie.rb +21 -3
- data/lib/himg/version.rb +1 -1
- data/lib/himg.rb +1 -1
- metadata +11 -26
- data/.standard.yml +0 -3
- data/test.html.rbd +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286080c98560f491c524867c0986edd71e7e14bc912a50a2a72d627d4cb22e34
|
4
|
+
data.tar.gz: 435a08c13f0211d694ca477d4ce8a7afba24c686d088a7b7831c0397177d127c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ca027f7d92741dc71b872a5308a05228c9e7c7743ebcfd976175f3c4a5a0482d3831e0d3f664aa1a7870353e8d2d482c1e545b0fa558d802ca3131282323bd
|
7
|
+
data.tar.gz: e4a9e936a5d96a1574c9af213912bed55de8e25af94775007397a70a7bdebc9f5b41519fc35668738c0929e9f50821b18f1c58d0897f84443334fcba15b4973c
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 3.1
|
3
|
+
|
4
|
+
Style/StringLiterals:
|
5
|
+
EnforcedStyle: double_quotes
|
6
|
+
|
7
|
+
Style/StringLiteralsInInterpolation:
|
8
|
+
EnforcedStyle: double_quotes
|
9
|
+
|
10
|
+
Style/FrozenStringLiteralComment:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Metrics/BlockLength:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Bundler/OrderedGems:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Layout/ExtraSpacing:
|
20
|
+
Enabled: false
|
data/Appraisals
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
appraise "plain-ruby" do
|
2
|
+
remove_gem "rails"
|
3
|
+
remove_gem "puma"
|
2
4
|
end
|
3
5
|
|
4
6
|
appraise "rails-6" do
|
7
|
+
remove_gem "puma"
|
5
8
|
gem "rails", "~> 6.0"
|
6
9
|
gem "rspec-rails", "~> 6.0"
|
7
10
|
gem "concurrent-ruby", "1.3.4" # Logger dependency fix, see: https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror
|
@@ -10,6 +13,7 @@ appraise "rails-6" do
|
|
10
13
|
end
|
11
14
|
|
12
15
|
appraise "rails-7-0" do
|
16
|
+
remove_gem "puma"
|
13
17
|
gem "rails", "~> 7.0.0"
|
14
18
|
gem "rspec-rails", "~> 7.0"
|
15
19
|
gem "concurrent-ruby", "1.3.4" # Logger dependency fix, see: https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror
|
@@ -18,16 +22,19 @@ appraise "rails-7-0" do
|
|
18
22
|
end
|
19
23
|
|
20
24
|
appraise "rails-7-1" do
|
25
|
+
remove_gem "puma"
|
21
26
|
gem "rails", "~> 7.1.0"
|
22
27
|
gem "rspec-rails", "~> 7.0"
|
23
28
|
end
|
24
29
|
|
25
30
|
appraise "rails-7-2" do
|
31
|
+
remove_gem "puma"
|
26
32
|
gem "rails", "~> 7.2.0"
|
27
33
|
gem "rspec-rails", "~> 7.0"
|
28
34
|
end
|
29
35
|
|
30
36
|
appraise "rails-8" do
|
37
|
+
remove_gem "puma"
|
31
38
|
gem "rails", "~> 8.0"
|
32
39
|
gem "rspec-rails", "~> 7.0"
|
33
40
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.0.3] - 2025-04-22
|
4
|
+
|
5
|
+
- Ensure that when render height is expanded to fit the content that we update
|
6
|
+
the height we try to write in the png metadata to match.
|
7
|
+
- Rust creates a ruby string with the binary png data so we don't need to convert with .pack("C*")
|
8
|
+
- Himg::Error wraps errors from a Rust Result<_,Err>
|
9
|
+
- Added OpenGraph metadata example
|
10
|
+
- Default dimensions of 720x405 to match the ideal 16:9 ratio and image size
|
11
|
+
for sharing og-image on messengers and social media.
|
12
|
+
|
13
|
+
## [0.0.2] - 2025-04-21
|
14
|
+
|
15
|
+
- Adds Rails support via a ActionView template handler.
|
16
|
+
Takes views like `action.show.erb`, pre-processes them with Erb and renders
|
17
|
+
to a .png with 'image/png' set as the MIME type.
|
18
|
+
- Adds a `ActionController::Renderer` so `render himg: '<div>Some HTML</div>'`
|
19
|
+
can be used either directly or from a `format.png`/`format.himg` block.
|
20
|
+
|
3
21
|
## [0.0.1] - 2025-04-19
|
4
22
|
|
5
23
|
- Initial alpha
|
data/Cargo.lock
CHANGED
data/README.md
CHANGED
@@ -16,8 +16,7 @@ In Rails this will mean you can process user.himg.erb to display an image includ
|
|
16
16
|
4. Network requests can be made: don't use this library with untrusted inputs.
|
17
17
|
5. file:// URLs are resolved: this could expose files on your computer.
|
18
18
|
6. Native extensions are not yet being published for different os/arch
|
19
|
-
7.
|
20
|
-
8. Verbose logging is hardcoded
|
19
|
+
7. Verbose logging is hardcoded
|
21
20
|
|
22
21
|
## Installation
|
23
22
|
|
@@ -35,6 +34,12 @@ gem install himg
|
|
35
34
|
|
36
35
|
## Usage
|
37
36
|
|
37
|
+
### Ruby
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
png = Himg.render("<html bgcolor='blue'></html>")
|
41
|
+
```
|
42
|
+
|
38
43
|
### Rails
|
39
44
|
|
40
45
|
Simply add a `show.himg.erb`!
|
@@ -43,6 +48,18 @@ Simply add a `show.himg.erb`!
|
|
43
48
|
<div><%= @username %></div>
|
44
49
|
```
|
45
50
|
|
51
|
+
### Adding OpenGraph Meta Tags
|
52
|
+
|
53
|
+
Once you've added a view template for your resource, you can use it to generate image cards that will be shown when the page is shared on messenger apps or social media.
|
54
|
+
|
55
|
+
```html
|
56
|
+
<meta property="og:title" content="<%= @user.username %>" />
|
57
|
+
<meta property="og:description" content="<%= @user.tagline %>" />
|
58
|
+
<meta property="og:image" content="<%= user_url(@user.username, format: :png) %>" />
|
59
|
+
```
|
60
|
+
|
61
|
+
### Advanced Rails Usage
|
62
|
+
|
46
63
|
A :himg template handler is registered and will be called by rails' `default_render` method automatically when the corresponding view is found. This can be `show.himg` for a static image, or `show.himg.erb` to use variables from the controller.
|
47
64
|
|
48
65
|
If you prefer you could also use `render himg: "<div>My Data</div>"` instead, but should be careful with untrusted input if constructing HTML manually.
|
@@ -64,24 +81,31 @@ respond_to do |format|
|
|
64
81
|
end
|
65
82
|
```
|
66
83
|
|
67
|
-
### Run from Ruby
|
68
|
-
|
69
|
-
```ruby
|
70
|
-
png = Himg.render("<html bgcolor='blue'></html>")
|
71
|
-
```
|
72
|
-
|
73
|
-
## Development
|
74
|
-
|
75
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
76
|
-
|
77
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
78
|
-
|
79
84
|
### Run directly from the command line to output an image
|
85
|
+
|
80
86
|
```bash
|
81
87
|
bundle exec cargo run --example file
|
82
88
|
bundle exec cargo run --example file -- path/to/file.html
|
83
89
|
```
|
84
90
|
|
91
|
+
## Development
|
92
|
+
|
93
|
+
1. Run `bin/setup` to install dependencies.
|
94
|
+
2. Run `rake spec` to run the tests with the default development setup
|
95
|
+
3. Run `appraisal rake spec` to run tests against different versions of rails and to confirm that the gem works in a plain ruby environment
|
96
|
+
4. Run `bin/console` for an interactive prompt that will allow you to experiment.
|
97
|
+
5. Run `RAILS_ENV=development bundle exec spec/dummy/dummy_rails server` to check the dummy app.
|
98
|
+
- http://localhost:3000/users/jamedjo.png will display an opengraph compatible png
|
99
|
+
- http://localhost:3000/users/jamedjo.himg will also render the same png
|
100
|
+
- http://localhost:3000/users/jamedjo will render an HTML page with opengraph meta tags
|
101
|
+
6. To install this gem onto your local machine, run `bundle exec rake install`.
|
102
|
+
|
103
|
+
## Releases
|
104
|
+
|
105
|
+
To release a new version:
|
106
|
+
1. Run `rake bump:patch` to update the version numbers in `version.rb` and `ext/himg/Cargo.toml`.
|
107
|
+
3. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
108
|
+
|
85
109
|
## Contributing
|
86
110
|
|
87
111
|
Bug reports and pull requests are welcome on GitHub at https://github.com/jamedjo/himg.
|
data/Rakefile
CHANGED
@@ -5,7 +5,9 @@ require "rspec/core/rake_task"
|
|
5
5
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
7
7
|
|
8
|
-
require "
|
8
|
+
require "rubocop/rake_task"
|
9
|
+
|
10
|
+
RuboCop::RakeTask.new
|
9
11
|
|
10
12
|
require "rb_sys/extensiontask"
|
11
13
|
|
@@ -17,4 +19,8 @@ RbSys::ExtensionTask.new("himg", GEMSPEC) do |ext|
|
|
17
19
|
ext.lib_dir = "lib/himg"
|
18
20
|
end
|
19
21
|
|
20
|
-
|
22
|
+
require "bump/tasks"
|
23
|
+
Bump.replace_in_default = %w[ext/himg/Cargo.toml]
|
24
|
+
Bump.changelog = :editor
|
25
|
+
|
26
|
+
task default: %i[compile rubocop]
|
data/Steepfile
CHANGED
@@ -17,13 +17,3 @@ target :lib do
|
|
17
17
|
# hash[D::Ruby::NoMethod] = :information
|
18
18
|
# end
|
19
19
|
end
|
20
|
-
|
21
|
-
#target :test do
|
22
|
-
# unreferenced! # Skip type checking the `lib` code when types in `test` target is changed
|
23
|
-
# signature "sig/test" # Put RBS files for tests under `sig/test`
|
24
|
-
# check "test" # Type check Ruby scripts under `test`
|
25
|
-
|
26
|
-
# configure_code_diagnostics(D::Ruby.lenient) # Weak type checking for test code
|
27
|
-
|
28
|
-
# # library "pathname" # Standard libraries
|
29
|
-
#end
|
data/ext/himg/Cargo.toml
CHANGED
data/ext/himg/examples/file.rs
CHANGED
@@ -43,7 +43,7 @@ async fn main() {
|
|
43
43
|
let mut file = File::create(&out_path).unwrap();
|
44
44
|
|
45
45
|
// Encode buffer as PNG and write it to a file
|
46
|
-
write_png(&mut file, &buffer, options.image_size.scaled_width(), options.image_size.scaled_height());
|
46
|
+
write_png(&mut file, &buffer, options.image_size.scaled_width(), options.image_size.scaled_height()).unwrap();
|
47
47
|
logger.log("Wrote out png");
|
48
48
|
|
49
49
|
logger.log_total_time("\nDone");
|
@@ -11,12 +11,17 @@ use crate::image_size::ImageSize;
|
|
11
11
|
use crate::logger::Logger;
|
12
12
|
use crate::options::Options;
|
13
13
|
|
14
|
+
pub struct RenderOutput {
|
15
|
+
pub buffer: Vec<u8>,
|
16
|
+
pub image_size: ImageSize,
|
17
|
+
}
|
18
|
+
|
14
19
|
pub async fn html_to_image(
|
15
20
|
html: &str,
|
16
21
|
base_url: Option<String>,
|
17
22
|
options: Options,
|
18
23
|
logger: &mut dyn Logger,
|
19
|
-
) ->
|
24
|
+
) -> RenderOutput {
|
20
25
|
let (mut recv, callback) = MpscCallback::new();
|
21
26
|
logger.log("Initial config");
|
22
27
|
|
@@ -83,5 +88,8 @@ pub async fn html_to_image(
|
|
83
88
|
|
84
89
|
logger.log("Rendered to buffer");
|
85
90
|
|
86
|
-
|
91
|
+
RenderOutput {
|
92
|
+
buffer: buffer,
|
93
|
+
image_size: render_size,
|
94
|
+
}
|
87
95
|
}
|
data/ext/himg/src/lib.rs
CHANGED
@@ -11,22 +11,23 @@ pub use writer::write_png;
|
|
11
11
|
pub use logger::{Logger, TimedLogger};
|
12
12
|
|
13
13
|
use blitz_traits::{ColorScheme};
|
14
|
-
use magnus::{function, prelude::*, Error, Ruby};
|
14
|
+
use magnus::{function, prelude::*, ExceptionClass, Error, Ruby};
|
15
15
|
|
16
|
-
pub fn render_blocking(html: String) -> Vec<u8> {
|
17
|
-
tokio::runtime::Runtime::new()
|
18
|
-
|
19
|
-
|
16
|
+
pub fn render_blocking(html: String) -> Result<Vec<u8>, std::io::Error> {
|
17
|
+
let runtime = tokio::runtime::Runtime::new()?;
|
18
|
+
|
19
|
+
runtime.block_on(render(html))
|
20
20
|
}
|
21
21
|
|
22
|
-
|
22
|
+
// render_to_bytes, render_to_string, render_to_file, render_to_io
|
23
|
+
pub async fn render(html: String) -> Result<Vec<u8>, std::io::Error> {
|
23
24
|
let mut logger = TimedLogger::init();
|
24
25
|
|
25
26
|
// Configure viewport dimensions
|
26
27
|
let options = Options {
|
27
28
|
image_size: ImageSize {
|
28
|
-
width:
|
29
|
-
height:
|
29
|
+
width: 720, //TODO: pass this in
|
30
|
+
height: 405, //TODO: decide if this will be fixed or dynamic from the document
|
30
31
|
hidpi_scale: 1.0,
|
31
32
|
},
|
32
33
|
color_scheme: ColorScheme::Light,
|
@@ -36,15 +37,24 @@ pub async fn render(html: String) -> Vec<u8> {
|
|
36
37
|
// Render to Image
|
37
38
|
//let base_url = format!("file://{}", path_string.clone());
|
38
39
|
let base_url = None;
|
39
|
-
let
|
40
|
+
let render_output = html_to_image(&html, base_url, options, &mut logger).await;
|
40
41
|
|
41
42
|
// Determine output path, and open a file at that path.
|
42
43
|
let mut output_buffer: Vec<u8> = Vec::new();
|
43
44
|
|
44
45
|
// Encode buffer as PNG and write it to a file
|
45
|
-
write_png(&mut output_buffer, &
|
46
|
+
write_png(&mut output_buffer, &render_output.buffer, render_output.image_size.scaled_width(), render_output.image_size.scaled_height())?;
|
47
|
+
|
48
|
+
Ok(output_buffer)
|
49
|
+
}
|
46
50
|
|
47
|
-
|
51
|
+
pub fn render_blocking_rb(ruby: &Ruby, html: String) -> Result<magnus::RString, magnus::Error> {
|
52
|
+
let exception_class = ExceptionClass::from_value(magnus::eval("Himg::Error").unwrap()).unwrap();
|
53
|
+
|
54
|
+
match render_blocking(html) {
|
55
|
+
Ok(data) => Ok(ruby.str_from_slice(&data)),
|
56
|
+
Err(e) => Err(Error::new(exception_class, format!("{}", e))),
|
57
|
+
}
|
48
58
|
}
|
49
59
|
|
50
60
|
#[magnus::init]
|
@@ -52,7 +62,8 @@ fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
52
62
|
let module = ruby.define_module("Himg")?;
|
53
63
|
|
54
64
|
//TODO: Allow optional base_url for resolving linked resources (stylesheets, images, fonts, etc)
|
55
|
-
module.define_singleton_method("render", function!(
|
65
|
+
module.define_singleton_method("render", function!(render_blocking_rb, 1))?;
|
66
|
+
|
56
67
|
Ok(())
|
57
68
|
}
|
58
69
|
|
data/ext/himg/src/writer.rs
CHANGED
@@ -4,9 +4,9 @@ use png::{Encoder, ColorType, BitDepth, PixelDimensions, Unit};
|
|
4
4
|
const INCHES_PER_METER: f64 = 39.3701;
|
5
5
|
const DEFAULT_DPI: f64 = 144.0;
|
6
6
|
|
7
|
-
pub fn write_png<W: Write>(writer: W, buffer: &[u8], width: u32, height: u32) {
|
7
|
+
pub fn write_png<W: Write>(writer: W, buffer: &[u8], width: u32, height: u32) -> Result<(), std::io::Error> {
|
8
8
|
let encoder = create_encoder(writer, width, height, DEFAULT_DPI);
|
9
|
-
write_data(encoder, buffer)
|
9
|
+
write_data(encoder, buffer)
|
10
10
|
}
|
11
11
|
|
12
12
|
fn create_encoder<'a, W: Write>(writer: W, width: u32, height: u32, dpi: f64) -> Encoder<'a, W> {
|
@@ -24,10 +24,11 @@ fn create_encoder<'a, W: Write>(writer: W, width: u32, height: u32, dpi: f64) ->
|
|
24
24
|
encoder
|
25
25
|
}
|
26
26
|
|
27
|
-
fn write_data<W: Write>(encoder: Encoder<W>, buffer: &[u8]) {
|
28
|
-
|
29
|
-
let mut writer = encoder.write_header().unwrap();
|
27
|
+
fn write_data<W: Write>(encoder: Encoder<W>, buffer: &[u8]) -> Result<(), std::io::Error> {
|
28
|
+
let mut writer = encoder.write_header()?;
|
30
29
|
|
31
|
-
writer.write_image_data(buffer)
|
32
|
-
writer.finish()
|
30
|
+
writer.write_image_data(buffer)?;
|
31
|
+
writer.finish()?;
|
32
|
+
|
33
|
+
Ok(())
|
33
34
|
}
|
data/gemfiles/plain_ruby.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -28,10 +28,14 @@ GEM
|
|
28
28
|
base64 (0.2.0)
|
29
29
|
benchmark (0.4.0)
|
30
30
|
bigdecimal (3.1.9)
|
31
|
+
bump (0.10.0)
|
31
32
|
concurrent-ruby (1.3.5)
|
32
33
|
connection_pool (2.5.1)
|
33
34
|
csv (3.3.4)
|
34
35
|
date (3.4.1)
|
36
|
+
debug (1.10.0)
|
37
|
+
irb (~> 1.10)
|
38
|
+
reline (>= 0.3.8)
|
35
39
|
diff-lcs (1.6.1)
|
36
40
|
drb (2.2.1)
|
37
41
|
ffi (1.17.2)
|
@@ -118,24 +122,8 @@ GEM
|
|
118
122
|
rubocop-ast (1.44.1)
|
119
123
|
parser (>= 3.3.7.2)
|
120
124
|
prism (~> 1.4)
|
121
|
-
rubocop-performance (1.25.0)
|
122
|
-
lint_roller (~> 1.1)
|
123
|
-
rubocop (>= 1.75.0, < 2.0)
|
124
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
125
125
|
ruby-progressbar (1.13.0)
|
126
126
|
securerandom (0.4.1)
|
127
|
-
standard (1.49.0)
|
128
|
-
language_server-protocol (~> 3.17.0.2)
|
129
|
-
lint_roller (~> 1.0)
|
130
|
-
rubocop (~> 1.75.2)
|
131
|
-
standard-custom (~> 1.0.0)
|
132
|
-
standard-performance (~> 1.8)
|
133
|
-
standard-custom (1.0.2)
|
134
|
-
lint_roller (~> 1.0)
|
135
|
-
rubocop (~> 1.50)
|
136
|
-
standard-performance (1.8.0)
|
137
|
-
lint_roller (~> 1.1)
|
138
|
-
rubocop-performance (~> 1.25.0)
|
139
127
|
steep (1.10.0)
|
140
128
|
activesupport (>= 5.1)
|
141
129
|
concurrent-ruby (>= 1.1.10)
|
@@ -171,7 +159,6 @@ PLATFORMS
|
|
171
159
|
arm-linux-gnu
|
172
160
|
arm-linux-musl
|
173
161
|
arm64-darwin
|
174
|
-
ruby
|
175
162
|
x86-linux-gnu
|
176
163
|
x86-linux-musl
|
177
164
|
x86_64-darwin
|
@@ -180,12 +167,14 @@ PLATFORMS
|
|
180
167
|
|
181
168
|
DEPENDENCIES
|
182
169
|
appraisal
|
170
|
+
bump
|
171
|
+
debug
|
183
172
|
himg!
|
184
173
|
irb
|
185
|
-
rake
|
174
|
+
rake
|
186
175
|
rake-compiler
|
187
|
-
rspec
|
188
|
-
|
176
|
+
rspec
|
177
|
+
rubocop
|
189
178
|
steep
|
190
179
|
|
191
180
|
BUNDLED WITH
|
data/gemfiles/rails_6.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -74,10 +74,14 @@ GEM
|
|
74
74
|
base64 (0.2.0)
|
75
75
|
bigdecimal (1.4.4)
|
76
76
|
builder (3.3.0)
|
77
|
+
bump (0.10.0)
|
77
78
|
concurrent-ruby (1.3.4)
|
78
79
|
crass (1.0.6)
|
79
80
|
csv (3.3.4)
|
80
81
|
date (3.4.1)
|
82
|
+
debug (1.10.0)
|
83
|
+
irb (~> 1.10)
|
84
|
+
reline (>= 0.3.8)
|
81
85
|
diff-lcs (1.6.1)
|
82
86
|
drb (2.2.1)
|
83
87
|
erubi (1.13.1)
|
@@ -129,21 +133,21 @@ GEM
|
|
129
133
|
net-smtp (0.5.1)
|
130
134
|
net-protocol
|
131
135
|
nio4r (2.7.4)
|
132
|
-
nokogiri (1.18.
|
136
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
133
137
|
racc (~> 1.4)
|
134
|
-
nokogiri (1.18.
|
138
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
135
139
|
racc (~> 1.4)
|
136
|
-
nokogiri (1.18.
|
140
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
137
141
|
racc (~> 1.4)
|
138
|
-
nokogiri (1.18.
|
142
|
+
nokogiri (1.18.8-arm-linux-musl)
|
139
143
|
racc (~> 1.4)
|
140
|
-
nokogiri (1.18.
|
144
|
+
nokogiri (1.18.8-arm64-darwin)
|
141
145
|
racc (~> 1.4)
|
142
|
-
nokogiri (1.18.
|
146
|
+
nokogiri (1.18.8-x86_64-darwin)
|
143
147
|
racc (~> 1.4)
|
144
|
-
nokogiri (1.18.
|
148
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
145
149
|
racc (~> 1.4)
|
146
|
-
nokogiri (1.18.
|
150
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
147
151
|
racc (~> 1.4)
|
148
152
|
parallel (1.27.0)
|
149
153
|
parser (3.3.8.0)
|
@@ -240,10 +244,6 @@ GEM
|
|
240
244
|
rubocop-ast (1.44.1)
|
241
245
|
parser (>= 3.3.7.2)
|
242
246
|
prism (~> 1.4)
|
243
|
-
rubocop-performance (1.25.0)
|
244
|
-
lint_roller (~> 1.1)
|
245
|
-
rubocop (>= 1.75.0, < 2.0)
|
246
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
247
247
|
ruby-progressbar (1.13.0)
|
248
248
|
securerandom (0.4.1)
|
249
249
|
sprockets (4.2.2)
|
@@ -254,18 +254,6 @@ GEM
|
|
254
254
|
actionpack (>= 6.1)
|
255
255
|
activesupport (>= 6.1)
|
256
256
|
sprockets (>= 3.0.0)
|
257
|
-
standard (1.49.0)
|
258
|
-
language_server-protocol (~> 3.17.0.2)
|
259
|
-
lint_roller (~> 1.0)
|
260
|
-
rubocop (~> 1.75.2)
|
261
|
-
standard-custom (~> 1.0.0)
|
262
|
-
standard-performance (~> 1.8)
|
263
|
-
standard-custom (1.0.2)
|
264
|
-
lint_roller (~> 1.0)
|
265
|
-
rubocop (~> 1.50)
|
266
|
-
standard-performance (1.8.0)
|
267
|
-
lint_roller (~> 1.1)
|
268
|
-
rubocop-performance (~> 1.25.0)
|
269
257
|
steep (1.10.0)
|
270
258
|
activesupport (>= 5.1)
|
271
259
|
concurrent-ruby (>= 1.1.10)
|
@@ -314,16 +302,18 @@ PLATFORMS
|
|
314
302
|
DEPENDENCIES
|
315
303
|
appraisal
|
316
304
|
bigdecimal (~> 1.4)
|
305
|
+
bump
|
317
306
|
concurrent-ruby (= 1.3.4)
|
307
|
+
debug
|
318
308
|
drb
|
319
309
|
himg!
|
320
310
|
irb
|
321
311
|
rails (~> 6.0)
|
322
|
-
rake
|
312
|
+
rake
|
323
313
|
rake-compiler
|
324
|
-
rspec
|
314
|
+
rspec
|
325
315
|
rspec-rails (~> 6.0)
|
326
|
-
|
316
|
+
rubocop
|
327
317
|
steep
|
328
318
|
|
329
319
|
BUNDLED WITH
|
data/gemfiles/rails_7_0.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -80,10 +80,14 @@ GEM
|
|
80
80
|
base64 (0.2.0)
|
81
81
|
bigdecimal (1.4.4)
|
82
82
|
builder (3.3.0)
|
83
|
+
bump (0.10.0)
|
83
84
|
concurrent-ruby (1.3.4)
|
84
85
|
crass (1.0.6)
|
85
86
|
csv (3.3.4)
|
86
87
|
date (3.4.1)
|
88
|
+
debug (1.10.0)
|
89
|
+
irb (~> 1.10)
|
90
|
+
reline (>= 0.3.8)
|
87
91
|
diff-lcs (1.6.1)
|
88
92
|
drb (2.2.1)
|
89
93
|
erubi (1.13.1)
|
@@ -135,21 +139,21 @@ GEM
|
|
135
139
|
net-smtp (0.5.1)
|
136
140
|
net-protocol
|
137
141
|
nio4r (2.7.4)
|
138
|
-
nokogiri (1.18.
|
142
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
139
143
|
racc (~> 1.4)
|
140
|
-
nokogiri (1.18.
|
144
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
141
145
|
racc (~> 1.4)
|
142
|
-
nokogiri (1.18.
|
146
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
143
147
|
racc (~> 1.4)
|
144
|
-
nokogiri (1.18.
|
148
|
+
nokogiri (1.18.8-arm-linux-musl)
|
145
149
|
racc (~> 1.4)
|
146
|
-
nokogiri (1.18.
|
150
|
+
nokogiri (1.18.8-arm64-darwin)
|
147
151
|
racc (~> 1.4)
|
148
|
-
nokogiri (1.18.
|
152
|
+
nokogiri (1.18.8-x86_64-darwin)
|
149
153
|
racc (~> 1.4)
|
150
|
-
nokogiri (1.18.
|
154
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
151
155
|
racc (~> 1.4)
|
152
|
-
nokogiri (1.18.
|
156
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
153
157
|
racc (~> 1.4)
|
154
158
|
parallel (1.27.0)
|
155
159
|
parser (3.3.8.0)
|
@@ -246,24 +250,8 @@ GEM
|
|
246
250
|
rubocop-ast (1.44.1)
|
247
251
|
parser (>= 3.3.7.2)
|
248
252
|
prism (~> 1.4)
|
249
|
-
rubocop-performance (1.25.0)
|
250
|
-
lint_roller (~> 1.1)
|
251
|
-
rubocop (>= 1.75.0, < 2.0)
|
252
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
253
253
|
ruby-progressbar (1.13.0)
|
254
254
|
securerandom (0.4.1)
|
255
|
-
standard (1.49.0)
|
256
|
-
language_server-protocol (~> 3.17.0.2)
|
257
|
-
lint_roller (~> 1.0)
|
258
|
-
rubocop (~> 1.75.2)
|
259
|
-
standard-custom (~> 1.0.0)
|
260
|
-
standard-performance (~> 1.8)
|
261
|
-
standard-custom (1.0.2)
|
262
|
-
lint_roller (~> 1.0)
|
263
|
-
rubocop (~> 1.50)
|
264
|
-
standard-performance (1.8.0)
|
265
|
-
lint_roller (~> 1.1)
|
266
|
-
rubocop-performance (~> 1.25.0)
|
267
255
|
steep (1.10.0)
|
268
256
|
activesupport (>= 5.1)
|
269
257
|
concurrent-ruby (>= 1.1.10)
|
@@ -312,16 +300,18 @@ PLATFORMS
|
|
312
300
|
DEPENDENCIES
|
313
301
|
appraisal
|
314
302
|
bigdecimal (~> 1.4)
|
303
|
+
bump
|
315
304
|
concurrent-ruby (= 1.3.4)
|
305
|
+
debug
|
316
306
|
drb
|
317
307
|
himg!
|
318
308
|
irb
|
319
309
|
rails (~> 7.0.0)
|
320
|
-
rake
|
310
|
+
rake
|
321
311
|
rake-compiler
|
322
|
-
rspec
|
312
|
+
rspec
|
323
313
|
rspec-rails (~> 7.0)
|
324
|
-
|
314
|
+
rubocop
|
325
315
|
steep
|
326
316
|
|
327
317
|
BUNDLED WITH
|
data/gemfiles/rails_7_1.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -93,11 +93,15 @@ GEM
|
|
93
93
|
benchmark (0.4.0)
|
94
94
|
bigdecimal (3.1.9)
|
95
95
|
builder (3.3.0)
|
96
|
+
bump (0.10.0)
|
96
97
|
concurrent-ruby (1.3.5)
|
97
98
|
connection_pool (2.5.1)
|
98
99
|
crass (1.0.6)
|
99
100
|
csv (3.3.4)
|
100
101
|
date (3.4.1)
|
102
|
+
debug (1.10.0)
|
103
|
+
irb (~> 1.10)
|
104
|
+
reline (>= 0.3.8)
|
101
105
|
diff-lcs (1.6.1)
|
102
106
|
drb (2.2.1)
|
103
107
|
erubi (1.13.1)
|
@@ -148,21 +152,21 @@ GEM
|
|
148
152
|
net-smtp (0.5.1)
|
149
153
|
net-protocol
|
150
154
|
nio4r (2.7.4)
|
151
|
-
nokogiri (1.18.
|
155
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
152
156
|
racc (~> 1.4)
|
153
|
-
nokogiri (1.18.
|
157
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
154
158
|
racc (~> 1.4)
|
155
|
-
nokogiri (1.18.
|
159
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
156
160
|
racc (~> 1.4)
|
157
|
-
nokogiri (1.18.
|
161
|
+
nokogiri (1.18.8-arm-linux-musl)
|
158
162
|
racc (~> 1.4)
|
159
|
-
nokogiri (1.18.
|
163
|
+
nokogiri (1.18.8-arm64-darwin)
|
160
164
|
racc (~> 1.4)
|
161
|
-
nokogiri (1.18.
|
165
|
+
nokogiri (1.18.8-x86_64-darwin)
|
162
166
|
racc (~> 1.4)
|
163
|
-
nokogiri (1.18.
|
167
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
164
168
|
racc (~> 1.4)
|
165
|
-
nokogiri (1.18.
|
169
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
166
170
|
racc (~> 1.4)
|
167
171
|
parallel (1.27.0)
|
168
172
|
parser (3.3.8.0)
|
@@ -265,24 +269,8 @@ GEM
|
|
265
269
|
rubocop-ast (1.44.1)
|
266
270
|
parser (>= 3.3.7.2)
|
267
271
|
prism (~> 1.4)
|
268
|
-
rubocop-performance (1.25.0)
|
269
|
-
lint_roller (~> 1.1)
|
270
|
-
rubocop (>= 1.75.0, < 2.0)
|
271
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
272
272
|
ruby-progressbar (1.13.0)
|
273
273
|
securerandom (0.4.1)
|
274
|
-
standard (1.49.0)
|
275
|
-
language_server-protocol (~> 3.17.0.2)
|
276
|
-
lint_roller (~> 1.0)
|
277
|
-
rubocop (~> 1.75.2)
|
278
|
-
standard-custom (~> 1.0.0)
|
279
|
-
standard-performance (~> 1.8)
|
280
|
-
standard-custom (1.0.2)
|
281
|
-
lint_roller (~> 1.0)
|
282
|
-
rubocop (~> 1.50)
|
283
|
-
standard-performance (1.8.0)
|
284
|
-
lint_roller (~> 1.1)
|
285
|
-
rubocop-performance (~> 1.25.0)
|
286
274
|
steep (1.10.0)
|
287
275
|
activesupport (>= 5.1)
|
288
276
|
concurrent-ruby (>= 1.1.10)
|
@@ -330,14 +318,16 @@ PLATFORMS
|
|
330
318
|
|
331
319
|
DEPENDENCIES
|
332
320
|
appraisal
|
321
|
+
bump
|
322
|
+
debug
|
333
323
|
himg!
|
334
324
|
irb
|
335
325
|
rails (~> 7.1.0)
|
336
|
-
rake
|
326
|
+
rake
|
337
327
|
rake-compiler
|
338
|
-
rspec
|
328
|
+
rspec
|
339
329
|
rspec-rails (~> 7.0)
|
340
|
-
|
330
|
+
rubocop
|
341
331
|
steep
|
342
332
|
|
343
333
|
BUNDLED WITH
|
data/gemfiles/rails_7_2.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -87,11 +87,15 @@ GEM
|
|
87
87
|
benchmark (0.4.0)
|
88
88
|
bigdecimal (3.1.9)
|
89
89
|
builder (3.3.0)
|
90
|
+
bump (0.10.0)
|
90
91
|
concurrent-ruby (1.3.5)
|
91
92
|
connection_pool (2.5.1)
|
92
93
|
crass (1.0.6)
|
93
94
|
csv (3.3.4)
|
94
95
|
date (3.4.1)
|
96
|
+
debug (1.10.0)
|
97
|
+
irb (~> 1.10)
|
98
|
+
reline (>= 0.3.8)
|
95
99
|
diff-lcs (1.6.1)
|
96
100
|
drb (2.2.1)
|
97
101
|
erubi (1.13.1)
|
@@ -142,21 +146,21 @@ GEM
|
|
142
146
|
net-smtp (0.5.1)
|
143
147
|
net-protocol
|
144
148
|
nio4r (2.7.4)
|
145
|
-
nokogiri (1.18.
|
149
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
146
150
|
racc (~> 1.4)
|
147
|
-
nokogiri (1.18.
|
151
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
148
152
|
racc (~> 1.4)
|
149
|
-
nokogiri (1.18.
|
153
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
150
154
|
racc (~> 1.4)
|
151
|
-
nokogiri (1.18.
|
155
|
+
nokogiri (1.18.8-arm-linux-musl)
|
152
156
|
racc (~> 1.4)
|
153
|
-
nokogiri (1.18.
|
157
|
+
nokogiri (1.18.8-arm64-darwin)
|
154
158
|
racc (~> 1.4)
|
155
|
-
nokogiri (1.18.
|
159
|
+
nokogiri (1.18.8-x86_64-darwin)
|
156
160
|
racc (~> 1.4)
|
157
|
-
nokogiri (1.18.
|
161
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
158
162
|
racc (~> 1.4)
|
159
|
-
nokogiri (1.18.
|
163
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
160
164
|
racc (~> 1.4)
|
161
165
|
parallel (1.27.0)
|
162
166
|
parser (3.3.8.0)
|
@@ -259,24 +263,8 @@ GEM
|
|
259
263
|
rubocop-ast (1.44.1)
|
260
264
|
parser (>= 3.3.7.2)
|
261
265
|
prism (~> 1.4)
|
262
|
-
rubocop-performance (1.25.0)
|
263
|
-
lint_roller (~> 1.1)
|
264
|
-
rubocop (>= 1.75.0, < 2.0)
|
265
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
266
266
|
ruby-progressbar (1.13.0)
|
267
267
|
securerandom (0.4.1)
|
268
|
-
standard (1.49.0)
|
269
|
-
language_server-protocol (~> 3.17.0.2)
|
270
|
-
lint_roller (~> 1.0)
|
271
|
-
rubocop (~> 1.75.2)
|
272
|
-
standard-custom (~> 1.0.0)
|
273
|
-
standard-performance (~> 1.8)
|
274
|
-
standard-custom (1.0.2)
|
275
|
-
lint_roller (~> 1.0)
|
276
|
-
rubocop (~> 1.50)
|
277
|
-
standard-performance (1.8.0)
|
278
|
-
lint_roller (~> 1.1)
|
279
|
-
rubocop-performance (~> 1.25.0)
|
280
268
|
steep (1.10.0)
|
281
269
|
activesupport (>= 5.1)
|
282
270
|
concurrent-ruby (>= 1.1.10)
|
@@ -325,14 +313,16 @@ PLATFORMS
|
|
325
313
|
|
326
314
|
DEPENDENCIES
|
327
315
|
appraisal
|
316
|
+
bump
|
317
|
+
debug
|
328
318
|
himg!
|
329
319
|
irb
|
330
320
|
rails (~> 7.2.0)
|
331
|
-
rake
|
321
|
+
rake
|
332
322
|
rake-compiler
|
333
|
-
rspec
|
323
|
+
rspec
|
334
324
|
rspec-rails (~> 7.0)
|
335
|
-
|
325
|
+
rubocop
|
336
326
|
steep
|
337
327
|
|
338
328
|
BUNDLED WITH
|
data/gemfiles/rails_8.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
himg (0.0.
|
4
|
+
himg (0.0.2)
|
5
5
|
rb_sys (~> 0.9)
|
6
6
|
|
7
7
|
GEM
|
@@ -87,11 +87,15 @@ GEM
|
|
87
87
|
benchmark (0.4.0)
|
88
88
|
bigdecimal (3.1.9)
|
89
89
|
builder (3.3.0)
|
90
|
+
bump (0.10.0)
|
90
91
|
concurrent-ruby (1.3.5)
|
91
92
|
connection_pool (2.5.1)
|
92
93
|
crass (1.0.6)
|
93
94
|
csv (3.3.4)
|
94
95
|
date (3.4.1)
|
96
|
+
debug (1.10.0)
|
97
|
+
irb (~> 1.10)
|
98
|
+
reline (>= 0.3.8)
|
95
99
|
diff-lcs (1.6.1)
|
96
100
|
drb (2.2.1)
|
97
101
|
erubi (1.13.1)
|
@@ -142,21 +146,21 @@ GEM
|
|
142
146
|
net-smtp (0.5.1)
|
143
147
|
net-protocol
|
144
148
|
nio4r (2.7.4)
|
145
|
-
nokogiri (1.18.
|
149
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
146
150
|
racc (~> 1.4)
|
147
|
-
nokogiri (1.18.
|
151
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
148
152
|
racc (~> 1.4)
|
149
|
-
nokogiri (1.18.
|
153
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
150
154
|
racc (~> 1.4)
|
151
|
-
nokogiri (1.18.
|
155
|
+
nokogiri (1.18.8-arm-linux-musl)
|
152
156
|
racc (~> 1.4)
|
153
|
-
nokogiri (1.18.
|
157
|
+
nokogiri (1.18.8-arm64-darwin)
|
154
158
|
racc (~> 1.4)
|
155
|
-
nokogiri (1.18.
|
159
|
+
nokogiri (1.18.8-x86_64-darwin)
|
156
160
|
racc (~> 1.4)
|
157
|
-
nokogiri (1.18.
|
161
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
158
162
|
racc (~> 1.4)
|
159
|
-
nokogiri (1.18.
|
163
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
160
164
|
racc (~> 1.4)
|
161
165
|
parallel (1.27.0)
|
162
166
|
parser (3.3.8.0)
|
@@ -259,24 +263,8 @@ GEM
|
|
259
263
|
rubocop-ast (1.44.1)
|
260
264
|
parser (>= 3.3.7.2)
|
261
265
|
prism (~> 1.4)
|
262
|
-
rubocop-performance (1.25.0)
|
263
|
-
lint_roller (~> 1.1)
|
264
|
-
rubocop (>= 1.75.0, < 2.0)
|
265
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
266
266
|
ruby-progressbar (1.13.0)
|
267
267
|
securerandom (0.4.1)
|
268
|
-
standard (1.49.0)
|
269
|
-
language_server-protocol (~> 3.17.0.2)
|
270
|
-
lint_roller (~> 1.0)
|
271
|
-
rubocop (~> 1.75.2)
|
272
|
-
standard-custom (~> 1.0.0)
|
273
|
-
standard-performance (~> 1.8)
|
274
|
-
standard-custom (1.0.2)
|
275
|
-
lint_roller (~> 1.0)
|
276
|
-
rubocop (~> 1.50)
|
277
|
-
standard-performance (1.8.0)
|
278
|
-
lint_roller (~> 1.1)
|
279
|
-
rubocop-performance (~> 1.25.0)
|
280
268
|
steep (1.10.0)
|
281
269
|
activesupport (>= 5.1)
|
282
270
|
concurrent-ruby (>= 1.1.10)
|
@@ -325,14 +313,16 @@ PLATFORMS
|
|
325
313
|
|
326
314
|
DEPENDENCIES
|
327
315
|
appraisal
|
316
|
+
bump
|
317
|
+
debug
|
328
318
|
himg!
|
329
319
|
irb
|
330
320
|
rails (~> 8.0)
|
331
|
-
rake
|
321
|
+
rake
|
332
322
|
rake-compiler
|
333
|
-
rspec
|
323
|
+
rspec
|
334
324
|
rspec-rails (~> 7.0)
|
335
|
-
|
325
|
+
rubocop
|
336
326
|
steep
|
337
327
|
|
338
328
|
BUNDLED WITH
|
@@ -1,13 +1,17 @@
|
|
1
1
|
module Himg
|
2
2
|
class Railtie
|
3
|
+
# Handles .himg templates by calling through to Himg.render
|
3
4
|
class TemplateHandler
|
4
|
-
def self.call(
|
5
|
+
def self.call(_template, source)
|
5
6
|
<<-CODE
|
6
|
-
Himg.render(#{source.inspect})
|
7
|
+
Himg.render(#{source.inspect})
|
7
8
|
CODE
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
12
|
+
# Handles .himg.erb templates by pre-processing with Erb, possibly appending
|
13
|
+
# to @output_buffer or calling .safe_append, and then passing the result to
|
14
|
+
# Himg.render
|
11
15
|
class ErbTemplateHandler
|
12
16
|
def self.call(template, source)
|
13
17
|
erb_handler = ActionView::Template.registered_template_handler(:erb)
|
@@ -17,7 +21,7 @@ module Himg
|
|
17
21
|
output = begin
|
18
22
|
#{preprocessed_view_code}
|
19
23
|
end
|
20
|
-
Himg.render(output)
|
24
|
+
Himg.render(output)
|
21
25
|
CODE
|
22
26
|
end
|
23
27
|
end
|
@@ -25,4 +29,4 @@ module Himg
|
|
25
29
|
end
|
26
30
|
|
27
31
|
ActionView::Template.register_template_handler :himg, Himg::Railtie::TemplateHandler
|
28
|
-
ActionView::Template.register_template_handler
|
32
|
+
ActionView::Template.register_template_handler "himg.erb", Himg::Railtie::ErbTemplateHandler
|
data/lib/himg/railtie.rb
CHANGED
@@ -1,8 +1,26 @@
|
|
1
1
|
module Himg
|
2
|
+
# Himg::Railtie
|
3
|
+
#
|
4
|
+
# Allows you to render Png images directly from rails using HTML based templates.
|
5
|
+
#
|
6
|
+
# View templates can be registered with `.himg` and will be converted from
|
7
|
+
# HTML to an image, or with `.himg.erb` to insert dynamic content. A renderer
|
8
|
+
# also allows direct rendering of HTML without going through a template.
|
9
|
+
#
|
10
|
+
# Example usage:
|
11
|
+
# - `show.himg.erb` renders an image based on controller data.
|
12
|
+
# - `render himg: '<div>My Data</div>'` generates an image from HTML.
|
13
|
+
#
|
14
|
+
# This works by registering a template handler, which will be called by Rails'
|
15
|
+
# default_render method when a view template exists matching the current action
|
16
|
+
# in a request where the format extension is .himg or a png is requested.
|
17
|
+
#
|
18
|
+
# The direct render works similarly, but instead of checking the request format
|
19
|
+
# it looks for the :himg key passed into a Rails render function.
|
2
20
|
class Railtie < Rails::Railtie
|
3
21
|
initializer "himg.configure_rails_initialization" do
|
4
22
|
ActiveSupport.on_load(:action_view) do
|
5
|
-
require
|
23
|
+
require "himg/railtie/template_handler"
|
6
24
|
end
|
7
25
|
end
|
8
26
|
|
@@ -11,9 +29,9 @@ module Himg
|
|
11
29
|
end
|
12
30
|
|
13
31
|
initializer "himg.controller_renderer" do
|
14
|
-
ActionController::Renderers.add :himg do |obj,
|
32
|
+
ActionController::Renderers.add :himg do |obj, _options|
|
15
33
|
png_data = Himg.render(obj)
|
16
|
-
send_data png_data
|
34
|
+
send_data png_data, type: "image/png", disposition: "inline"
|
17
35
|
end
|
18
36
|
end
|
19
37
|
end
|
data/lib/himg/version.rb
CHANGED
data/lib/himg.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: himg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Edwards-Jones
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
41
|
+
name: bump
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
@@ -52,21 +52,7 @@ dependencies:
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
56
|
-
requirement: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
61
|
-
type: :development
|
62
|
-
prerelease: false
|
63
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0'
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: rake-compiler
|
55
|
+
name: debug
|
70
56
|
requirement: !ruby/object:Gem::Requirement
|
71
57
|
requirements:
|
72
58
|
- - ">="
|
@@ -80,7 +66,7 @@ dependencies:
|
|
80
66
|
- !ruby/object:Gem::Version
|
81
67
|
version: '0'
|
82
68
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
69
|
+
name: irb
|
84
70
|
requirement: !ruby/object:Gem::Requirement
|
85
71
|
requirements:
|
86
72
|
- - ">="
|
@@ -94,7 +80,7 @@ dependencies:
|
|
94
80
|
- !ruby/object:Gem::Version
|
95
81
|
version: '0'
|
96
82
|
- !ruby/object:Gem::Dependency
|
97
|
-
name:
|
83
|
+
name: rake
|
98
84
|
requirement: !ruby/object:Gem::Requirement
|
99
85
|
requirements:
|
100
86
|
- - ">="
|
@@ -108,7 +94,7 @@ dependencies:
|
|
108
94
|
- !ruby/object:Gem::Version
|
109
95
|
version: '0'
|
110
96
|
- !ruby/object:Gem::Dependency
|
111
|
-
name:
|
97
|
+
name: rake-compiler
|
112
98
|
requirement: !ruby/object:Gem::Requirement
|
113
99
|
requirements:
|
114
100
|
- - ">="
|
@@ -122,7 +108,7 @@ dependencies:
|
|
122
108
|
- !ruby/object:Gem::Version
|
123
109
|
version: '0'
|
124
110
|
- !ruby/object:Gem::Dependency
|
125
|
-
name:
|
111
|
+
name: rspec
|
126
112
|
requirement: !ruby/object:Gem::Requirement
|
127
113
|
requirements:
|
128
114
|
- - ">="
|
@@ -136,7 +122,7 @@ dependencies:
|
|
136
122
|
- !ruby/object:Gem::Version
|
137
123
|
version: '0'
|
138
124
|
- !ruby/object:Gem::Dependency
|
139
|
-
name:
|
125
|
+
name: rubocop
|
140
126
|
requirement: !ruby/object:Gem::Requirement
|
141
127
|
requirements:
|
142
128
|
- - ">="
|
@@ -150,7 +136,7 @@ dependencies:
|
|
150
136
|
- !ruby/object:Gem::Version
|
151
137
|
version: '0'
|
152
138
|
- !ruby/object:Gem::Dependency
|
153
|
-
name:
|
139
|
+
name: steep
|
154
140
|
requirement: !ruby/object:Gem::Requirement
|
155
141
|
requirements:
|
156
142
|
- - ">="
|
@@ -163,7 +149,7 @@ dependencies:
|
|
163
149
|
- - ">="
|
164
150
|
- !ruby/object:Gem::Version
|
165
151
|
version: '0'
|
166
|
-
description:
|
152
|
+
description: You give it HTML and it renders an Image!
|
167
153
|
email:
|
168
154
|
- git@jamedjo.co.uk
|
169
155
|
executables: []
|
@@ -172,8 +158,8 @@ extensions:
|
|
172
158
|
extra_rdoc_files: []
|
173
159
|
files:
|
174
160
|
- ".rspec"
|
161
|
+
- ".rubocop.yml"
|
175
162
|
- ".ruby-version"
|
176
|
-
- ".standard.yml"
|
177
163
|
- Appraisals
|
178
164
|
- CHANGELOG.md
|
179
165
|
- Cargo.lock
|
@@ -212,7 +198,6 @@ files:
|
|
212
198
|
- lib/himg/railtie/template_handler.rb
|
213
199
|
- lib/himg/version.rb
|
214
200
|
- sig/himg.rbs
|
215
|
-
- test.html.rbd
|
216
201
|
homepage: https://github.com/Jamedjo/Himg
|
217
202
|
licenses:
|
218
203
|
- MIT
|
data/.standard.yml
DELETED