Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade Joe to gem.

  • Loading branch information...
commit 17a86f06a05185e18ed7b4c836ab341e49c8f5ed 1 parent dcd2202
@soveran soveran authored
View
3  .gitignore
@@ -1,2 +1 @@
-README.html
-sample.gemspec
+/pkg
View
34 README.markdown
@@ -1,7 +1,7 @@
Joe
===
-Release your gems to RubyForge, no pain involved.
+Release your gems, no pain involved.
Usage
@@ -9,21 +9,15 @@ Usage
Joe assumes you have a .gemspec file in the current directory and it will use it to build the gem. Once you have it, try this:
- $ thor joe:package
+ $ thor joe:build
-Congratulations, you should have your gem built and an archive copy inside the `pkg` directory.
+Congratulations, you should have your gem built inside the `pkg` directory.
-Now go ahead and release your new gem to RubyForge:
+Now go ahead and release your new gem to RubyGems.org:
$ thor joe:release
-Easy, right? Wait a few minutes until RubyForge updates its gems index and you will be able to run `sudo gem install foo`.
-
-
-Troubleshooting
----------------
-
-If you get an error about a missing `group_id`, try running `rubyforge config`. This hooks up your RubyForge account with the gem and configures where to release it.
+Easy, right? Wait a few minutes until RubyGems.org updates its gems index and you will be able to run `sudo gem install foo`.
Maintaining a gemspec file
@@ -37,25 +31,13 @@ The easiest way we've found to maintain a gemspec file is by creating a `foo.gem
Installation
------------
-You need the `rubyforge` gem in order to release files. If you don't have it already:
-
- $ sudo gem install rubyforge
- $ rubyforge setup
- $ rubyforge config
-
-Make sure you have Thor installed:
-
- $ sudo gem install thor
-
-And then simply:
-
- $ thor install http://dimaion.com/joe/joe.thor
+ $ sudo gem install joe
That's it. Try:
- $ thor -T
+ $ joe
-And you will get a list of Thor tasks.
+And you will get a list of available tasks.
Thanks
View
12 Thorfile
@@ -1,12 +0,0 @@
-class Joe < Thor
- desc "deploy", "Deploys Joe"
- def deploy
- system "scp joe.thor sample.gemspec.erb dimaion.com:www/joe/"
- install_joe
- end
-
- desc "install_joe", "Installs the local copy of Joe"
- def install_joe
- invoke :install, "http://dimaion.com/joe/joe.thor"
- end
-end
View
13 bin/joe
@@ -0,0 +1,13 @@
+#! /usr/bin/env ruby -rubygems
+
+require File.join(File.dirname(__FILE__), "..", "lib", "joe")
+
+# A way to extend Joe is to write tasks in a Thorfile in the project's root directory.
+# Joe loads the Thorfile if there is one, and all the tasks that are declared in the
+# class Joe become available.
+if File.exists?("Thorfile")
+ load("Thorfile")
+end
+
+# Start the joe tasks.
+Joe.start
View
0  sample.gemspec.erb → example/sample.gemspec.erb
File renamed without changes
View
13 joe.gemspec
@@ -0,0 +1,13 @@
+Gem::Specification.new do |s|
+ s.name = "joe"
+ s.version = "0.0.2"
+ s.summary = "Joe, the gem publisher"
+ s.description = "Joe builds on top of Thor’s awesomeness to take you from a gem specification to world domination in a single step."
+ s.author = "Damian Janowski"
+ s.email = "djanowski@gmail.com"
+ s.homepage = "http://github.com/djanowski/joe"
+ s.files = ["LICENSE", "README.markdown", "bin/joe", "lib/joe.rb"]
+
+ s.executables.push("joe")
+ s.add_dependency("thor", "~> 0.11")
+end
View
19 joe.gemspec.erb
@@ -0,0 +1,19 @@
+<% require "lib/joe" -%>
+Gem::Specification.new do |s|
+ s.name = "joe"
+ s.version = "<%= Joe::VERSION %>"
+ s.summary = "Joe, the gem publisher"
+ s.description = "Joe builds on top of Thor’s awesomeness to take you from a gem specification to world domination in a single step."
+ s.author = "Damian Janowski"
+ s.email = "djanowski@gmail.com"
+ s.homepage = "http://github.com/djanowski/joe"
+ s.files = <%= Dir[
+ "LICENSE",
+ "README*",
+ "bin/*",
+ "lib/**/*.rb"
+ ].inspect %>
+
+ s.executables.push("joe")
+ s.add_dependency("thor", "~> 0.11")
+end
View
7 joe.thor → lib/joe.rb
@@ -1,10 +1,11 @@
-# module: joe
-
+require "thor"
require 'fileutils'
require 'erb'
require 'rubygems/gem_runner'
class Joe < Thor
+ VERSION = "0.0.2"
+
include Thor::Actions
desc "gemspec", "Generate the gemspec file out of the ERb template"
@@ -41,7 +42,7 @@ def archive
end
end
- desc "release", "Publish gem to RubyForge"
+ desc "release", "Publish gem to RubyGems.org"
def release
build
say "Releasing #{gem_file}..."

0 comments on commit 17a86f0

Please sign in to comment.
Something went wrong with that request. Please try again.