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.
Files changed (70) 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 +72 -72
  10. data/Rakefile +2 -7
  11. data/bin/bundle +114 -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 +294 -111
  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 +42 -51
  32. data/lib/motion/project/rake_tasks.rb +38 -28
  33. data/lib/motion/project/setup.rb +67 -73
  34. data/lib/motion/project/sparkle.rb +317 -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 +10 -0
  40. data/sample-app/Gemfile +8 -0
  41. data/sample-app/README.md +87 -0
  42. data/sample-app/Rakefile +47 -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/appcast_spec.rb +60 -0
  61. data/spec/setup_spec.rb +42 -0
  62. data/spec/sparkle_spec.rb +94 -73
  63. data/spec/spec_helper.rb +100 -27
  64. data/spec/spec_utils.rb +68 -0
  65. data/vendor/.git_keep +0 -0
  66. metadata +80 -14
  67. data/vendor/README.md +0 -34
  68. data/vendor/Sparkle.zip +0 -0
  69. data/vendor/codesign_embedded_executable +0 -46
  70. data/vendor/generate_appcast +0 -0
@@ -0,0 +1,87 @@
1
+ # sample-app #
2
+
3
+ ## Build and Run ###
4
+
5
+ - `rake build`
6
+ - `rake run`
7
+
8
+ Run `rake -T` to display a list of supported tasks.
9
+
10
+ ## Deploying to the App Store ##
11
+
12
+ To deploy to the App Store, you'll want to use `rake clean
13
+ archive:distribution`. With a valid distribution certificate.
14
+
15
+ In your `Rakefile`, set the following values:
16
+
17
+ ```ruby
18
+ #This is only an example, your certificate name may be different.
19
+ app.development do
20
+ app.codesign_certificate = "Mac Developer: xxxxx"
21
+ end
22
+
23
+ app.release do
24
+ app.codesign_certificate = "3rd Party Mac Developer Application: xxxxx"
25
+ end
26
+
27
+ app.codesign_for_development = true
28
+ app.codesign_for_release = true
29
+ ```
30
+
31
+ It's also recommand to use [motion-provisoning](https://github.com/HipByte/motion-provisioning)
32
+
33
+ ## Icons ##
34
+
35
+ Apple supports both the use of `.icns` and Asset Catalogs for defining icons.
36
+
37
+ ### ICNS ###
38
+
39
+ Place your icon under `./resources/`, add the following line to `Rakefile`:
40
+
41
+ ```
42
+ app.icon = "Icon.icns"
43
+ ```
44
+
45
+ ### Asset Catalogs ###
46
+
47
+ You'll find icon under `./resources/Assets.xcassets`. You can run the following
48
+ script to generate all the icon sizes (once you've specified `1024x1024.png`).
49
+ Keep in mind that your `.png` files _cannot_ contain alpha channels.
50
+
51
+ Save this following script to `./gen-icons.sh` and run it:
52
+
53
+ ```sh
54
+ set -x
55
+
56
+ brew install imagemagick
57
+
58
+ pushd resources/Assets.xcassets/AppIcon.appiconset/
59
+
60
+ for size in 512 256 128 32 16
61
+ do
62
+ cp "1024x1024.png" "Icon_${size}x${size}.png"
63
+ mogrify -resize "$((size))x$((size))" "Icon_${size}x${size}.png"
64
+
65
+ cp "1024x1024.png" "Icon_${size}x${size}@2x.png"
66
+ mogrify -resize "$((size*2))x$((size*2))" "Icon_${size}x${size}@2x.png"
67
+ done
68
+
69
+ popd
70
+ ```
71
+
72
+ Add following line to `Rakefile`:
73
+
74
+ ```
75
+ app.info_plist['CFBundleIconName'] = 'AppIcon'
76
+ ```
77
+
78
+ For more information about Asset Catalogs, refer to this link: https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/
79
+
80
+
81
+ ## Contributing ##
82
+
83
+ 1. Fork it
84
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
85
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
86
+ 4. Push to the branch (`git push origin my-new-feature`)
87
+ 5. Create new Pull Request
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ $:.unshift('/Library/RubyMotion/lib')
4
+ $:.unshift('~/.rubymotion/rubymotion-templates')
5
+
6
+ require 'motion/project/template/osx'
7
+
8
+ SHORT_VERSION = '0.5'
9
+
10
+ begin
11
+ require 'bundler'
12
+ Bundler.require
13
+ rescue LoadError
14
+ end
15
+
16
+ Motion::Project::App.setup do |app|
17
+ # Use `rake config' to see complete project settings.
18
+ app.name = 'sample-app'
19
+ app.deployment_target = '10.14'
20
+ app.info_plist['CFBundleIconName'] = 'AppIcon'
21
+ app.codesign_certificate = '-' # use an ad-hoc signing certificate
22
+
23
+ app.short_version = SHORT_VERSION # CFBundleShortVersionString
24
+ app.version = `git rev-list --all | wc -l`.strip.to_i.to_s # the build number
25
+
26
+ app.sparkle do
27
+ publish :base_url, 'http://example.com/your_app_folder/releases/'
28
+ publish :public_key, '1/eJupmw4JH+iFQIlh99nS2qvwYealJsNzFN3LL6FFE=x'
29
+ publish :releases_folder, 'tmp/releases/v2.2/'
30
+
31
+ # Appcast Feed
32
+ # publish :feed_base_url, 'http://downloads.example.com/releases' # defaults to base_url
33
+ publish :feed_filename, 'releases.xml' # default
34
+
35
+ # Release Notes
36
+ publish :notes_base_url, 'http://downloads.example.com/releases_notes/' # defaults to base_url
37
+ # publish :notes_filename, 'test'
38
+
39
+ # App Package
40
+ # publish :package_base_url, 'http://downloads.example.com/releases/' # defaults to base_url
41
+
42
+ # publish :use_exported_private_key, true
43
+
44
+ publish :account, 'motion-sparkle-sandbox.sample-app'
45
+ publish :full_release_notes_url, 'http://example.com/full_release_notes_changed_again.html'
46
+ end
47
+ end
@@ -0,0 +1,15 @@
1
+ class AppDelegate
2
+ def applicationDidFinishLaunching(notification)
3
+ buildMenu
4
+ buildWindow
5
+ end
6
+
7
+ def buildWindow
8
+ @mainWindow = NSWindow.alloc.initWithContentRect([[240, 180], [480, 360]],
9
+ styleMask: NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
10
+ backing: NSBackingStoreBuffered,
11
+ defer: false)
12
+ @mainWindow.title = NSBundle.mainBundle.infoDictionary['CFBundleName']
13
+ @mainWindow.orderFrontRegardless
14
+ end
15
+ end
@@ -0,0 +1,155 @@
1
+ class AppDelegate
2
+ def buildMenu
3
+ @mainMenu = NSMenu.new
4
+
5
+ appName = NSBundle.mainBundle.infoDictionary['CFBundleName']
6
+
7
+ find_menu = createMenu('Find') do
8
+ addItemWithTitle('Find...', action: 'performFindPanelAction:', keyEquivalent: 'f')
9
+ addItemWithTitle('Find Next', action: 'performFindPanelAction:', keyEquivalent: 'g')
10
+ addItemWithTitle('Find Previous', action: 'performFindPanelAction:', keyEquivalent: 'G')
11
+ addItemWithTitle('Use Selection for Find', action: 'performFindPanelAction:', keyEquivalent: 'e')
12
+ addItemWithTitle('Jump to Selection', action: 'centerSelectionInVisibleArea:', keyEquivalent: 'j')
13
+ end
14
+
15
+ spelling_and_grammar_menu = createMenu('Spelling and Grammar') do
16
+ addItemWithTitle('Show Spelling and Grammar', action: 'showGuessPanel:', keyEquivalent: ':')
17
+ addItemWithTitle('Check Document Now', action: 'checkSpelling:', keyEquivalent: ';')
18
+ addItem(NSMenuItem.separatorItem)
19
+ addItemWithTitle('Check Spelling While Typing', action: 'toggleContinuousSpellChecking:', keyEquivalent: '')
20
+ addItemWithTitle('Check Grammar With Spelling', action: 'toggleGrammarChecking:', keyEquivalent: '')
21
+ addItemWithTitle('Correct Spelling Automatically', action: 'toggleAutomaticSpellingCorrection:', keyEquivalent: '')
22
+ end
23
+
24
+ substitutions_menu = createMenu('Substitutions') do
25
+ addItemWithTitle('Show Substitutions', action: 'orderFrontSubstitutionsPanel:', keyEquivalent: 'f')
26
+ addItem(NSMenuItem.separatorItem)
27
+ addItemWithTitle('Smart Copy/Paste', action: 'toggleSmartInsertDelete:', keyEquivalent: 'f')
28
+ addItemWithTitle('Smart Quotes', action: 'toggleAutomaticQuoteSubstitution:', keyEquivalent: 'g')
29
+ addItemWithTitle('Smart Dashes', action: 'toggleAutomaticDashSubstitution:', keyEquivalent: '')
30
+ addItemWithTitle('Smart Links', action: 'toggleAutomaticLinkDetection:', keyEquivalent: 'G')
31
+ addItemWithTitle('Text Replacement', action: 'toggleAutomaticTextReplacement:', keyEquivalent: '')
32
+ end
33
+
34
+ transformations_menu = createMenu('Transformations') do
35
+ addItemWithTitle('Make Upper Case', action: 'uppercaseWord:', keyEquivalent: '')
36
+ addItemWithTitle('Make Lower Case', action: 'lowercaseWord:', keyEquivalent: '')
37
+ addItemWithTitle('Capitalize', action: 'capitalizeWord:', keyEquivalent: '')
38
+ end
39
+
40
+ speech_menu = createMenu('Speech') do
41
+ addItemWithTitle('Start Speaking', action: 'startSpeaking:', keyEquivalent: '')
42
+ addItemWithTitle('Stop Speaking', action: 'stopSpeaking:', keyEquivalent: '')
43
+ end
44
+
45
+ addMenu(appName) do
46
+ addItemWithTitle("About #{appName}", action: 'orderFrontStandardAboutPanel:', keyEquivalent: '')
47
+ addItem(NSMenuItem.separatorItem)
48
+ addItemWithTitle('Preferences', action: 'openPreferences:', keyEquivalent: ',')
49
+ addItem(NSMenuItem.separatorItem)
50
+ servicesItem = addItemWithTitle('Services', action: nil, keyEquivalent: '')
51
+ NSApp.servicesMenu = servicesItem.submenu = NSMenu.new
52
+ addItem(NSMenuItem.separatorItem)
53
+ addItemWithTitle("Hide #{appName}", action: 'hide:', keyEquivalent: 'h')
54
+ item = addItemWithTitle('Hide Others', action: 'hideOtherApplications:', keyEquivalent: 'H')
55
+ item.keyEquivalentModifierMask = NSCommandKeyMask|NSAlternateKeyMask
56
+ addItemWithTitle('Show All', action: 'unhideAllApplications:', keyEquivalent: '')
57
+ addItem(NSMenuItem.separatorItem)
58
+ addItemWithTitle("Quit #{appName}", action: 'terminate:', keyEquivalent: 'q')
59
+ end
60
+
61
+ addMenu('File') do
62
+ addItemWithTitle('New', action: 'newDocument:', keyEquivalent: 'n')
63
+ addItemWithTitle('Open…', action: 'openDocument:', keyEquivalent: 'o')
64
+ addItem(NSMenuItem.separatorItem)
65
+ addItemWithTitle('Close', action: 'performClose:', keyEquivalent: 'w')
66
+ addItemWithTitle('Save…', action: 'saveDocument:', keyEquivalent: 's')
67
+ addItemWithTitle('Revert to Saved', action: 'revertDocumentToSaved:', keyEquivalent: '')
68
+ addItem(NSMenuItem.separatorItem)
69
+ addItemWithTitle('Page Setup…', action: 'runPageLayout:', keyEquivalent: 'P')
70
+ addItemWithTitle('Print…', action: 'printDocument:', keyEquivalent: 'p')
71
+ end
72
+
73
+ addMenu('Edit') do
74
+ addItemWithTitle('Undo', action: 'undo:', keyEquivalent: 'z')
75
+ addItemWithTitle('Redo', action: 'redo:', keyEquivalent: 'Z')
76
+ addItem(NSMenuItem.separatorItem)
77
+ addItemWithTitle('Cut', action: 'cut:', keyEquivalent: 'x')
78
+ addItemWithTitle('Copy', action: 'copy:', keyEquivalent: 'c')
79
+ addItemWithTitle('Paste', action: 'paste:', keyEquivalent: 'v')
80
+ item = addItemWithTitle('Paste and Match Style', action: 'pasteAsPlainText:', keyEquivalent: 'V')
81
+ item.keyEquivalentModifierMask = NSCommandKeyMask|NSAlternateKeyMask
82
+ addItemWithTitle('Delete', action: 'delete:', keyEquivalent: '')
83
+ addItemWithTitle('Select All', action: 'selectAll:', keyEquivalent: 'a')
84
+ addItem(NSMenuItem.separatorItem)
85
+ addItem(find_menu)
86
+ addItem(spelling_and_grammar_menu)
87
+ addItem(substitutions_menu)
88
+ addItem(transformations_menu)
89
+ addItem(speech_menu)
90
+ end
91
+
92
+ fontMenu = createMenu('Font') do
93
+ addItemWithTitle('Show Fonts', action: 'orderFrontFontPanel:', keyEquivalent: 't')
94
+ addItemWithTitle('Bold', action: 'addFontTrait:', keyEquivalent: 'b')
95
+ addItemWithTitle('Italic', action: 'addFontTrait:', keyEquivalent: 'i')
96
+ addItemWithTitle('Underline', action: 'underline:', keyEquivalent: 'u')
97
+ addItem(NSMenuItem.separatorItem)
98
+ addItemWithTitle('Bigger', action: 'modifyFont:', keyEquivalent: '+')
99
+ addItemWithTitle('Smaller', action: 'modifyFont:', keyEquivalent: '-')
100
+ end
101
+
102
+ textMenu = createMenu('Text') do
103
+ addItemWithTitle('Align Left', action: 'alignLeft:', keyEquivalent: '{')
104
+ addItemWithTitle('Center', action: 'alignCenter:', keyEquivalent: '|')
105
+ addItemWithTitle('Justify', action: 'alignJustified:', keyEquivalent: '')
106
+ addItemWithTitle('Align Right', action: 'alignRight:', keyEquivalent: '}')
107
+ addItem(NSMenuItem.separatorItem)
108
+ addItemWithTitle('Show Ruler', action: 'toggleRuler:', keyEquivalent: '')
109
+ item = addItemWithTitle('Copy Ruler', action: 'copyRuler:', keyEquivalent: 'c')
110
+ item.keyEquivalentModifierMask = NSCommandKeyMask|NSControlKeyMask
111
+ item = addItemWithTitle('Paste Ruler', action: 'pasteRuler:', keyEquivalent: 'v')
112
+ item.keyEquivalentModifierMask = NSCommandKeyMask|NSControlKeyMask
113
+ end
114
+
115
+ addMenu('Format') do
116
+ addItem fontMenu
117
+ addItem textMenu
118
+ end
119
+
120
+ addMenu('View') do
121
+ item = addItemWithTitle('Show Toolbar', action: 'toggleToolbarShown:', keyEquivalent: 't')
122
+ item.keyEquivalentModifierMask = NSCommandKeyMask|NSAlternateKeyMask
123
+ addItemWithTitle('Customize Toolbar…', action: 'runToolbarCustomizationPalette:', keyEquivalent: '')
124
+ end
125
+
126
+ NSApp.windowsMenu = addMenu('Window') do
127
+ addItemWithTitle('Minimize', action: 'performMiniaturize:', keyEquivalent: 'm')
128
+ addItemWithTitle('Zoom', action: 'performZoom:', keyEquivalent: '')
129
+ addItem(NSMenuItem.separatorItem)
130
+ addItemWithTitle('Bring All To Front', action: 'arrangeInFront:', keyEquivalent: '')
131
+ end.submenu
132
+
133
+ NSApp.helpMenu = addMenu('Help') do
134
+ addItemWithTitle("#{appName} Help", action: 'showHelp:', keyEquivalent: '?')
135
+ end.submenu
136
+
137
+ NSApp.mainMenu = @mainMenu
138
+ end
139
+
140
+ private
141
+
142
+ def addMenu(title, &b)
143
+ item = createMenu(title, &b)
144
+ @mainMenu.addItem item
145
+ item
146
+ end
147
+
148
+ def createMenu(title, &b)
149
+ menu = NSMenu.alloc.initWithTitle(title)
150
+ menu.instance_eval(&b) if b
151
+ item = NSMenuItem.alloc.initWithTitle(title, action: nil, keyEquivalent: '')
152
+ item.submenu = menu
153
+ item
154
+ end
155
+ end
@@ -0,0 +1,68 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "size" : "16x16",
5
+ "idiom" : "mac",
6
+ "filename" : "Icon_16x16.png",
7
+ "scale" : "1x"
8
+ },
9
+ {
10
+ "size" : "16x16",
11
+ "idiom" : "mac",
12
+ "filename" : "Icon_16x16@2x.png",
13
+ "scale" : "2x"
14
+ },
15
+ {
16
+ "size" : "32x32",
17
+ "idiom" : "mac",
18
+ "filename" : "Icon_32x32.png",
19
+ "scale" : "1x"
20
+ },
21
+ {
22
+ "size" : "32x32",
23
+ "idiom" : "mac",
24
+ "filename" : "Icon_32x32@2x.png",
25
+ "scale" : "2x"
26
+ },
27
+ {
28
+ "size" : "128x128",
29
+ "idiom" : "mac",
30
+ "filename" : "Icon_128x128.png",
31
+ "scale" : "1x"
32
+ },
33
+ {
34
+ "size" : "128x128",
35
+ "idiom" : "mac",
36
+ "filename" : "Icon_128x128@2x.png",
37
+ "scale" : "2x"
38
+ },
39
+ {
40
+ "size" : "256x256",
41
+ "idiom" : "mac",
42
+ "filename" : "Icon_256x256.png",
43
+ "scale" : "1x"
44
+ },
45
+ {
46
+ "size" : "256x256",
47
+ "idiom" : "mac",
48
+ "filename" : "Icon_256x256@2x.png",
49
+ "scale" : "2x"
50
+ },
51
+ {
52
+ "size" : "512x512",
53
+ "idiom" : "mac",
54
+ "filename" : "Icon_512x512.png",
55
+ "scale" : "1x"
56
+ },
57
+ {
58
+ "size" : "512x512",
59
+ "idiom" : "mac",
60
+ "filename" : "Icon_512x512@2x.png",
61
+ "scale" : "2x"
62
+ }
63
+ ],
64
+ "info" : {
65
+ "version" : 1,
66
+ "author" : "xcode"
67
+ }
68
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "version" : 1,
4
+ "author" : "xcode"
5
+ }
6
+ }
@@ -0,0 +1,29 @@
1
+ {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
2
+ {\colortbl;\red255\green255\blue255;}
3
+ \paperw9840\paperh8400
4
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
5
+
6
+ \f0\b\fs24 \cf0 Engineering:
7
+ \b0 \
8
+ Some people\
9
+ \
10
+
11
+ \b Human Interface Design:
12
+ \b0 \
13
+ Some other people\
14
+ \
15
+
16
+ \b Testing:
17
+ \b0 \
18
+ Hopefully not nobody\
19
+ \
20
+
21
+ \b Documentation:
22
+ \b0 \
23
+ Whoever\
24
+ \
25
+
26
+ \b With special thanks to:
27
+ \b0 \
28
+ Mom\
29
+ }
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe "Application 'sample-app'" do
4
+ before do
5
+ @app = NSApplication.sharedApplication
6
+ end
7
+
8
+ it 'has one window' do
9
+ @app.windows.size.should == 1
10
+ end
11
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path('spec_utils', __dir__)
4
+
5
+ describe 'Appcast' do
6
+ describe 'arguments' do
7
+ before do
8
+ @appcast = Motion::Project::Sparkle::Appcast.new(nil)
9
+ end
10
+
11
+ it 'defaults to empty' do
12
+ args = @appcast.prepare_args
13
+
14
+ expect(args).to eq []
15
+ end
16
+
17
+ it 'sets all command line options' do
18
+ expected_results = [
19
+ '--account=test1',
20
+ '-s=test2',
21
+ '--download-url-prefix=test3',
22
+ '--release-notes-url-prefix=test4',
23
+ '--full-release-notes-url=test5',
24
+ '--link=test6',
25
+ '--versions=test7',
26
+ '--maximum-deltas=test8',
27
+ '--delta-compression=test9',
28
+ '--delta-compression-level=test10',
29
+ '--channel=test11',
30
+ '--major-version=test12',
31
+ '--ignore-skipped-upgrades-below-version=test13',
32
+ '--phased-rollout-interval=test14',
33
+ '--critical-update-version=test15',
34
+ '--informational-update-versions=test16',
35
+ '-o=test17'
36
+ ]
37
+
38
+ @appcast.process_option(:account, 'test1')
39
+ @appcast.process_option(:private_eddsa_key, 'test2')
40
+ @appcast.process_option(:download_url_prefix, 'test3')
41
+ @appcast.process_option(:release_notes_url_prefix, 'test4')
42
+ @appcast.process_option(:full_release_notes_url, 'test5')
43
+ @appcast.process_option(:link, 'test6')
44
+ @appcast.process_option(:versions, 'test7')
45
+ @appcast.process_option(:maximum_deltas, 'test8')
46
+ @appcast.process_option(:delta_compression, 'test9')
47
+ @appcast.process_option(:delta_compression_level, 'test10')
48
+ @appcast.process_option(:channel, 'test11')
49
+ @appcast.process_option(:major_version, 'test12')
50
+ @appcast.process_option(:ignore_skipped_upgrades_below_version, 'test13')
51
+ @appcast.process_option(:phased_rollout_interval, 'test14')
52
+ @appcast.process_option(:critical_update_version, 'test15')
53
+ @appcast.process_option(:informational_update_versions, 'test16')
54
+ @appcast.process_option(:output_path, 'test17')
55
+ args = @appcast.prepare_args
56
+
57
+ expect(args).to match_array expected_results
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path('spec_utils', __dir__)
4
+
5
+ describe 'Sparkle setup' do
6
+ before(:all) do
7
+ @config = App.config
8
+ @config.project_dir = SpecUtils::TemporaryDirectory.directory.to_s
9
+ @config.instance_eval do
10
+ sparkle do
11
+ release :base_url, 'http://example.com/'
12
+ # release :public_key, 'public_key.pem'
13
+ publish :public_key, '<YOUR-EDDSA-PUBLIC-KEY>'
14
+ release :version, '1.0'
15
+
16
+ # Optional config options
17
+ release :feed_base_url, 'http://rss.example.com/'
18
+ release :feed_filename, 'example.xml'
19
+ release :notes_base_url, 'http://www.example.com/'
20
+ release :notes_filename, 'example.html'
21
+ release :package_base_url, 'http://download.example.com/'
22
+ release :package_filename, 'example.zip'
23
+ # publish :use_exported_private_key, true
24
+ end
25
+ end
26
+
27
+ Rake::Task['sparkle:setup'].invoke
28
+ end
29
+
30
+ # it 'should create private certificate' do
31
+ # expect(File.exist?(@config.sparkle.private_key_path.to_s)).to be_truthy
32
+ # end
33
+ #
34
+ # it 'should create public certificate' do
35
+ # expect(File.exist?(@config.sparkle.public_key_path.to_s)).to be_truthy
36
+ # end
37
+
38
+ it 'should add files to gitignore' do
39
+ a = `cat .gitignore`
40
+ expect(a.strip).not_to eq ''
41
+ end
42
+ end