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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8ada11211f5a996a4730122f18efd8edd3d9efb7e624382911f1a101f6aefd9
4
- data.tar.gz: 646373947b62f61c2d616cec2d808a696ffa6f5f4f21f6f362cb5605a5963a7c
3
+ metadata.gz: 6018e9ac9a71c9e5ba185e51223fcd8cd5f4c7e9f70686e88da37ce7ccfb7c37
4
+ data.tar.gz: d6ea0296c0321205dfcef8dbd7a7c3c2458ec442f03e82496bf5f78eb7770b43
5
5
  SHA512:
6
- metadata.gz: 6327ad32bf8a9131f2613080ca1698aa358b614cc65e4a6f7fa9a4e877e84a7e6e0de7906064ad87f92233618b04a6424502f718eb415d903ca759aefeda7b53
7
- data.tar.gz: 48fdbdec952f883100fda170a39f7ad851f7942b34b06c97260c1a0caabb36185209d1c190c0e6f81a864d297fff8bf8bd4b39514afa819322604141d0219bd7
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
- Generates QR codes that you may use in the rest of your workflow.
15
+ You can use this plugin to generate QR codes that you may use in the rest of your Fastlane workflow.
16
16
 
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
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
- ## Example
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
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
23
+ ## Example
22
24
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
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
- IO.binwrite(qr_code_png_path, qr_code_png.to_s)
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module QrCode
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2022-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rqrcode