rqrcode 1.0.0.pre → 1.0.0

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: a25f372a618c9ff9906fd306ab72592c31213be1aa71aa93cc1949a1ba8fc2d3
4
- data.tar.gz: 2a140b6b425052375e5b0121f8910e1d16acc10f55c1e4d0cba047f1011e45d1
3
+ metadata.gz: 5aa4c4868eb5c584254a66743407f0461a05be74aece89350d41ea79671bc7d0
4
+ data.tar.gz: eb6bbae7b8449b5a3a60ed5faa4d80a99c9bff2ff09b081a38fcac3bed55046c
5
5
  SHA512:
6
- metadata.gz: 101c49983286d0f9f956eb4a47c4439dd3a48886c58fa1b25759085fdf529283abf19bc183c93655e0e41b1de14c6ee3f4ee7db998c7410d296fb859be5bb21c
7
- data.tar.gz: 1321c977a150e091de1ef25260b35232f588d9045f6ac036e8378f11b62bbf5fd39b62c5fab4ba66a4984105b706e516cb7af0ead4b9baa764cc43d6a0746d99
6
+ metadata.gz: f5c67b502684055b820a1c4d6aa7be65370c493a5431fcb87c9b859486cf9d584806ceffedbeeff50b41c3d524cf8aa02dda535674c33838bbd0943292f26666
7
+ data.tar.gz: 1f5295a6b53acea72b83b869666ec004d4bbec494603ee59f7b6ab46401af0bf669c06f9957737c7558e1837c335b3b8da231e28fa18fc167ce6747cc2e1d7d5
@@ -0,0 +1,20 @@
1
+ name: rqrcode
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake test
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
- __UPDATE:__ A new pre-release has been made [v1.0.0.pre](https://github.com/whomwah/rqrcode/releases/tag/v1.0.0.pre). A fresh start after a _long_ pause. There is actually no new functionality in the release but there are some dependency changes. Minimum Ruby version is now `~> 2.3`. This release also cleans up the internals a bit. The core `QR Code` generation has been extracted into a new [rqrcode_core](https://github.com/whomwah/rqrcode_core) gem. This enables `qrqcode` to concentrate on rendering. Once `v1.0.0.pre` has had time for people to try I'll release `v1.0.0` of `rqrcode` and then concentrate on working through issues and PRs although I appreciate many of these may be old and out of date now! You can install this pre-release with `gem install rqrcode --pre` or `gem 'rqrcode', '>= 1.0.0.pre'` in your `Gemfile`.
2
-
3
-
4
1
  # RQRCode
5
2
 
6
- [![Codeship Status for whomwah/rqrcode](https://app.codeship.com/projects/66910bf0-809b-0137-b2d8-06fb89da20d2/status?branch=master)](https://app.codeship.com/projects/352496)
3
+ ![](https://github.com/whomwah/rqrcode/workflows/rqrcode/badge.svg)
4
+
7
5
 
8
6
  [RQRCode](https://github.com/whomwah/rqrcode) is a library for creating and rendering QR codes into various formats. It has a simple interface with all the standard QR code options. It was adapted from the Javascript library by Kazuhiko Arase.
9
7
 
10
8
  * QR code is trademarked by Denso Wave inc
9
+ * Minimum Ruby version is `~> 2.3`
11
10
  * For `rqrcode` releases `< 1.0.0` please use [this README](https://github.com/whomwah/rqrcode/blob/cd2732a68434e6197c219e6c8cbdadfce0c4c4f3/README.md)
12
11
 
13
12
  ## Installing
@@ -89,7 +88,8 @@ svg = qrcode.as_svg(
89
88
  offset: 0,
90
89
  color: '000',
91
90
  shape_rendering: 'crispEdges',
92
- module_size: 6
91
+ module_size: 6,
92
+ standalone: true
93
93
  )
94
94
  ```
95
95
 
@@ -14,12 +14,15 @@ module RQRCode
14
14
  # color - Foreground color for the code (e.g. "000000" or :black)
15
15
  # module_size - The Pixel size of each module (e.g. 11)
16
16
  # shape_rendering - Defaults to crispEdges
17
+ # standalone - wether to make this a full SVG file, or only svg to embed
18
+ # in other svg.
17
19
  #
18
20
  def as_svg(options={})
19
21
  offset = options[:offset].to_i || 0
20
22
  color = options[:color] || "000"
21
23
  shape_rendering = options[:shape_rendering] || "crispEdges"
22
24
  module_size = options[:module_size] || 11
25
+ standalone = options[:standalone].nil? ? true : options[:standalone]
23
26
 
24
27
  # height and width dependent on offset and QR complexity
25
28
  dimension = (@qrcode.module_count*module_size) + (2*offset)
@@ -45,7 +48,12 @@ module RQRCode
45
48
  result.unshift %{<rect width="#{dimension}" height="#{dimension}" x="0" y="0" style="fill:##{options[:fill]}"/>}
46
49
  end
47
50
 
48
- [xml_tag, open_tag, result, close_tag].flatten.join("\n")
51
+ if standalone
52
+ result.unshift(xml_tag, open_tag)
53
+ result << close_tag
54
+ end
55
+
56
+ result.join("\n")
49
57
  end
50
58
  end
51
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RQRCode
4
- VERSION = "1.0.0.pre"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rqrcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duncan Robertson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rqrcode_core
@@ -90,6 +90,7 @@ executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
+ - ".github/workflows/ruby.yml"
93
94
  - ".gitignore"
94
95
  - Gemfile
95
96
  - LICENSE.txt
@@ -126,11 +127,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
127
  version: '2.3'
127
128
  required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  requirements:
129
- - - ">"
130
+ - - ">="
130
131
  - !ruby/object:Gem::Version
131
- version: 1.3.1
132
+ version: '0'
132
133
  requirements: []
133
- rubygems_version: 3.0.3
134
+ rubygems_version: 3.0.1
134
135
  signing_key:
135
136
  specification_version: 4
136
137
  summary: A library to encode QR Codes