motion-sparkle-sandbox 2.0.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.rspec +2 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +183 -0
- data/.ruby-version +1 -0
- data/.travis.yml +37 -0
- data/Gemfile +13 -3
- data/README.md +72 -72
- data/Rakefile +2 -7
- data/bin/bundle +114 -0
- data/bin/byebug +29 -0
- data/bin/coderay +29 -0
- data/bin/fuzzy_match +29 -0
- data/bin/htmldiff +29 -0
- data/bin/httpclient +29 -0
- data/bin/ldiff +29 -0
- data/bin/pod +29 -0
- data/bin/pry +29 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bin/ruby-parse +29 -0
- data/bin/ruby-rewrite +29 -0
- data/bin/sandbox-pod +29 -0
- data/bin/xcodeproj +29 -0
- data/lib/motion/project/appcast.rb +294 -111
- data/lib/motion/project/indent_string.rb +18 -0
- data/lib/motion/project/install.rb +22 -66
- data/lib/motion/project/package.rb +52 -36
- data/lib/motion/project/project.rb +42 -51
- data/lib/motion/project/rake_tasks.rb +38 -28
- data/lib/motion/project/setup.rb +67 -73
- data/lib/motion/project/sparkle.rb +317 -148
- data/lib/motion/project/templates.rb +24 -22
- data/lib/motion-sparkle-sandbox/version.rb +5 -0
- data/lib/motion-sparkle-sandbox.rb +19 -3
- data/motion-sparkle-sandbox.gemspec +26 -16
- data/sample-app/.gitignore +10 -0
- data/sample-app/Gemfile +8 -0
- data/sample-app/README.md +87 -0
- data/sample-app/Rakefile +47 -0
- data/sample-app/app/app_delegate.rb +15 -0
- data/sample-app/app/menu.rb +155 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/Contents.json +6 -0
- data/sample-app/resources/Credits.rtf +29 -0
- data/sample-app/spec/main_spec.rb +11 -0
- data/spec/appcast_spec.rb +60 -0
- data/spec/setup_spec.rb +42 -0
- data/spec/sparkle_spec.rb +94 -73
- data/spec/spec_helper.rb +100 -27
- data/spec/spec_utils.rb +68 -0
- data/vendor/.git_keep +0 -0
- metadata +80 -14
- data/vendor/README.md +0 -34
- data/vendor/Sparkle.zip +0 -0
- data/vendor/codesign_embedded_executable +0 -46
- data/vendor/generate_appcast +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca50d516f00ac1b85b4212983fbe11e53f1d859ebbb18b2d3e4fad974a055523
|
4
|
+
data.tar.gz: 263ad26c09854be232dd7a19485270b02d33b148838925f09f06c874eef2f993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85a7857cc96ef6e0a54bca54bdb416316781101cd7a85510c4905d8ecca79c3558795c89f83225df83db2f914052be24a570ddf03d093f80ea0121b75324141a
|
7
|
+
data.tar.gz: fecced623e72e228bc0f64025c40aae21bd89819de2a7c8d655e8f04043be0af6d68820372a5018dbad69302d67678b1feccacd6efe683b84d583ff23f899309
|
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
data/.rubocop.yml
ADDED
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
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
|
-
gem '
|
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
|
-
- [
|
18
|
-
- [
|
19
|
-
- [
|
20
|
-
- [
|
21
|
-
- [
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- [
|
29
|
-
- [
|
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](
|
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.
|
33
|
+
### Mac OS X 10.11 and above
|
53
34
|
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
-
In your project's Gemfile
|
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
|
-
|
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,34 @@ end
|
|
106
94
|
|
107
95
|
To complete the configuration, run
|
108
96
|
|
109
|
-
|
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
|
+
`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`.
|
119
108
|
|
120
|
-
You have two options: have Sparkle generate the certificates for you, or follow the instructions to use your existing ones.
|
109
|
+
You have two options: have Sparkle 2 generate the certificates for you, or follow the instructions to use your existing ones.
|
121
110
|
|
122
111
|
### Generate new certificates
|
123
112
|
|
124
|
-
|
125
|
-
|
113
|
+
```bash
|
114
|
+
rake sparkle:setup_certificates
|
115
|
+
```
|
126
116
|
|
127
117
|
### Use your existing certificates
|
128
118
|
|
129
119
|
By default, your certificates need to be placed in the following directories:
|
130
120
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
121
|
+
```plaintext
|
122
|
+
./resources/dsa_pub.pem # public certificate
|
123
|
+
./sparkle/config/dsa_priv.pem # private certificate
|
124
|
+
```
|
135
125
|
|
136
126
|
### Notes about the public certificate
|
137
127
|
|
@@ -146,8 +136,9 @@ The private certificate cannot be renamed nor placed elsewhere. If you have an e
|
|
146
136
|
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
137
|
|
148
138
|
Tips:
|
149
|
-
|
150
|
-
|
139
|
+
|
140
|
+
- add it go your `.gitignore` or equivalent
|
141
|
+
- make a backup of it
|
151
142
|
|
152
143
|
### Run `rake sparkle:setup` at any moment to make sure your config is OK
|
153
144
|
|
@@ -157,7 +148,7 @@ When all is good, move forward. If you need help, you can always open an issue o
|
|
157
148
|
|
158
149
|
Sparkle makes it incredibly easy to add a "Check for updates" feature to your app.
|
159
150
|
|
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.
|
151
|
+
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
152
|
|
162
153
|
So, to launch the "Check for updates" flow, you can call `SUUpdater.new.checkForUpdates`.
|
163
154
|
|
@@ -166,6 +157,7 @@ Here's an example based on the RubyMotion default OS X app example, "Hello". You
|
|
166
157
|
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
158
|
|
168
159
|
In `menu.rb`, right below the line that adds the "Preferences" item:
|
160
|
+
|
169
161
|
```ruby
|
170
162
|
sparkle = addItemWithTitle("Check for updates...", action: nil, keyEquivalent: '')
|
171
163
|
sparkle.setTarget SUUpdater.new
|
@@ -182,11 +174,15 @@ Note that packaging with motion-sparkle-sandbox only works with the `:release` t
|
|
182
174
|
|
183
175
|
Run the setup command again to make sure it's all good:
|
184
176
|
|
185
|
-
|
177
|
+
```bash
|
178
|
+
rake sparkle:setup
|
179
|
+
```
|
186
180
|
|
187
181
|
If you're ready to go, run the `sparkle:package` task:
|
188
182
|
|
189
|
-
|
183
|
+
```bash
|
184
|
+
rake sparkle:package
|
185
|
+
```
|
190
186
|
|
191
187
|
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
188
|
|
@@ -210,7 +206,9 @@ To do so, follow the same steps every time:
|
|
210
206
|
|
211
207
|
### 2. Build your app for release
|
212
208
|
|
213
|
-
|
209
|
+
```bash
|
210
|
+
rake build:release
|
211
|
+
```
|
214
212
|
|
215
213
|
### 3. Update your Release Notes
|
216
214
|
|
@@ -222,7 +220,9 @@ You can either change these files inside the `sparkle/config/` folder, or simply
|
|
222
220
|
|
223
221
|
Run the `sparkle:package` task and you'll be one step away from distribution.
|
224
222
|
|
225
|
-
|
223
|
+
```bash
|
224
|
+
rake sparkle:package
|
225
|
+
```
|
226
226
|
|
227
227
|
### 5. Upload
|
228
228
|
|
@@ -232,18 +232,20 @@ Sparkle for the win.
|
|
232
232
|
|
233
233
|
## Help, Limitations, Troubleshooting and Testing
|
234
234
|
|
235
|
-
If you
|
235
|
+
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
|
236
|
+
|
237
|
+
If you run into difficulties with `motion-sparkle-sandbox`, please open an [Issue on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/issues/).
|
238
|
+
|
236
239
|
|
237
240
|
Limitations:
|
238
241
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
* The Sparkle framework is horrendously copied multiple times
|
242
|
+
- Only tested with Ruby 2.7.2
|
243
|
+
- Only works with ZIP files
|
244
|
+
- Only works with :release build target
|
243
245
|
|
244
|
-
To further troubleshoot your case, you clone/fork the repo and go through the tests and the code.
|
246
|
+
To further troubleshoot your case, you can clone/fork the repo and go through the tests and the code.
|
245
247
|
|
246
|
-
To test, you can just run
|
248
|
+
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
249
|
|
248
250
|
Test coverage currently only extends to configuration and certificate generation checking.
|
249
251
|
|
@@ -253,8 +255,6 @@ Please do help with comments, issues and pull requests! The gem's repository is
|
|
253
255
|
|
254
256
|
## Credits
|
255
257
|
|
256
|
-
Contributors: [View all on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/graphs/contributors)
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
Huge thanks to [andymatuschak/Sparkle](https://github.com/andymatuschak/Sparkle) for creating and continuing to maintain Sparkle!
|
258
|
+
- Contributors: [View all on Github](https://github.com/digitalmoksha/motion-sparkle-sandbox/graphs/contributors)
|
259
|
+
- Originally created by [Alexandre L. Solleiro](http://github.com/webcracy), and forked from [webcracy/motion-sparkle](https://github.com/webcracy/motion-sparkle)
|
260
|
+
- 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
data/bin/bundle
ADDED
@@ -0,0 +1,114 @@
|
|
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
|
+
bundler_version = nil
|
28
|
+
update_index = nil
|
29
|
+
ARGV.each_with_index do |a, i|
|
30
|
+
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
31
|
+
bundler_version = a
|
32
|
+
end
|
33
|
+
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
+
bundler_version = $1
|
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", __FILE__)
|
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
|
+
lockfile_contents = File.read(lockfile)
|
59
|
+
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
+
Regexp.last_match(1)
|
61
|
+
end
|
62
|
+
|
63
|
+
def bundler_version
|
64
|
+
@bundler_version ||=
|
65
|
+
env_var_version || cli_arg_version ||
|
66
|
+
lockfile_version
|
67
|
+
end
|
68
|
+
|
69
|
+
def bundler_requirement
|
70
|
+
return "#{Gem::Requirement.default}.a" unless bundler_version
|
71
|
+
|
72
|
+
bundler_gem_version = Gem::Version.new(bundler_version)
|
73
|
+
|
74
|
+
requirement = bundler_gem_version.approximate_recommendation
|
75
|
+
|
76
|
+
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
|
77
|
+
|
78
|
+
requirement += ".a" if bundler_gem_version.prerelease?
|
79
|
+
|
80
|
+
requirement
|
81
|
+
end
|
82
|
+
|
83
|
+
def load_bundler!
|
84
|
+
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
85
|
+
|
86
|
+
activate_bundler
|
87
|
+
end
|
88
|
+
|
89
|
+
def activate_bundler
|
90
|
+
gem_error = activation_error_handling do
|
91
|
+
gem "bundler", bundler_requirement
|
92
|
+
end
|
93
|
+
return if gem_error.nil?
|
94
|
+
require_error = activation_error_handling do
|
95
|
+
require "bundler/version"
|
96
|
+
end
|
97
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
98
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
99
|
+
exit 42
|
100
|
+
end
|
101
|
+
|
102
|
+
def activation_error_handling
|
103
|
+
yield
|
104
|
+
nil
|
105
|
+
rescue StandardError, LoadError => e
|
106
|
+
e
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
m.load_bundler!
|
111
|
+
|
112
|
+
if m.invoked_as_script?
|
113
|
+
load Gem.bin_path("bundler", "bundle")
|
114
|
+
end
|