
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
QRcode and Barcode generation for Rails apps. Saves resulting png's to the filesystem or as3. It includes a C extension that wraps the GNU Barcode project. For qrcode generation, it uses the [qrcode gem] (http://nycrb.rubyforge.org/qrencoder/), which in turn, wraps the libqrencode C library.
If you intend to generate QRCodes, you'll need to compile the C library libqrencode available [here] (http://megaui.net/fukuchi/works/qrencode/index.en.html).
curl http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.gz | tar xz
cd qrencode-3.2.0
./configure
make
sudo make install
You'll also need ImageMagick to generate the barcode png's.
Add this line to your application's Gemfile:
gem 'multi_encoder'
And then execute:
$ bundle
This will compile the gbarcode extension, included within.
<%= qrcode 'whasupbro' %>
<%= barcode 'notmuchmate' %>
The <%= barcode %> heleper generates a barcode in BARCODE_128 format and accepts the following options:
width
height
scaling_factor
xoff
yoff
margin
Example:
<%= barcode width: 100, height: 30, xoff: 100 %>
The resulting PNG will be saved on the filesystem (or as3) and rendered into the view.
There is nothing to configure if you want the resulting png's saved to the filesystem. This is the default. If you want to upload the images to AS3 you'll need to configure the sorage options, like so:
MultiEncoder::Storage.configure do |c|
c.destination = :aws
c.aws_bucket_prefix = SOME_PREFIX
c.aws_access_key = YOUR_ACCESS_KEY
c.aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
end
It is also possible to set these values as environment valiables
That's it, you are ready to go.
The gem will create buckets with the following names, depending on the Rails environment:
[prefix]-development-barcodes
[prefix]-development-qrcodes
and so on.
MIT
FAQs
Unknown package
We found that multi_encoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.