Class: Raketeer::GitHubPkgTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Raketeer::GitHubPkgTask
- Defined in:
- lib/raketeer/github_pkg_task.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(name = :github_pkg) {|_self| ... } ⇒ GitHubPkgTask
constructor
A new instance of GitHubPkgTask.
Constructor Details
#initialize(name = :github_pkg) {|_self| ... } ⇒ GitHubPkgTask
Returns a new instance of GitHubPkgTask.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/raketeer/github_pkg_task.rb', line 28 def initialize(name=:github_pkg) super() @deps = [:build] @description = "Publish this project's gem(s) to GitHub Packages" @name = name @username = nil yield self if block_given? @username = Util.find_github_username if @username.nil? raise "#{self.class.name}.username is nil" if @username.nil? define end |
Instance Attribute Details
#deps ⇒ Object
23 24 25 |
# File 'lib/raketeer/github_pkg_task.rb', line 23 def deps @deps end |
#description ⇒ Object
24 25 26 |
# File 'lib/raketeer/github_pkg_task.rb', line 24 def description @description end |
#name ⇒ Object
25 26 27 |
# File 'lib/raketeer/github_pkg_task.rb', line 25 def name @name end |
#username ⇒ Object
26 27 28 |
# File 'lib/raketeer/github_pkg_task.rb', line 26 def username @username end |
Instance Method Details
#define ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/raketeer/github_pkg_task.rb', line 45 def define desc @description task @name => Array(@deps) do |task,args| sh_cmd = ['gem'] sh_cmd.push('push') sh_cmd.push('--key','github') sh_cmd.push('--host',"https://rubygems.pkg.github.com/#{username}") sh_cmd.push(*Dir.glob(File.join('pkg','*.gem'))) # Is this okay for multiple gems? sh(*sh_cmd) end end |