glitter 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccf1fac2f80421104cc52201577fb06dc3306d34d771e5ba6c20bc8f645d2539
4
- data.tar.gz: bc8c6d9a44d27d393d465dd40d08802fda926106567473f3d1e78a6488cb2843
3
+ metadata.gz: d5b25b502d8fd9f488fc3a585a0702809f2214f6a77ad1515e883e82312b9b21
4
+ data.tar.gz: d203e7de82b1971071da0c728a02453497467b205a665db5e15bc74f7befa947
5
5
  SHA512:
6
- metadata.gz: efa24ff841f8fa88a4472e8fdedb83ce370fc8cc841ae914ca80de355d0311849643723b4b54a0c3ceaf487ca0721384dbb7af80333f302f8099b779a56b67a7
7
- data.tar.gz: 0d05e28c9846d6a40b366a536d87b818e78ae6ee1a5d3ed659c94259de78d9db9f0dea6d1c1d2f5ac84c11cf1e374428258334a6358acadd88697fb7cc01e7e1
6
+ metadata.gz: 6c822eb3df5f9ff913c64b0d4a39eacb7b3cbd058dce1f790a52213c698b0208a9435c37e71bf44b19806e27874ba0e16c7f407a77be1fe0c26597814448972b
7
+ data.tar.gz: 51b9f4da679636c7e004a2e12b6e618f2727dafe2f92769b7620c12d2c943805bc8ffc4be8d2b902ccf496a9fb7cb90b32b5e4609e592ceaca2214120d4fb8e5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.4
1
+ 3.1.4
data/Gemfile CHANGED
@@ -8,4 +8,5 @@ group :development, :test do
8
8
  gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
9
9
  gem 'guard-rspec'
10
10
  gem 'growl'
11
+ gem 'rexml'
11
12
  end
data/lib/glitter/cli.rb CHANGED
@@ -11,12 +11,14 @@ module Glitter
11
11
  method_option :minimum_system_version, :type => :string, :aliases => "-m"
12
12
  method_option :force, :type => :boolean, :aliases => "-f"
13
13
  method_option :timeout, :type => :numeric, :aliases => "-t", :default => Server::DEFAULT_S3_TIMEOUT
14
+ method_option :appcast_filename, :type => :string, :aliases => "-a", :default => "appcast.xml"
14
15
  def push(executable_path, *asset_paths)
15
16
  release = Release::Sparkle.new(channel, options.version)
16
17
  release.minimum_system_version = options.minimum_system_version
17
18
  release.bundle_version = options.bundle_version
18
19
  release.notes = options.notes
19
20
  release.executable = File.open executable_path
21
+ release.appcast_filename = options.appcast_filename if options.appcast_filename
20
22
  # For more complex releases, additional assets may need to go out with the build.
21
23
  asset_paths.each do |path|
22
24
  release.assets[File.basename(path)].tap do |asset|
@@ -16,6 +16,7 @@ module Glitter
16
16
  # Initialize a release and yield the block for configuration.
17
17
  def initialize(channel, version, logger = Logger.new($stdout), &block)
18
18
  @channel, @version, @logger = channel, version, logger
19
+ @appcast_filename = 'appcast.xml'
19
20
  block.call self if block_given?
20
21
  self
21
22
  end
@@ -69,7 +70,7 @@ module Glitter
69
70
  # A release consists of a binary asset, notes, a monotonically increasing version number, and
70
71
  # lives inside of a channel.
71
72
  class Sparkle < Base
72
- attr_accessor :notes, :executable, :filename
73
+ attr_accessor :notes, :executable, :filename, :appcast_filename
73
74
  attr_writer :published_at, :bundle_version, :minimum_system_version
74
75
 
75
76
  # Yeah, lets publish this shiz NOW.
@@ -106,7 +107,7 @@ module Glitter
106
107
 
107
108
  # Generates the XML appcast file needed to publish zie document
108
109
  def appcast_asset
109
- assets['appcast.xml'].tap do |a|
110
+ assets[appcast_filename].tap do |a|
110
111
  a.content = render_template 'appcast.xml.erb'
111
112
  a.content_type = 'application/xml'
112
113
  end
@@ -2,7 +2,7 @@
2
2
  <rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
3
3
  <channel>
4
4
  <title><%= channel.name %></title>
5
- <link><%= assets['appcast.xml'].url %></link>
5
+ <link><%= assets[appcast_filename].url %></link>
6
6
  <description>Software updates for <%= channel.name %></description>
7
7
  <language>en</language>
8
8
  <item>
@@ -1,3 +1,3 @@
1
1
  module Glitter
2
- VERSION = "2.2.1"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -12,6 +12,45 @@ describe Glitter do
12
12
  # end.push.head
13
13
  # end
14
14
 
15
+ context "when working with appcast filenames" do
16
+ let(:server) { double("Server") }
17
+ let(:bucket) { double("Bucket") }
18
+ let(:objects) { double("Objects") }
19
+ let(:s3_object) { double("S3Object") }
20
+ let(:channel) { Glitter::Channel.new("test", server) }
21
+
22
+ before do
23
+ allow(server).to receive(:bucket).and_return(bucket)
24
+ allow(bucket).to receive(:objects).and_return(objects)
25
+ allow(objects).to receive(:build).and_return(s3_object)
26
+ allow(s3_object).to receive(:content=)
27
+ allow(s3_object).to receive(:content_type=)
28
+ allow(s3_object).to receive(:key).and_return("test/1.0/appcast.xml")
29
+ allow(s3_object).to receive(:url).and_return("https://example.com/test/1.0/appcast.xml")
30
+ allow_any_instance_of(Glitter::Release::Sparkle).to receive(:render_template).and_return("<xml></xml>")
31
+ end
32
+
33
+ it "should use default appcast filename when not specified" do
34
+ release = Glitter::Release::Sparkle.new(channel, "1.0")
35
+ expect(release.instance_variable_get(:@appcast_filename)).to eq("appcast.xml")
36
+
37
+ asset = release.send(:appcast_asset)
38
+ expect(asset).to eq(s3_object)
39
+ end
40
+
41
+ it "should allow custom appcast filename" do
42
+ release = Glitter::Release::Sparkle.new(channel, "1.0") do |r|
43
+ r.appcast_filename = "custom-appcast.xml"
44
+ end
45
+
46
+ expect(release.instance_variable_get(:@appcast_filename)).to eq("custom-appcast.xml")
47
+
48
+ asset = release.send(:appcast_asset)
49
+ expect(asset).to eq(s3_object)
50
+ end
51
+ end
52
+
53
+
15
54
  it "AWS path segments are parsed correctly for an item at top level of version folder" do
16
55
  channel, version, key = Glitter::Release.object_segments("/channel/version/some-item")
17
56
  expect(channel).to eq("channel")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler, Thomas Hanley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-13 00:00:00.000000000 Z
11
+ date: 2025-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: s3
@@ -85,7 +85,7 @@ homepage: https://github.com/polleverywhere/glitter
85
85
  licenses:
86
86
  - MIT
87
87
  metadata: {}
88
- post_install_message:
88
+ post_install_message:
89
89
  rdoc_options: []
90
90
  require_paths:
91
91
  - lib
@@ -100,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.1.6
104
- signing_key:
103
+ rubygems_version: 3.3.26
104
+ signing_key:
105
105
  specification_version: 4
106
106
  summary: Publish Mac software updates with the Sparkle framework and Amazon S3.
107
107
  test_files: