Class: Glitter::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/glitter/cli.rb

Overview

Command line interface for cutting glitter builds

Instance Method Summary collapse

Instance Method Details

#channelsObject



36
37
38
39
40
# File 'lib/glitter/cli.rb', line 36

def channels
  server.channel_versions.each do |channel, _|
    puts channel
  end
end

#push(executable_path, *asset_paths) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/glitter/cli.rb', line 12

def push(executable_path, *asset_paths)
  release = Release::Sparkle.new(channel, options.version)
  release.bundle_version = options.bundle_version
  release.notes       = options.notes
  release.executable  = File.open executable_path
  # For more complex releases, additional assets may need to go out with the build.
  asset_paths.each do |path|
    release.assets[File.basename(path)].tap do |asset|
      asset.content = File.open path
      asset.content_type = 'application/octet-stream'
    end
  end
  release.push(:force => options.force).head
end

#versionObject



43
44
45
# File 'lib/glitter/cli.rb', line 43

def version
  puts Glitter::VERSION
end

#versionsObject



29
30
31
32
33
# File 'lib/glitter/cli.rb', line 29

def versions
  channel.versions.each do |version|
    puts version
  end
end