fastlane-plugin-qr_code 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +42 -6
- data/lib/fastlane/plugin/qr_code/actions/qr_code_action.rb +4 -1
- data/lib/fastlane/plugin/qr_code/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6018e9ac9a71c9e5ba185e51223fcd8cd5f4c7e9f70686e88da37ce7ccfb7c37
|
4
|
+
data.tar.gz: d6ea0296c0321205dfcef8dbd7a7c3c2458ec442f03e82496bf5f78eb7770b43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4231387216bd3e6fd5af820f5570a5e3993f7ef869301aac161ccf7b07921b44a9acc335a3c42b0a33bdd3fa2bd7a1c9c565e24754981def4020cde345ef79
|
7
|
+
data.tar.gz: a1d3fe523931d0d18998172beaac5411444a7ed496a7b27fe97bd7fdc0532c2a86a8efef7ad239491188b44ff9d069f518c198c420af663f57d0bb4cefe47f19
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# qr_code plugin
|
1
|
+
# Fastlane qr_code plugin
|
2
2
|
|
3
3
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-qr_code)
|
4
4
|
|
@@ -12,15 +12,51 @@ fastlane add_plugin qr_code
|
|
12
12
|
|
13
13
|
## About qr_code
|
14
14
|
|
15
|
-
|
15
|
+
You can use this plugin to generate QR codes that you may use in the rest of your Fastlane workflow.
|
16
16
|
|
17
|
-
|
17
|
+
This plugin was created because I needed a Fastlane equivalent of the [Bitrise step 'Create install page QR code'](https://www.bitrise.io/integrations/steps/create-install-page-qr-code).
|
18
18
|
|
19
|
-
|
19
|
+
The main use case is to generate a QR code to your app's install page, and then automatically post this QR code to Slack.
|
20
|
+
|
21
|
+
The plugin outputs a PNG image of the QR code as well as an ANSI text representation that can be printed to a console.
|
20
22
|
|
21
|
-
|
23
|
+
## Example
|
22
24
|
|
23
|
-
|
25
|
+
Example usage of this plugin:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
lane :test do
|
29
|
+
code = qr_code(contents: 'https://q42.com/')
|
30
|
+
|
31
|
+
# Print a ANSI text-representation of the QR code to the console
|
32
|
+
puts code['QR_CODE_TEXT']
|
33
|
+
|
34
|
+
# Store the QR code somewhere a PNG file to use it later on
|
35
|
+
FileUtils.cp(code['QR_CODE_PNG_PATH'], './qr_code.png')
|
36
|
+
|
37
|
+
# Upload QR code to S3...
|
38
|
+
aws_s3(
|
39
|
+
access_key: ENV["S3_ACCESS_KEY"],
|
40
|
+
secret_access_key: ENV["S3_SECRET_ACCESS_KEY"],
|
41
|
+
bucket: ENV["S3_BUCKET"],
|
42
|
+
region: ENV["S3_REGION"],
|
43
|
+
files: [
|
44
|
+
code['QR_CODE_PNG_PATH']
|
45
|
+
],
|
46
|
+
upload_metadata: false
|
47
|
+
)
|
48
|
+
qr_code_image_url = lane_context[SharedValues::S3_FILES_OUTPUT_PATHS][0]
|
49
|
+
|
50
|
+
# ...and post it to Slack!
|
51
|
+
slack(
|
52
|
+
message: "Build succeeded! Scan the code to install it on your device.",
|
53
|
+
slack_url: ENV["SLACK_WEB_HOOK_URL"],
|
54
|
+
attachment_properties: {
|
55
|
+
image_url: qr_code_image_url,
|
56
|
+
}
|
57
|
+
)
|
58
|
+
end
|
59
|
+
```
|
24
60
|
|
25
61
|
## Run tests for this plugin
|
26
62
|
|
@@ -12,6 +12,9 @@ module Fastlane
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class QrCodeAction < Action
|
15
|
+
# Hold references to the temporary files, so that they aren't garbage collected (and deleted) before the Fastlane workflow is finished.
|
16
|
+
@@temp_files = []
|
17
|
+
|
15
18
|
def self.run(params)
|
16
19
|
qr_code_contents = params[:contents].to_s
|
17
20
|
UI.user_error!("No QR code contents given, pass using `contents: 'http://example.com/123'`") unless qr_code_contents.length > 0
|
@@ -24,7 +27,7 @@ module Fastlane
|
|
24
27
|
temp_file.write(qr_code_png.to_s)
|
25
28
|
qr_code_png_path = temp_file.path
|
26
29
|
temp_file.close
|
27
|
-
|
30
|
+
@@temp_files.append(temp_file)
|
28
31
|
|
29
32
|
# Setting action and environment variables
|
30
33
|
Actions.lane_context[SharedValues::QR_CODE_PNG_PATH] = qr_code_png_path
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-qr_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathijs Bernson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rqrcode
|