ruby_rqrr 0.9.0.1 → 0.9.3.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.
data/README.md CHANGED
@@ -4,7 +4,9 @@ RubyRqrr (Ruby RQ'er) is a Ruby gem that provides a simple interface to scan ima
4
4
 
5
5
  ## Installation
6
6
 
7
- Install the gem and add to the application's Gemfile by executing:
7
+ At this time, this gem requires the Rust toolchain to be installed. If you do not have Rust installed, you can install it by following the instructions at [rustup.rs](https://rustup.rs/).
8
+
9
+ We will be working on releasing precompiled binaries in the future to remove this requirement for most users.
8
10
 
9
11
  ```bash
10
12
  bundle add ruby_rqrr
@@ -1,16 +1,21 @@
1
1
  [package]
2
2
  name = "ruby_rqrr"
3
- version = "0.9.0-1"
3
+ version = "0.9.2"
4
4
  edition = "2021"
5
+ rust-version = "1.86.0"
5
6
  authors = ["Shawn Jordan <shawn.jordan@me.com>"]
6
7
  license = "MIT"
7
8
  publish = false
8
9
 
9
10
  [lib]
11
+ name = "ruby_rqrr"
10
12
  crate-type = ["cdylib"]
11
13
 
12
14
  [dependencies]
13
- image = { version ="0.25.5" }
14
- magnus = { version = "0.6.2" }
15
- rqrr = { version = "0.9.0"}
15
+ image = { version ="0.25.6", default-features = false, features = ["png", "jpeg", "gif"] }
16
+ magnus = { version = "0.7.1", features = ["rb-sys"] }
17
+ rb-sys = { version = "*", default-features = false, features = [
18
+ "stable-api-compiled-fallback",
19
+ ] }
20
+ rqrr = { version = "0.9.3"}
16
21
  url = { version = "2.5.4" }
@@ -1,10 +1,7 @@
1
- use image;
2
1
  use magnus::{
3
2
  exception, exception::ExceptionClass, function, prelude::*, value::Lazy, Error, RArray,
4
3
  RModule, Ruby,
5
4
  };
6
- use rqrr;
7
- use std::path::Path;
8
5
 
9
6
  static RUBY_RQRR: Lazy<RModule> = Lazy::new(|ruby| ruby.define_module("RubyRqrr").unwrap());
10
7
 
@@ -20,13 +17,25 @@ static QR_PARSE_ERROR: Lazy<ExceptionClass> = Lazy::new(|ruby| {
20
17
  .unwrap()
21
18
  });
22
19
 
20
+ fn version() -> String {
21
+ env!("CARGO_PKG_VERSION").to_string()
22
+ }
23
+
23
24
  fn detect_qrs_in_image(ruby: &Ruby, file_path: String) -> Result<RArray, Error> {
24
25
  // Load the image
25
- let img_file = image::open(Path::new(&file_path))
26
- .map_err(|e| Error::new(exception::io_error(), e.to_string()))?
26
+ let img = image::ImageReader::open(&file_path)
27
+ .map_err(|e| Error::new(exception::io_error(), format!("Failed to open image: {e}")))?
28
+ .decode()
29
+ .map_err(|e| {
30
+ Error::new(
31
+ exception::io_error(),
32
+ format!("Failed to decode image: {e}"),
33
+ )
34
+ })?
27
35
  .to_luma8();
28
- let mut img = rqrr::PreparedImage::prepare(img_file);
29
- let grids = img.detect_grids();
36
+
37
+ let mut prepared_img = rqrr::PreparedImage::prepare(img);
38
+ let grids = prepared_img.detect_grids();
30
39
  let urls = RArray::new();
31
40
 
32
41
  for grid in grids {
@@ -43,5 +52,7 @@ fn init(ruby: &Ruby) -> Result<(), Error> {
43
52
  Lazy::force(&QR_PARSE_ERROR, ruby);
44
53
  ruby.get_inner(&RUBY_RQRR)
45
54
  .define_singleton_method("detect_qrs_in_image", function!(detect_qrs_in_image, 1))?;
55
+ ruby.get_inner(&RUBY_RQRR)
56
+ .define_singleton_method("version", function!(version, 0))?;
46
57
  Ok(())
47
58
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyRqrr
4
- VERSION = "0.9.0.1"
4
+ VERSION = "0.9.3.1"
5
5
  end
data/mise.toml CHANGED
@@ -1,3 +1,3 @@
1
1
  [tools]
2
- ruby = "3.4.1"
3
- rust = "1.85.1"
2
+ ruby = "3.4.5"
3
+ rust = "latest"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_rqrr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.1
4
+ version: 0.9.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Jordan
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rb_sys
@@ -31,7 +31,7 @@ extensions:
31
31
  - ext/ruby_rqrr/extconf.rb
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - ".standard.yml"
34
+ - ".DS_Store"
35
35
  - CHANGELOG.md
36
36
  - CODE_OF_CONDUCT.md
37
37
  - Cargo.lock
@@ -46,14 +46,14 @@ files:
46
46
  - lib/ruby_rqrr/version.rb
47
47
  - mise.toml
48
48
  - sig/ruby_rqrr.rbs
49
- homepage: https://gitlab.com/phchun/ruby_rqrr
49
+ homepage: https://github.com/phchun/ruby_rqrr
50
50
  licenses:
51
51
  - MIT
52
52
  metadata:
53
53
  allowed_push_host: https://rubygems.org
54
- homepage_uri: https://gitlab.com/phchun/ruby_rqrr
55
- source_code_uri: https://gitlab.com/phchun/ruby_rqrr
56
- changelog_uri: https://gitlab.com/phchun/ruby_rqrr/CHANGELOG.md
54
+ homepage_uri: https://github.com/phchun/ruby_rqrr
55
+ source_code_uri: https://github.com/phchun/ruby_rqrr
56
+ changelog_uri: https://github.com/phchun/ruby_rqrr/CHANGELOG.md
57
57
  rdoc_options: []
58
58
  require_paths:
59
59
  - lib
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: 3.3.11
70
70
  requirements: []
71
- rubygems_version: 3.6.2
71
+ rubygems_version: 3.6.9
72
72
  specification_version: 4
73
73
  summary: A Ruby Binding for Rust's RQRR'.
74
74
  test_files: []
data/.standard.yml DELETED
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/standardrb/standard
3
- ruby_version: 3.1