glitter 2.0.0.alpha4 → 2.0.0.alpha5

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.
data/lib/glitter/cli.rb CHANGED
@@ -4,27 +4,28 @@ module Glitter
4
4
  # Command line interface for cutting glitter builds
5
5
  class CLI < Thor
6
6
  desc "push", "pushes a build to a channel with release notes."
7
- method_option :notes, :type => :string, :aliases => "-n"
7
+ method_option :notes, :type => :string, :aliases => "-n"
8
8
  method_option :version, :type => :string, :aliases => "-v"
9
9
  method_option :channel, :type => :string, :aliases => "-c"
10
-
10
+ method_option :force, :type => :boolean, :aliases => "-f"
11
11
  def push(executable_path)
12
+ p options
12
13
  server = Server.new.channel(options.channel)
13
14
  release = Release::Sparkle.new(server, options.version)
14
- release.notes = options.notes
15
- release.executable = File.open executable_path
16
- release.push.head
15
+ release.notes = options.notes
16
+ release.executable = File.open executable_path
17
+ release.push(:force => options.force).head
17
18
  end
18
19
 
19
20
  desc "version", "print the version of glitter."
20
21
  def version
21
22
  puts Glitter::VERSION
22
23
  end
24
+
23
25
  # desc "yank", "remove a build from a release channel"
24
26
  # method_option :version, :type => :string, :aliases => "-v"
25
27
  # method_option :channel, :type => :string, :aliases => "-c"
26
28
  # def yank
27
29
  # end
28
-
29
30
  end
30
31
  end
@@ -21,8 +21,14 @@ module Glitter
21
21
  end
22
22
 
23
23
  # Push assets up to the S3 bucket path `/:channel/:version/*`.
24
- def push
25
- raise ExistingReleaseError.new("Existing build at version #{version}. Increment the version and push again.") if version_exists?
24
+ def push(opts={})
25
+ p opts
26
+ if !opts[:force] and version_exists?
27
+ raise ExistingReleaseError.new("Existing build at version #{version}. Increment the version and push again.")
28
+ end
29
+
30
+ logger.warn "Forced push" if opts[:force]
31
+
26
32
  logger.info "Pushing version #{version} to #{channel.name}"
27
33
  assets.each do |key, object|
28
34
  logger.info " PUT #{key} to #{object.url}"
@@ -73,11 +79,11 @@ module Glitter
73
79
  end
74
80
 
75
81
  # Generate assets and push
76
- def push
82
+ def push(*args)
77
83
  notes_asset
78
84
  appcast_asset
79
85
  executable_asset
80
- super
86
+ super(*args)
81
87
  end
82
88
 
83
89
  private
@@ -1,3 +1,3 @@
1
1
  module Glitter
2
- VERSION = "2.0.0.alpha4"
2
+ VERSION = "2.0.0.alpha5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha4
4
+ version: 2.0.0.alpha5
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-02 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: s3
16
- requirement: &70115107168280 !ruby/object:Gem::Requirement
16
+ requirement: &70351787517980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70115107168280
24
+ version_requirements: *70351787517980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml
27
- requirement: &70115107167840 !ruby/object:Gem::Requirement
27
+ requirement: &70351787517560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70115107167840
35
+ version_requirements: *70351787517560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &70115107167400 !ruby/object:Gem::Requirement
38
+ requirement: &70351787517120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70115107167400
46
+ version_requirements: *70351787517120
47
47
  description: Glitter makes it easy to publish software updates via the Sparkle framework
48
48
  by using S3 buckets.
49
49
  email: