Permalink
Browse files

Added install task that installs the packaged gem

  • Loading branch information...
1 parent 7c95dbc commit 0a877268b77c94ac38b61f43b412382f2974d534 @soveran soveran committed Jul 22, 2009
Showing with 22 additions and 14 deletions.
  1. +22 −14 joe.thor
View
@@ -11,15 +11,19 @@ class Joe < Thor
template "#{spec_file}.erb", spec_file, :force => true
end
- def spec_file
- Dir["*.gemspec"].first || Dir["*.gemspec.erb"].first.sub(/\.erb$/, '')
- end
-
desc "package", "Build the gem, package it and create a .tar.gz archive"
def package
build and archive
end
+ desc "install", "Build the gem, package it and install it"
+ method_options(:docs => :boolean)
+ def install
+ build
+ docs = " --no-rdoc --no-ri" unless options[:docs]
+ system "sudo gem install #{gem_file}#{docs}"
+ end
+
desc "build", "Build the gem"
def build
gemspec
@@ -44,16 +48,6 @@ class Joe < Thor
end
end
- def spec
- @spec ||=
- begin
- @spec = eval(File.read(spec_file))
- rescue Errno::ENOENT
- say_status :not_found, spec_file
- exit 1
- end
- end
-
desc "release", "Publish gem and tarball to RubyForge"
method_options(:project => :string, :package => :string)
def release
@@ -68,6 +62,20 @@ class Joe < Thor
protected
+ def spec_file
+ Dir["*.gemspec"].first || Dir["*.gemspec.erb"].first.sub(/\.erb$/, '')
+ end
+
+ def spec
+ @spec ||=
+ begin
+ @spec = eval(File.read(spec_file))
+ rescue Errno::ENOENT
+ say_status :not_found, spec_file
+ exit 1
+ end
+ end
+
def artifact(extension)
"pkg/#{spec.name}-#{spec.version}#{extension}"
end

0 comments on commit 0a87726

Please sign in to comment.