motion-sparkle-sandbox 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +7 -0
  5. data/.rubocop_todo.yml +183 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +37 -0
  8. data/Gemfile +13 -3
  9. data/README.md +73 -71
  10. data/Rakefile +2 -7
  11. data/bin/bundle +103 -0
  12. data/bin/byebug +29 -0
  13. data/bin/coderay +29 -0
  14. data/bin/fuzzy_match +29 -0
  15. data/bin/htmldiff +29 -0
  16. data/bin/httpclient +29 -0
  17. data/bin/ldiff +29 -0
  18. data/bin/pod +29 -0
  19. data/bin/pry +29 -0
  20. data/bin/rake +29 -0
  21. data/bin/rspec +29 -0
  22. data/bin/rubocop +29 -0
  23. data/bin/ruby-parse +29 -0
  24. data/bin/ruby-rewrite +29 -0
  25. data/bin/sandbox-pod +29 -0
  26. data/bin/xcodeproj +29 -0
  27. data/lib/motion/project/appcast.rb +177 -104
  28. data/lib/motion/project/indent_string.rb +18 -0
  29. data/lib/motion/project/install.rb +22 -66
  30. data/lib/motion/project/package.rb +52 -36
  31. data/lib/motion/project/project.rb +41 -51
  32. data/lib/motion/project/rake_tasks.rb +28 -32
  33. data/lib/motion/project/setup.rb +67 -73
  34. data/lib/motion/project/sparkle.rb +244 -148
  35. data/lib/motion/project/templates.rb +24 -22
  36. data/lib/motion-sparkle-sandbox/version.rb +5 -0
  37. data/lib/motion-sparkle-sandbox.rb +19 -3
  38. data/motion-sparkle-sandbox.gemspec +26 -16
  39. data/sample-app/.gitignore +9 -0
  40. data/sample-app/Gemfile +8 -0
  41. data/sample-app/README.md +87 -0
  42. data/sample-app/Rakefile +44 -0
  43. data/sample-app/app/app_delegate.rb +15 -0
  44. data/sample-app/app/menu.rb +155 -0
  45. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
  46. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  47. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128.png +0 -0
  48. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128@2x.png +0 -0
  49. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16.png +0 -0
  50. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16@2x.png +0 -0
  51. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256.png +0 -0
  52. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256@2x.png +0 -0
  53. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32.png +0 -0
  54. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32@2x.png +0 -0
  55. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512.png +0 -0
  56. data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512@2x.png +0 -0
  57. data/sample-app/resources/Assets.xcassets/Contents.json +6 -0
  58. data/sample-app/resources/Credits.rtf +29 -0
  59. data/sample-app/spec/main_spec.rb +11 -0
  60. data/spec/setup_spec.rb +67 -0
  61. data/spec/sparkle_spec.rb +113 -65
  62. data/spec/spec_helper.rb +94 -29
  63. data/spec/spec_utils.rb +32 -0
  64. data/vendor/.git_keep +0 -0
  65. metadata +78 -14
  66. data/vendor/README.md +0 -34
  67. data/vendor/Sparkle.zip +0 -0
  68. data/vendor/codesign_embedded_executable +0 -46
  69. data/vendor/generate_appcast +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb36aa00aa6bcfa0a003626e4df82fec0d15b6ffe9887301b65b68f2cdf6e2f8
4
- data.tar.gz: 9848c1800e37dc90399cb8b424d079719b9c9e1751d13a7f8d6fcc2679291a0c
3
+ metadata.gz: cc179192e7aeb944a8e61d76dca931f1a3677d609f66cc07d0cce265fb3a528c
4
+ data.tar.gz: fc45702a1cd7854e82bd73f90e90d76c824cea414dc5b67235eacf5843ea34cf
5
5
  SHA512:
6
- metadata.gz: b7640ff4fa3545cb12f75bfd8a3a24b69ee6c659e71e6a9f4ee405f1cd8349f0afd9a8ac4ad51180969226232c59fb61a1cff3084572a7f084997de578c84416
7
- data.tar.gz: 536419939c150e497532e54eeb5c3328cfd3001ff4b4491d6c31e8b3557f4a0c05a35e7068aa40a87318b7750788e39eee73ecccc5f1a5d368c770a69d25ba8e
6
+ metadata.gz: ca8d5068be44227353ca57f476680f54c636006ae17b81766bfaf527c5ca8c51a5b5037284b370edcd9c6f951b3a151d97af794924ee51185d9ecd93bdf6bf95
7
+ data.tar.gz: a30fa432e5d62eaa32f3da2d24fd63ce28b3a4c5b3eef9de14765fdd0d69d64a14bb9037fb6217368f5f0e3bf2ef3418c408341ffc949a81cfa45efabbd40d28
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .idea
5
6
  coverage
6
7
  InstalledFiles
7
8
  lib/bundler/man
@@ -11,7 +12,10 @@ spec/reports
11
12
  test/tmp
12
13
  test/version_tmp
13
14
  tmp
15
+ vendor/Pods
16
+ vendor/Podfile.lock
14
17
  Gemfile.lock
18
+ __MACOSX
15
19
 
16
20
  # YARD artifacts
17
21
  .yardoc
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ NewCops: enable
5
+ Exclude:
6
+ - 'sample-app/**/*'
7
+ - 'bin/*'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,183 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-09-18 22:35:29 UTC using RuboCop version 1.21.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'motion-sparkle-sandbox.gemspec'
15
+
16
+ # Offense count: 1
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
19
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
20
+ Layout/EndAlignment:
21
+ Exclude:
22
+ - 'spec/sparkle_spec.rb'
23
+
24
+ # Offense count: 1
25
+ Lint/NonLocalExitFromIterator:
26
+ Exclude:
27
+ - 'lib/motion/project/sparkle.rb'
28
+
29
+ # Offense count: 2
30
+ Lint/UselessAssignment:
31
+ Exclude:
32
+ - 'lib/motion/project/rake_tasks.rb'
33
+
34
+ # Offense count: 6
35
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
36
+ Metrics/AbcSize:
37
+ Max: 80
38
+
39
+ # Offense count: 2
40
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
41
+ # IgnoredMethods: refine
42
+ Metrics/BlockLength:
43
+ Max: 64
44
+
45
+ # Offense count: 1
46
+ # Configuration parameters: CountComments, CountAsOne.
47
+ Metrics/ClassLength:
48
+ Max: 150
49
+
50
+ # Offense count: 1
51
+ # Configuration parameters: IgnoredMethods.
52
+ Metrics/CyclomaticComplexity:
53
+ Max: 8
54
+
55
+ # Offense count: 10
56
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
57
+ Metrics/MethodLength:
58
+ Max: 30
59
+
60
+ # Offense count: 1
61
+ # Configuration parameters: IgnoredMethods.
62
+ Metrics/PerceivedComplexity:
63
+ Max: 10
64
+
65
+ # Offense count: 1
66
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
67
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
68
+ Naming/FileName:
69
+ Exclude:
70
+ - 'lib/motion-sparkle-sandbox.rb'
71
+
72
+ # Offense count: 6
73
+ # Cop supports --auto-correct.
74
+ # Configuration parameters: EnforcedStyle.
75
+ # SupportedStyles: always, conditionals
76
+ Style/AndOr:
77
+ Exclude:
78
+ - 'lib/motion/project/setup.rb'
79
+ - 'lib/motion/project/templates.rb'
80
+
81
+ # Offense count: 7
82
+ # Cop supports --auto-correct.
83
+ # Configuration parameters: EnforcedStyle.
84
+ # SupportedStyles: nested, compact
85
+ Style/ClassAndModuleChildren:
86
+ Exclude:
87
+ - 'lib/motion/project/appcast.rb'
88
+ - 'lib/motion/project/install.rb'
89
+ - 'lib/motion/project/package.rb'
90
+ - 'lib/motion/project/project.rb'
91
+ - 'lib/motion/project/setup.rb'
92
+ - 'lib/motion/project/sparkle.rb'
93
+ - 'lib/motion/project/templates.rb'
94
+
95
+ # Offense count: 10
96
+ # Configuration parameters: AllowedConstants.
97
+ Style/Documentation:
98
+ Exclude:
99
+ - 'spec/**/*'
100
+ - 'test/**/*'
101
+ - 'lib/motion/project/appcast.rb'
102
+ - 'lib/motion/project/install.rb'
103
+ - 'lib/motion/project/package.rb'
104
+ - 'lib/motion/project/project.rb'
105
+ - 'lib/motion/project/setup.rb'
106
+ - 'lib/motion/project/sparkle.rb'
107
+ - 'lib/motion/project/templates.rb'
108
+
109
+ # Offense count: 12
110
+ # Cop supports --auto-correct.
111
+ # Configuration parameters: EnforcedStyle.
112
+ # SupportedStyles: always, always_true, never
113
+ Style/FrozenStringLiteralComment:
114
+ Exclude:
115
+ - 'Rakefile'
116
+ - 'lib/motion-sparkle-sandbox.rb'
117
+ - 'lib/motion/project/appcast.rb'
118
+ - 'lib/motion/project/install.rb'
119
+ - 'lib/motion/project/package.rb'
120
+ - 'lib/motion/project/project.rb'
121
+ - 'lib/motion/project/rake_tasks.rb'
122
+ - 'lib/motion/project/setup.rb'
123
+ - 'lib/motion/project/sparkle.rb'
124
+ - 'lib/motion/project/templates.rb'
125
+ - 'spec/sparkle_spec.rb'
126
+ - 'spec/spec_helper.rb'
127
+
128
+ # Offense count: 4
129
+ # Configuration parameters: MinBodyLength.
130
+ Style/GuardClause:
131
+ Exclude:
132
+ - 'lib/motion/project/setup.rb'
133
+
134
+ # Offense count: 4
135
+ # Cop supports --auto-correct.
136
+ Style/IfUnlessModifier:
137
+ Exclude:
138
+ - 'lib/motion/project/package.rb'
139
+ - 'lib/motion/project/setup.rb'
140
+
141
+ # Offense count: 5
142
+ # Cop supports --auto-correct.
143
+ # Configuration parameters: EnforcedStyle.
144
+ # SupportedStyles: literals, strict
145
+ Style/MutableConstant:
146
+ Exclude:
147
+ - 'lib/motion/project/install.rb'
148
+ - 'lib/motion/project/sparkle.rb'
149
+ - 'lib/motion/project/templates.rb'
150
+
151
+ # Offense count: 2
152
+ # Configuration parameters: AllowedMethods.
153
+ # AllowedMethods: respond_to_missing?
154
+ Style/OptionalBooleanParameter:
155
+ Exclude:
156
+ - 'lib/motion/project/setup.rb'
157
+ - 'lib/motion/project/templates.rb'
158
+
159
+ # Offense count: 2
160
+ # Cop supports --auto-correct.
161
+ # Configuration parameters: RequireEnglish.
162
+ # SupportedStyles: use_perl_names, use_english_names
163
+ Style/SpecialGlobalVars:
164
+ EnforcedStyle: use_perl_names
165
+
166
+ # Offense count: 17
167
+ # Cop supports --auto-correct.
168
+ # Configuration parameters: Mode.
169
+ Style/StringConcatenation:
170
+ Exclude:
171
+ - 'lib/motion/project/appcast.rb'
172
+ - 'lib/motion/project/install.rb'
173
+ - 'lib/motion/project/sparkle.rb'
174
+ - 'lib/motion/project/templates.rb'
175
+ - 'spec/sparkle_spec.rb'
176
+ - 'spec/spec_helper.rb'
177
+
178
+ # Offense count: 8
179
+ # Cop supports --auto-correct.
180
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
181
+ # URISchemes: http, https
182
+ Layout/LineLength:
183
+ Max: 192
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/.travis.yml ADDED
@@ -0,0 +1,37 @@
1
+ language: objective-c
2
+ osx_image: xcode12.2
3
+ env:
4
+ global:
5
+ - RUBYMOTION_LICENSE=1dcac45cc434293009f74b33037bdf7361a3a1ff # Official license key for open-source projects
6
+ - TMP_DIR=./tmp # For motion repo, so it doesn't attempt to use /tmp, to which it has no access
7
+ - OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
8
+
9
+ before_install:
10
+ - brew update
11
+ - brew outdated xctool || brew upgrade xctool
12
+ - (xcrun simctl list)
13
+ - wget http://travisci.rubymotion.com/ -O RubyMotion-TravisCI.pkg
14
+ - sudo installer -pkg RubyMotion-TravisCI.pkg -target /
15
+ - cp -r /usr/lib/swift/*.dylib /Applications/Xcode.app/Contents/Frameworks/
16
+ - touch /Applications/Xcode.app/Contents/Frameworks/.swift-5-staged
17
+ - sudo mkdir -p ~/Library/RubyMotion/build
18
+ - sudo chown -R travis ~/Library/RubyMotion
19
+ - eval "sudo motion activate $RUBYMOTION_LICENSE"
20
+ - sudo motion update
21
+ - (motion --version)
22
+ - (ruby --version)
23
+ - motion repo
24
+ - bundle install --jobs=3 --retry=3
25
+ - bundle exec rake pod:install
26
+
27
+ gemfile:
28
+ - Gemfile
29
+
30
+ jobs:
31
+ include:
32
+ - stage: rubocop
33
+ script: bundle exec rubocop
34
+ - stage: macos
35
+ script: bundle exec rake spec
36
+ # - stage: ios
37
+ # script: bundle exec rake spec platform=ios
data/Gemfile CHANGED
@@ -1,6 +1,16 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
- gemspec
3
+ source 'https://rubygems.org'
4
4
 
5
- gem 'bacon'
5
+ gem 'binding_of_caller'
6
+ gem 'pry-byebug', '~> 3.9.0', platform: :mri
6
7
  gem 'rake'
8
+
9
+ gem 'rspec', '~> 3.0'
10
+
11
+ gem 'rubocop'
12
+ gem 'rubocop-performance'
13
+ gem 'rubocop-rake'
14
+ gem 'rubocop-rspec'
15
+
16
+ gemspec
data/README.md CHANGED
@@ -1,45 +1,26 @@
1
1
  # motion-sparkle-sandbox
2
2
 
3
- Easily package and release updates of your RubyMotion app with Sparkle.
4
-
5
- *NB: Sparkle only works for OS X projects*
6
-
7
- ## Sandboxing
8
-
9
- This version uses the [2.x branch](https://github.com/sparkle-project/Sparkle/tree/2.x) to support an app that uses sandboxing. Sparkle 2.x is still in beta.
10
-
11
- _Sparkle built from https://github.com/sparkle-project/Sparkle/commit/438f4a21d5b52596b899d9931525c02a691b2287 on Aug 28th, 2020_
12
-
13
- [Reference thread](https://github.com/sparkle-project/Sparkle/issues/363)
3
+ Easily package and release updates of your RubyMotion app with Sparkle 2 (includes support for sandboxed macOS applications).
14
4
 
15
5
  ## Table of Contents
16
6
 
17
- - [Overview](#overview)
18
- - [Compatibility](#compatibility)
19
- - [Installation](#installation)
20
- - [Settings configuration](#settings-configuration)
21
- - [Certificate configuration](#certificate-configuration)
22
- - [Generate new certificates](#generate-new-certificates)
23
- - [Use your existing certificates](#use-your-existing-certificates)
24
- - [Notes about the public certificate](#notes-about-the-public-certificate)
25
- - [Notes about the private certificate](#notes-about-the-private-certificate)
26
- - [Warning regarding your private certificate](#warning-regarding-your-private-certificate)
27
- - [Run rake sparkle:setup at any moment to make sure your config is OK](#run-rake-sparklesetup-at-any-moment-to-make-sure-your-config-is-ok)
28
- - [Adding "Check for updates..." to the menu](#adding-check-for-updates-to-the-menu)
29
- - [First publication](#first-publication)
30
- - [Releasing updates](#releasing-updates)
31
- - [1. Bump the version](#1-bump-the-version)
32
- - [2. Build your app for release](#2-build-your-app-for-release)
33
- - [3. Update your Release Notes](#3-update-your-release-notes)
34
- - [4. Package the release](#4-package-the-release)
35
- - [5. Upload](#5-upload)
36
- - [Help, Limitations, Troubleshooting and Testing](#help-limitations-troubleshooting-and-testing)
37
- - [Contributing](#contributing)
38
- - [Credits](#credits)
7
+ - [motion-sparkle-sandbox](#motion-sparkle-sandbox)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [Overview](#overview)
10
+ - [Compatibility](#compatibility)
11
+ - [Installation](#installation)
12
+ - [Settings configuration](#settings-configuration)
13
+ - [Certificate configuration](#certificate-configuration)
14
+ - [Adding "Check for updates..." to the menu](#adding-check-for-updates-to-the-menu)
15
+ - [First publication](#first-publication)
16
+ - [Releasing updates](#releasing-updates)
17
+ - [Help, Limitations, Troubleshooting and Testing](#help-limitations-troubleshooting-and-testing)
18
+ - [Contributing](#contributing)
19
+ - [Credits](#credits)
39
20
 
40
21
  ## Overview
41
22
 
42
- [Sparkle](http://sparkle.andymatuschak.org/) powers the "Check for updates" feature of countless Mac applications.
23
+ [Sparkle](https://sparkle-project.org) powers the "Check for updates" feature of countless Mac applications.
43
24
 
44
25
  In a nutshell, when users click "Check for updates..." in an app, Sparkle checks for available updates against an XML file that you post somewhere on the web. That XML file contains information about your new release, such as the version number, the URL of the package and its digital signature. If there's a newer version available than the one that is currently running, it'll ask for permission to retrieve the package and replace the current app with the new release.
45
26
 
@@ -49,27 +30,34 @@ After building your app for release and running `rake sparkle:package`, all you
49
30
 
50
31
  ## Compatibility
51
32
 
52
- ### Mac OS X 10.10 and above
33
+ ### Mac OS X 10.11 and above
53
34
 
54
- * Use the latest version of **motion-sparkle-sandbox**
55
- * You will need RubyMotion version 2.38 or above for Yosemite compatibility
56
- * Sparkle only supports Mac OS X 10.10 Yosemite and above
35
+ - Use the latest version of **motion-sparkle-sandbox**
36
+ - You will need RubyMotion version 5.0 or above
37
+ - Sparkle 2 now requires Mac OS X 10.11 El Capitan) or later
57
38
 
58
39
  ## Installation
59
40
 
60
41
  In your project's Gemfile, add:
42
+
61
43
  ```ruby
62
44
  # Gemfile
63
45
 
64
- gem 'motion-sparkle'
46
+ gem 'motion-sparkle-sandbox'
65
47
  ```
48
+
66
49
  and then run
67
50
 
68
- $ bundle install
51
+ ```bash
52
+ bundle install
53
+ ```
54
+
55
+ `motion-sparkle-sandbox` uses the version of [Sparkle 2 on Cocoapods.org](https://cocoapods.org/pods/Sparkle). This gem no longer includes a copy of Sparkle.
69
56
 
70
57
  ## Settings configuration
71
58
 
72
- Configure Sparkle in your `Rakefile` using `motion-sparkle-sandbox`'s DSL:
59
+ Configure Sparkle 2 in your `Rakefile` using `motion-sparkle-sandbox`'s DSL:
60
+
73
61
  ```ruby
74
62
  # Rakefile
75
63
 
@@ -106,32 +94,36 @@ end
106
94
 
107
95
  To complete the configuration, run
108
96
 
109
- $ rake sparkle:setup
110
-
97
+ ```plaintext
98
+ rake sparkle:setup
99
+ ```
111
100
 
112
101
  If everything is OK, you should be informed that it's time to generate or configure your certificates.
113
102
 
114
103
  ## Certificate configuration
115
104
 
116
- For security, Sparkle allows you to sign your releases with a private certificate before distribution: when the user tries to install an update, Sparkle will check the package using the signature provided in the XML file and the public certificate contained in the running application.
105
+ For security, Sparkle 2 allows you to sign your releases with a private certificate before distribution: when the user tries to install an update, Sparkle 2 will check the package using the signature provided in the XML file and the public certificate contained in the running application.
117
106
 
118
- motion-sparkle-sandbox makes it very easy to handle this. In fact, after the first setup, it becomes completely transparent to you as all is handled when you run `rake sparkle:package`.
107
+ _Currently, `motion-sparkle-sandbox` does not support configuring `EdDSA` signatures, only `DSA`._
119
108
 
120
- You have two options: have Sparkle generate the certificates for you, or follow the instructions to use your existing ones.
109
+ `motion-sparkle-sandbox` makes it very easy to handle this. In fact, after the first setup, it becomes completely transparent to you as all is handled when you run `rake sparkle:package`.
121
110
 
122
- ### Generate new certificates
111
+ You have two options: have Sparkle 2 generate the certificates for you, or follow the instructions to use your existing ones.
123
112
 
124
- $ rake sparkle:setup_certificates
113
+ ### Generate new certificates
125
114
 
115
+ ```bash
116
+ rake sparkle:setup_certificates
117
+ ```
126
118
 
127
119
  ### Use your existing certificates
128
120
 
129
121
  By default, your certificates need to be placed in the following directories:
130
122
 
131
-
132
- ./resources/dsa_pub.pem # public certificate
133
- ./sparkle/config/dsa_priv.pem # private certificate
134
-
123
+ ```plaintext
124
+ ./resources/dsa_pub.pem # public certificate
125
+ ./sparkle/config/dsa_priv.pem # private certificate
126
+ ```
135
127
 
136
128
  ### Notes about the public certificate
137
129
 
@@ -146,8 +138,9 @@ The private certificate cannot be renamed nor placed elsewhere. If you have an e
146
138
  Be careful when handling the private certificate: you should never lose it nor share it. If you do, you'd lose the ability to sign your packages and users wouldn't be able to update your app. If someone takes it, they could sign the packages in your name and have your users install who knows what.
147
139
 
148
140
  Tips:
149
- * add it go your `.gitignore` or equivalent
150
- * make a backup of it
141
+
142
+ - add it go your `.gitignore` or equivalent
143
+ - make a backup of it
151
144
 
152
145
  ### Run `rake sparkle:setup` at any moment to make sure your config is OK
153
146
 
@@ -157,7 +150,7 @@ When all is good, move forward. If you need help, you can always open an issue o
157
150
 
158
151
  Sparkle makes it incredibly easy to add a "Check for updates" feature to your app.
159
152
 
160
- Sparkle's `SUUpdater` class has a shared updater instance that can serve as a `target` for Sparkle actions. To launch the typical Sparkle flow, call the `checkForUpdates:` action.
153
+ Sparkle's `SUUpdater` class has a shared updater instance that can serve as a `target` for Sparkle actions. To launch the typical Sparkle 2 flow, call the `checkForUpdates:` action.
161
154
 
162
155
  So, to launch the "Check for updates" flow, you can call `SUUpdater.new.checkForUpdates`.
163
156
 
@@ -166,6 +159,7 @@ Here's an example based on the RubyMotion default OS X app example, "Hello". You
166
159
  This will add the classic "Check for updates..." entry on the menu; when the user clicks it, the nice default of experience of Sparkle will begin.
167
160
 
168
161
  In `menu.rb`, right below the line that adds the "Preferences" item:
162
+
169
163
  ```ruby
170
164
  sparkle = addItemWithTitle("Check for updates...", action: nil, keyEquivalent: '')
171
165
  sparkle.setTarget SUUpdater.new
@@ -182,11 +176,15 @@ Note that packaging with motion-sparkle-sandbox only works with the `:release` t
182
176
 
183
177
  Run the setup command again to make sure it's all good:
184
178
 
185
- $ rake sparkle:setup
179
+ ```bash
180
+ rake sparkle:setup
181
+ ```
186
182
 
187
183
  If you're ready to go, run the `sparkle:package` task:
188
184
 
189
- $ rake sparkle:package
185
+ ```bash
186
+ rake sparkle:package
187
+ ```
190
188
 
191
189
  This should create 3 files inside the `sparkle/release/` folder: a ZIP file of your app, an XML file and an HTML file with the release notes.
192
190
 
@@ -210,7 +208,9 @@ To do so, follow the same steps every time:
210
208
 
211
209
  ### 2. Build your app for release
212
210
 
213
- $ rake build:release
211
+ ```bash
212
+ rake build:release
213
+ ```
214
214
 
215
215
  ### 3. Update your Release Notes
216
216
 
@@ -222,7 +222,9 @@ You can either change these files inside the `sparkle/config/` folder, or simply
222
222
 
223
223
  Run the `sparkle:package` task and you'll be one step away from distribution.
224
224
 
225
- $ rake sparkle:package
225
+ ```bash
226
+ rake sparkle:package
227
+ ```
226
228
 
227
229
  ### 5. Upload
228
230
 
@@ -232,18 +234,20 @@ Sparkle for the win.
232
234
 
233
235
  ## Help, Limitations, Troubleshooting and Testing
234
236
 
235
- If you need further help, please open an [Issue on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/issues/).
237
+ If you run into difficulties using Sparkle 2, make sure you review the [documentation](https://sparkle-project.org/documentation/) on [sparkle-project.org](https://sparkle-project.org). You can also search and open issues on https://github.com/sparkle-project/Sparkle/issues
238
+
239
+ If you run into difficulties with `motion-sparkle-sandbox`, please open an [Issue on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/issues/).
240
+
236
241
 
237
242
  Limitations:
238
243
 
239
- * Only tested with Ruby 1.9.3-p448
240
- * Only works with ZIP files
241
- * Only works with :release build target
242
- * The Sparkle framework is horrendously copied multiple times
244
+ - Only tested with Ruby 2.7.2
245
+ - Only works with ZIP files
246
+ - Only works with :release build target
243
247
 
244
- To further troubleshoot your case, you clone/fork the repo and go through the tests and the code.
248
+ To further troubleshoot your case, you can clone/fork the repo and go through the tests and the code.
245
249
 
246
- To test, you can just run `$ bundle install` at the source of the repo to install the development dependencies and the run `$ rake` to execute the tests.
250
+ To test, you can just run `bundle install` at the source of the repo to install the development dependencies and then run `rake spec` to execute the tests.
247
251
 
248
252
  Test coverage currently only extends to configuration and certificate generation checking.
249
253
 
@@ -253,8 +257,6 @@ Please do help with comments, issues and pull requests! The gem's repository is
253
257
 
254
258
  ## Credits
255
259
 
256
- Contributors: [View all on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/graphs/contributors)
257
-
258
- Originally created by [Alexandre L. Solleiro](http://github.com/webcracy), and forked from [webcracy/motion-sparkle](https://github.com/webcracy/motion-sparkle)
259
-
260
- Huge thanks to [andymatuschak/Sparkle](https://github.com/andymatuschak/Sparkle) for creating and continuing to maintain Sparkle!
260
+ - Contributors: [View all on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/graphs/contributors)
261
+ - Originally created by [Alexandre L. Solleiro](http://github.com/webcracy), and forked from [webcracy/motion-sparkle](https://github.com/webcracy/motion-sparkle)
262
+ - Huge thanks to [Andy Matuschak](https://andymatuschak.org) for creating Sparkle and to the [group of developers](https://github.com/orgs/sparkle-project/people) that maintain Sparkle!
data/Rakefile CHANGED
@@ -1,8 +1,3 @@
1
- require 'bundler/gem_tasks'
1
+ # frozen_string_literal: true
2
2
 
3
- desc "Run all the specs"
4
- task :spec do
5
- sh "bundle exec bacon -q #{FileList['spec/*_spec.rb'].join(' ')}"
6
- end
7
- task :default => :spec
8
- task :test => :spec
3
+ require 'bundler/gem_tasks'
data/bin/bundle ADDED
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'rubygems'
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV['BUNDLER_VERSION']
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
33
+
34
+ bundler_version = Regexp.last_match(1) || '>= 0.a'
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV['BUNDLE_GEMFILE']
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path('../Gemfile', __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile)
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+
59
+ lockfile_contents = File.read(lockfile)
60
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
61
+
62
+ Regexp.last_match(1)
63
+ end
64
+
65
+ def bundler_version
66
+ @bundler_version ||= env_var_version || cli_arg_version ||
67
+ lockfile_version || "#{Gem::Requirement.default}.a"
68
+ end
69
+
70
+ def load_bundler!
71
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
72
+
73
+ # must dup string for RG < 1.8 compatibility
74
+ activate_bundler(bundler_version.dup)
75
+ end
76
+
77
+ def activate_bundler(bundler_version)
78
+ bundler_version = '< 2' if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new('2.0')
79
+ gem_error = activation_error_handling do
80
+ gem 'bundler', bundler_version
81
+ end
82
+ return if gem_error.nil?
83
+
84
+ require_error = activation_error_handling do
85
+ require 'bundler/version'
86
+ end
87
+ return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
88
+
89
+ warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
90
+ exit 42
91
+ end
92
+
93
+ def activation_error_handling
94
+ yield
95
+ nil
96
+ rescue StandardError, LoadError => e
97
+ e
98
+ end
99
+ end
100
+
101
+ m.load_bundler!
102
+
103
+ load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?