joe 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/LICENSE +22 -0
  2. data/README.markdown +8 -26
  3. data/bin/joe +13 -0
  4. data/lib/joe.rb +88 -0
  5. metadata +39 -14
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2009 Damian Janowski and Michel Martens
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown CHANGED
@@ -1,7 +1,7 @@
1
1
  Joe
2
2
  ===
3
3
 
4
- Release your gems to RubyForge, no pain involved.
4
+ Release your gems, no pain involved.
5
5
 
6
6
 
7
7
  Usage
@@ -9,21 +9,15 @@ Usage
9
9
 
10
10
  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:
11
11
 
12
- $ thor joe:package
12
+ $ thor joe:build
13
13
 
14
- Congratulations, you should have your gem built and an archive copy inside the `pkg` directory.
14
+ Congratulations, you should have your gem built inside the `pkg` directory.
15
15
 
16
- Now go ahead and release your new gem to RubyForge:
16
+ Now go ahead and release your new gem to RubyGems.org:
17
17
 
18
18
  $ thor joe:release
19
19
 
20
- Easy, right? Wait a few minutes until RubyForge updates its gems index and you will be able to run `sudo gem install foo`.
21
-
22
-
23
- Troubleshooting
24
- ---------------
25
-
26
- 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.
20
+ Easy, right? Wait a few minutes until RubyGems.org updates its gems index and you will be able to run `sudo gem install foo`.
27
21
 
28
22
 
29
23
  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
37
31
  Installation
38
32
  ------------
39
33
 
40
- You need the `rubyforge` gem in order to release files. If you don't have it already:
41
-
42
- $ sudo gem install rubyforge
43
- $ rubyforge setup
44
- $ rubyforge config
45
-
46
- Make sure you have Thor installed:
47
-
48
- $ sudo gem install thor
49
-
50
- And then simply:
51
-
52
- $ thor install http://dimaion.com/joe/joe.thor
34
+ $ sudo gem install joe
53
35
 
54
36
  That's it. Try:
55
37
 
56
- $ thor -T
38
+ $ joe
57
39
 
58
- And you will get a list of Thor tasks.
40
+ And you will get a list of available tasks.
59
41
 
60
42
 
61
43
  Thanks
data/bin/joe ADDED
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env ruby -rubygems
2
+
3
+ require File.join(File.dirname(__FILE__), "..", "lib", "joe")
4
+
5
+ # A way to extend Joe is to write tasks in a Thorfile in the project's root directory.
6
+ # Joe loads the Thorfile if there is one, and all the tasks that are declared in the
7
+ # class Joe become available.
8
+ if File.exists?("Thorfile")
9
+ load("Thorfile")
10
+ end
11
+
12
+ # Start the joe tasks.
13
+ Joe.start
data/lib/joe.rb ADDED
@@ -0,0 +1,88 @@
1
+ require "thor"
2
+ require 'fileutils'
3
+ require 'erb'
4
+ require 'rubygems/gem_runner'
5
+
6
+ class Joe < Thor
7
+ VERSION = "0.0.2"
8
+
9
+ include Thor::Actions
10
+
11
+ desc "gemspec", "Generate the gemspec file out of the ERb template"
12
+ def gemspec
13
+ template "#{spec_file}.erb", spec_file, :force => true
14
+ end
15
+
16
+ desc "install", "Build the gem, package it and install it"
17
+ def install
18
+ build and
19
+ gem "install", gem_file
20
+ end
21
+
22
+ desc "build", "Build the gem"
23
+ def build
24
+ gemspec if File.exists?("#{spec_file}.erb")
25
+
26
+ gem "build", spec_file
27
+
28
+ if pkg(gem_file)
29
+ say_status :created, gem_file
30
+ true
31
+ else
32
+ say "Unable to build #{gem_file}"
33
+ false
34
+ end
35
+ end
36
+
37
+ desc "archive", "Create a .tar.gz archive out of the current HEAD"
38
+ def archive
39
+ if system("git archive --prefix=#{spec.name}-#{spec.version}/ --format=tar HEAD | gzip > #{archive_file}") && pkg(archive_file)
40
+ say_status :created, archive_file
41
+ true
42
+ end
43
+ end
44
+
45
+ desc "release", "Publish gem to RubyGems.org"
46
+ def release
47
+ build
48
+ say "Releasing #{gem_file}..."
49
+ gem "push", "pkg/#{gem_file}"
50
+ end
51
+
52
+ def self.source_root
53
+ "."
54
+ end
55
+
56
+ protected
57
+
58
+ def pkg(file)
59
+ FileUtils.mkdir_p("pkg")
60
+ File.exist?(file) && FileUtils.mv(file, "pkg")
61
+ end
62
+
63
+ def spec_file
64
+ Dir["*.gemspec"].first || Dir["*.gemspec.erb"].first.sub(/\.erb$/, '')
65
+ end
66
+
67
+ def spec
68
+ @spec ||=
69
+ begin
70
+ @spec = eval(File.read(spec_file))
71
+ rescue Errno::ENOENT
72
+ say_status :not_found, spec_file
73
+ exit 1
74
+ end
75
+ end
76
+
77
+ def gem_file
78
+ spec.file_name
79
+ end
80
+
81
+ def archive_file
82
+ gem_file.sub(/\.gem$/, ".tar.gz")
83
+ end
84
+
85
+ def gem(*args)
86
+ Gem::GemRunner.new.run(args)
87
+ end
88
+ end
metadata CHANGED
@@ -1,29 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - Damian Janowski
13
+ - Michel Martens
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-06-08 00:00:00 -03:00
18
+ date: 2010-04-26 00:00:00 -03:00
13
19
  default_executable:
14
- dependencies: []
15
-
16
- description:
17
- email: damian.janowski@gmail.com
18
- executables: []
19
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: thor
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 11
31
+ version: "0.11"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: "Joe builds on top of Thor\xE2\x80\x99s awesomeness to take you from a gem specification to world domination in a single step."
35
+ email:
36
+ - djanowski@dimaion.com
37
+ - michel@soveran.com
38
+ executables:
39
+ - joe
20
40
  extensions: []
21
41
 
22
42
  extra_rdoc_files: []
23
43
 
24
44
  files:
45
+ - LICENSE
25
46
  - README.markdown
26
- has_rdoc: false
47
+ - bin/joe
48
+ - lib/joe.rb
49
+ has_rdoc: true
27
50
  homepage: http://github.com/djanowski/joe
28
51
  licenses: []
29
52
 
@@ -36,20 +59,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
36
59
  requirements:
37
60
  - - ">="
38
61
  - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
39
64
  version: "0"
40
- version:
41
65
  required_rubygems_version: !ruby/object:Gem::Requirement
42
66
  requirements:
43
67
  - - ">="
44
68
  - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
45
71
  version: "0"
46
- version:
47
72
  requirements: []
48
73
 
49
74
  rubyforge_project:
50
- rubygems_version: 1.3.2
75
+ rubygems_version: 1.3.6
51
76
  signing_key:
52
- specification_version: 2
53
- summary: Release to RubyForge, the easy way.
77
+ specification_version: 3
78
+ summary: Joe, the gem publisher
54
79
  test_files: []
55
80