shoe 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{data/shoe/templates/gitignore.erb → .gitignore} +1 -1
- data/.rvmrc +1 -0
- data/CHANGELOG.rdoc +9 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +39 -0
- data/README.rdoc +20 -72
- data/Rakefile +6 -0
- data/TODO.rdoc +10 -5
- data/lib/shoe.rb +29 -13
- data/lib/shoe/extensions.rb +0 -4
- data/lib/shoe/extensions/specification.rb +0 -4
- data/lib/shoe/extensions/validator.rb +40 -11
- data/lib/shoe/tasks.rb +13 -22
- data/lib/shoe/tasks/clean.rb +4 -4
- data/lib/shoe/tasks/compile.rb +2 -4
- data/lib/shoe/tasks/cucumber.rb +5 -9
- data/lib/shoe/tasks/rdoc.rb +2 -3
- data/lib/shoe/tasks/ronn.rb +5 -5
- data/lib/shoe/tasks/{abstract.rb → task.rb} +1 -1
- data/lib/shoe/tasks/test.rb +17 -57
- data/lib/shoe/util/minitest_colors.rb +60 -0
- data/lib/shoe/version.rb +3 -0
- data/man/shoe.3 +5 -11
- data/man/shoe.3.ronn +4 -13
- data/shoe.gemspec +35 -0
- data/test/helper.rb +6 -12
- data/test/support/assertions.rb +45 -0
- data/test/support/command_runner.rb +11 -0
- data/test/support/declarative_tests.rb +24 -0
- data/test/support/example_project.rb +37 -0
- data/test/support/file_manipulation.rb +43 -0
- data/test/support/gemspec_manipulation.rb +24 -0
- data/test/support/project_files.rb +60 -0
- data/test/support/redgreen.rb +6 -0
- data/test/system/rake_test.rb +124 -0
- metadata +75 -96
- data/bin/shoe +0 -18
- data/data/shoe/templates/application.erb +0 -23
- data/data/shoe/templates/executable.erb +0 -18
- data/data/shoe/templates/extconf.erb +0 -2
- data/data/shoe/templates/extension.erb +0 -25
- data/data/shoe/templates/gemspec.erb +0 -44
- data/data/shoe/templates/gitkeep.erb +0 -0
- data/data/shoe/templates/manpage_1.erb +0 -29
- data/data/shoe/templates/manpage_3.erb +0 -19
- data/data/shoe/templates/module.erb +0 -31
- data/data/shoe/templates/module_test.rb +0 -7
- data/data/shoe/templates/rakefile.erb +0 -3
- data/data/shoe/templates/readme.erb +0 -3
- data/data/shoe/templates/test_helper.erb +0 -9
- data/lib/shoe/extensions/option_parser.rb +0 -52
- data/lib/shoe/extensions/pathname.rb +0 -16
- data/lib/shoe/extensions/source_index.rb +0 -17
- data/lib/shoe/extensions/test_runner.rb +0 -28
- data/lib/shoe/generator.rb +0 -147
- data/lib/shoe/tasks/release.rb +0 -81
- data/man/shoe.1 +0 -63
- data/man/shoe.1.ronn +0 -60
- data/test/extensions/fake_rubygems_server.rb +0 -62
- data/test/extensions/helper_methods.rb +0 -73
- data/test/extensions/isolated_environment.rb +0 -50
- data/test/extensions/test_case.rb +0 -40
- data/test/system/rake_clean_test.rb +0 -36
- data/test/system/rake_compile_test.rb +0 -25
- data/test/system/rake_cucumber_test.rb +0 -51
- data/test/system/rake_rdoc_test.rb +0 -26
- data/test/system/rake_release_test.rb +0 -94
- data/test/system/rake_ronn_test.rb +0 -25
- data/test/system/rake_test_test.rb +0 -45
- data/test/system/shoe_test.rb +0 -79
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use @shoe
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
==
|
1
|
+
== 0.7.0 -- 2010 October 11
|
2
|
+
|
3
|
+
* 1.9 compatibility!
|
4
|
+
* Remove shoe generator; use `bundle gem foo` instead.
|
5
|
+
* Remove release tasks; suggest Bundler's instead.
|
6
|
+
* Use Shoe.install_tasks to auto-detect gemspec.
|
7
|
+
* Remove dependency on launchy.
|
8
|
+
|
9
|
+
== 0.6.2 -- 2010 April 29
|
2
10
|
|
3
11
|
* Generated C extension actually works now.
|
4
12
|
* `rake test` now properly depends on `rake compile`.
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
shoe (0.7.0)
|
5
|
+
rake (~> 0.8.7)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
builder (2.1.2)
|
11
|
+
cucumber (0.6.4)
|
12
|
+
builder (>= 2.1.2)
|
13
|
+
diff-lcs (>= 1.1.2)
|
14
|
+
json_pure (>= 1.2.0)
|
15
|
+
polyglot (>= 0.2.9)
|
16
|
+
term-ansicolor (>= 1.0.4)
|
17
|
+
treetop (>= 1.4.2)
|
18
|
+
diff-lcs (1.1.2)
|
19
|
+
hpricot (0.8.2)
|
20
|
+
json_pure (1.4.3)
|
21
|
+
polyglot (0.3.1)
|
22
|
+
rake (0.8.7)
|
23
|
+
rdiscount (1.6.3.1)
|
24
|
+
ronn (0.5)
|
25
|
+
hpricot (>= 0.8.2)
|
26
|
+
rdiscount (>= 1.5.8)
|
27
|
+
term-ansicolor (1.0.5)
|
28
|
+
treetop (1.4.8)
|
29
|
+
polyglot (>= 0.3.1)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
bundler (~> 1.0.0)
|
36
|
+
cucumber (~> 0.6.4)
|
37
|
+
rake (~> 0.8.7)
|
38
|
+
ronn (~> 0.5)
|
39
|
+
shoe!
|
data/README.rdoc
CHANGED
@@ -1,24 +1,13 @@
|
|
1
1
|
= Shoe
|
2
2
|
|
3
|
-
|
3
|
+
Configuration-free Rake tasks that {read your
|
4
|
+
gemspec}[http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/] and
|
5
|
+
re-use
|
6
|
+
{built-in}[http://rubygems.rubyforge.org/rubygems-update/Gem/Ext/ExtConfBuilder.html]
|
7
|
+
{Rubygems}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html]
|
8
|
+
{functionality}[http://rubygems.rubyforge.org/rubygems-update/Gem/Validator.html].
|
4
9
|
|
5
|
-
|
6
|
-
Hoe[http://seattlerb.rubyforge.org/hoe] and
|
7
|
-
Jeweler[http://github.com/technicalpickles/jeweler] do.
|
8
|
-
(Background[http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/].)
|
9
|
-
|
10
|
-
* It <b>uses Rubygems</b>
|
11
|
-
{for}[http://rubygems.rubyforge.org/rubygems-update/Gem/Ext/ExtConfBuilder.html]
|
12
|
-
{common}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html]
|
13
|
-
{functionality}[http://rubygems.rubyforge.org/rubygems-update/Gem/Validator.html],
|
14
|
-
rather than
|
15
|
-
{reinventing}[http://github.com/luislavena/rake-compiler/]
|
16
|
-
{the}[http://rake.rubyforge.org/classes/Rake/RDocTask.html]
|
17
|
-
{wheel}[http://rake.rubyforge.org/classes/Rake/TestTask.html].
|
18
|
-
|
19
|
-
* It <b>follows the
|
20
|
-
{Ruby Packaging Standard}[http://chneukirchen.github.com/rps/]</b>
|
21
|
-
when generating project files.
|
10
|
+
Shoe works great on both Ruby 1.8 and 1.9.
|
22
11
|
|
23
12
|
|
24
13
|
== Install
|
@@ -29,58 +18,37 @@ Shoe is an ecosystem-friendly library of Rake tasks for your gem.
|
|
29
18
|
== Use
|
30
19
|
|
31
20
|
require 'shoe'
|
32
|
-
|
33
|
-
Shoe::Tasks.define('my_project.gemspec')
|
21
|
+
Shoe.install_tasks
|
34
22
|
|
35
23
|
|
36
24
|
== Configure
|
37
25
|
|
38
|
-
|
26
|
+
Keep your configuration DRY: use your gemspec! (And friends.)
|
39
27
|
|
40
28
|
Shoe::Tasks::Clean::
|
41
|
-
|
42
|
-
<tt>.bundle/</tt> and <tt>.rvmrc</tt>.
|
29
|
+
{.gitignore}[http://www.kernel.org/pub/software/scm/git/docs/gitignore.html]
|
43
30
|
|
44
31
|
Shoe::Tasks::Compile::
|
45
|
-
|
46
|
-
<tt>extensions[http://docs.rubygems.org/read/chapter/20#extensions]</tt> in
|
47
|
-
your gemspec.
|
32
|
+
{#extensions}[http://docs.rubygems.org/read/chapter/20#extensions]
|
48
33
|
|
49
34
|
Shoe::Tasks::Cucumber::
|
50
|
-
|
51
|
-
<tt>{cucumber.yml}[http://wiki.github.com/aslakhellesoy/cucumber/cucumberyml]</tt>.
|
35
|
+
cucumber.yml[http://wiki.github.com/aslakhellesoy/cucumber/cucumberyml]
|
52
36
|
|
53
37
|
Shoe::Tasks::Rdoc::
|
54
|
-
|
55
|
-
|
56
|
-
and
|
57
|
-
<tt>extra_rdoc_files[http://docs.rubygems.org/read/chapter/20#extra_rdoc_files]</tt>
|
58
|
-
in your gemspec.
|
59
|
-
|
60
|
-
Shoe::Tasks::Release::
|
61
|
-
calls <tt>`git tag`</tt>, <tt>`git push`</tt>, <tt>`gem build`</tt> and
|
62
|
-
<tt>`gem push`</tt>, of course.
|
38
|
+
{#rdoc_options}[http://docs.rubygems.org/read/chapter/20#rdoc_options],
|
39
|
+
{#extra_rdoc_files}[http://docs.rubygems.org/read/chapter/20#extra_rdoc_files]
|
63
40
|
|
64
41
|
Shoe::Tasks::Ronn::
|
65
|
-
|
66
|
-
|
67
|
-
<tt>date[http://docs.rubygems.org/read/chapter/20#date]</tt>
|
68
|
-
and the first
|
69
|
-
<tt>author[http://docs.rubygems.org/read/chapter/20#authors]</tt>
|
70
|
-
in your gemspec.
|
42
|
+
{#date}[http://docs.rubygems.org/read/chapter/20#date],
|
43
|
+
{#author}[http://docs.rubygems.org/read/chapter/20#authors]
|
71
44
|
|
72
45
|
Shoe::Tasks::Test::
|
73
|
-
|
74
|
-
<tt>test_files[http://docs.rubygems.org/read/chapter/20#test_files]</tt> in
|
75
|
-
your gemspec.
|
76
|
-
|
77
|
-
Each Task class definition has more specific configuration notes.
|
46
|
+
{#test_files}[http://docs.rubygems.org/read/chapter/20#test_files]
|
78
47
|
|
79
48
|
|
80
49
|
== Cherry Pick
|
81
50
|
|
82
|
-
If you don't want to use all the
|
83
|
-
want:
|
51
|
+
If you don't want to use all the tasks, just instantiate the ones you want:
|
84
52
|
|
85
53
|
require 'shoe'
|
86
54
|
|
@@ -88,27 +56,7 @@ want:
|
|
88
56
|
Shoe::Tasks::Rdoc.new('my_project.gemspec')
|
89
57
|
|
90
58
|
|
91
|
-
== Bootstrap
|
92
|
-
|
93
|
-
The provided <tt>shoe</tt> executable will generate a helpful gemspec and some
|
94
|
-
other skeleton files for your new project:
|
95
|
-
|
96
|
-
$ shoe my_project
|
97
|
-
|
98
|
-
For more, run:
|
99
|
-
|
100
|
-
$ shoe --help
|
101
|
-
|
102
|
-
Or, if you have <tt>{gem-man}[http://github.com/defunkt/gem-man]</tt> installed:
|
103
|
-
|
104
|
-
$ gem man shoe
|
105
|
-
|
106
|
-
|
107
59
|
== Contribute
|
108
60
|
|
109
|
-
|
110
|
-
|
111
|
-
for making Shoe better, I'd love to hear them! Feel free to send issues / pull
|
112
|
-
requests / messages through GitHub.
|
113
|
-
|
114
|
-
All the best, -- Matthew
|
61
|
+
Feel free to send issues / pull requests / messages through
|
62
|
+
GitHub[http://github.com/matthewtodd/shoe].
|
data/Rakefile
ADDED
data/TODO.rdoc
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
= Next Up
|
2
2
|
|
3
|
-
* Remove Launchy? (Follow hub's lead.)
|
4
3
|
* Start running on 1.9: Gem::Validator uses MiniTest::Unit.
|
5
4
|
|
6
5
|
= Someday Maybe
|
7
6
|
|
8
7
|
* Re-think focus: probably want to ditch cucumber, since I'm not using it for shoe?
|
9
|
-
* Document rake task
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
8
|
+
* Document rake task hook prepare.
|
9
|
+
* Reintroduce a command-line tool to fill in the gaps left by bundler:
|
10
|
+
* Modify the gemspec:
|
11
|
+
* Help setting rdoc_options and extra_rdoc_files.
|
12
|
+
* Help setting author and email?
|
13
|
+
* Help setting extensions?
|
14
|
+
* Generate a C extension.
|
15
|
+
* Generate a data directory and provide access to it.
|
16
|
+
* Generate man pages.
|
17
|
+
* Generate an .rvmrc.
|
data/lib/shoe.rb
CHANGED
@@ -1,22 +1,38 @@
|
|
1
|
-
require '
|
2
|
-
require 'rbconfig'
|
3
|
-
require 'rbconfig/datadir'
|
1
|
+
require 'shoe/version'
|
4
2
|
|
5
3
|
module Shoe
|
6
|
-
VERSION = '0.6.2'
|
7
|
-
|
8
4
|
autoload :Extensions, 'shoe/extensions'
|
9
|
-
autoload :Generator, 'shoe/generator'
|
10
5
|
autoload :Tasks, 'shoe/tasks'
|
11
6
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
class << self
|
8
|
+
def browse(url)
|
9
|
+
system(browser, url)
|
10
|
+
end
|
11
|
+
|
12
|
+
def install_tasks(name='*')
|
13
|
+
Tasks.define Dir["#{name}.gemspec"].first
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
# stolen from hub
|
19
|
+
def browser
|
20
|
+
if ENV['BROWSER']
|
21
|
+
ENV['BROWSER']
|
22
|
+
elsif RUBY_PLATFORM.include?('darwin')
|
23
|
+
'open'
|
24
|
+
elsif command?("xdg-open")
|
25
|
+
'xdg-open'
|
26
|
+
elsif command?("cygstart")
|
27
|
+
'cygstart'
|
28
|
+
else
|
29
|
+
abort 'Please set $BROWSER to a web launcher to use this command.'
|
18
30
|
end
|
19
|
-
|
31
|
+
end
|
32
|
+
|
33
|
+
def command?(name)
|
34
|
+
`which #{name} 2>/dev/null`
|
35
|
+
$?.success?
|
20
36
|
end
|
21
37
|
end
|
22
38
|
end
|
data/lib/shoe/extensions.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
module Shoe
|
2
2
|
module Extensions
|
3
3
|
autoload :DocManager, 'shoe/extensions/doc_manager'
|
4
|
-
autoload :OptionParser, 'shoe/extensions/option_parser'
|
5
|
-
autoload :Pathname, 'shoe/extensions/pathname'
|
6
|
-
autoload :SourceIndex, 'shoe/extensions/source_index'
|
7
4
|
autoload :Specification, 'shoe/extensions/specification'
|
8
|
-
autoload :TestRunner, 'shoe/extensions/test_runner'
|
9
5
|
autoload :Validator, 'shoe/extensions/validator'
|
10
6
|
end
|
11
7
|
end
|
@@ -1,24 +1,53 @@
|
|
1
|
+
|
1
2
|
module Shoe
|
2
3
|
module Extensions
|
3
4
|
|
4
5
|
module Validator
|
5
6
|
def self.extended(base)
|
6
|
-
|
7
|
-
|
7
|
+
if RUBY_VERSION < '1.9'
|
8
|
+
require 'test/unit'
|
9
|
+
Test::Unit.run = true
|
10
|
+
base.send :include, Ruby18::InstanceMethods
|
11
|
+
base.send :remove_const, :TestRunner
|
12
|
+
base.send :const_set, :TestRunner, Ruby18::TestRunner
|
13
|
+
else
|
14
|
+
require 'minitest/unit'
|
15
|
+
MiniTest::Unit.class_eval('@@installed_at_exit = true')
|
16
|
+
end
|
8
17
|
end
|
9
18
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
19
|
+
module Ruby18 #:nodoc:
|
20
|
+
module InstanceMethods #:nodoc:
|
21
|
+
def alert_error(*args)
|
22
|
+
# no-op
|
23
|
+
end
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
|
25
|
+
def unit_test(*args)
|
26
|
+
exit(1) unless super.passed?
|
27
|
+
end
|
18
28
|
end
|
19
29
|
|
20
|
-
|
21
|
-
|
30
|
+
module TestRunner #:nodoc:
|
31
|
+
# Conforms the normal TestRunner interface to the slightly different form
|
32
|
+
# called by Gem::Validator.
|
33
|
+
#
|
34
|
+
# Note that we use Test::Unit::AutoRunner (rather than going directly for
|
35
|
+
# Test::Unit::UI::Console::TestRunner) in order to give redgreen a chance
|
36
|
+
# to register itself, should it have been required in one of the
|
37
|
+
# test_files.
|
38
|
+
def self.run(suite, ui)
|
39
|
+
runner = Test::Unit::AutoRunner.new(false)
|
40
|
+
runner.collector = lambda { suite }
|
41
|
+
runner.run.extend(BooleanPassed)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
module BooleanPassed #:nodoc:
|
47
|
+
def passed?
|
48
|
+
self
|
49
|
+
end
|
50
|
+
end
|
22
51
|
end
|
23
52
|
end
|
24
53
|
end
|
data/lib/shoe/tasks.rb
CHANGED
@@ -1,29 +1,20 @@
|
|
1
1
|
module Shoe
|
2
2
|
module Tasks
|
3
|
-
|
4
|
-
autoload :
|
5
|
-
autoload :
|
6
|
-
autoload :
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
autoload :
|
10
|
-
autoload :Release, 'shoe/tasks/release'
|
11
|
-
autoload :Test, 'shoe/tasks/test'
|
12
|
-
|
13
|
-
NAMES = %w(
|
14
|
-
Clean
|
15
|
-
Compile
|
16
|
-
Cucumber
|
17
|
-
Rdoc
|
18
|
-
Ronn
|
19
|
-
Release
|
20
|
-
Test
|
21
|
-
)
|
3
|
+
autoload :Clean, 'shoe/tasks/clean'
|
4
|
+
autoload :Compile, 'shoe/tasks/compile'
|
5
|
+
autoload :Cucumber, 'shoe/tasks/cucumber'
|
6
|
+
autoload :Rdoc, 'shoe/tasks/rdoc'
|
7
|
+
autoload :Ronn, 'shoe/tasks/ronn'
|
8
|
+
autoload :Task, 'shoe/tasks/task'
|
9
|
+
autoload :Test, 'shoe/tasks/test'
|
22
10
|
|
23
11
|
def self.define(spec)
|
24
|
-
|
25
|
-
|
12
|
+
Clean.new(spec)
|
13
|
+
Compile.new(spec)
|
14
|
+
Cucumber.new(spec)
|
15
|
+
Rdoc.new(spec)
|
16
|
+
Ronn.new(spec)
|
17
|
+
Test.new(spec)
|
26
18
|
end
|
27
|
-
|
28
19
|
end
|
29
20
|
end
|
data/lib/shoe/tasks/clean.rb
CHANGED
@@ -6,13 +6,13 @@ module Shoe
|
|
6
6
|
#
|
7
7
|
# Uses something like <tt>`{git
|
8
8
|
# clean}[http://www.kernel.org/pub/software/scm/git/docs/git-clean.html]
|
9
|
-
# -fdX`</tt>, except preserves <tt>.bundle/</tt
|
9
|
+
# -fdX`</tt>, except preserves <tt>.bundle/</tt>.
|
10
10
|
#
|
11
11
|
# To enable, version your project with git[http://git-scm.com].
|
12
12
|
#
|
13
13
|
# To configure, edit your
|
14
14
|
# <tt>{.gitignore}[http://www.kernel.org/pub/software/scm/git/docs/gitignore.html]</tt>.
|
15
|
-
class Clean <
|
15
|
+
class Clean < Task
|
16
16
|
def active?
|
17
17
|
File.directory?('.git')
|
18
18
|
end
|
@@ -21,7 +21,7 @@ module Shoe
|
|
21
21
|
desc <<-END.gsub(/^ */, '')
|
22
22
|
Remove ignored files.
|
23
23
|
Configure via your .gitignore file. Uses something like `git clean -fdX`,
|
24
|
-
except preserves .bundle
|
24
|
+
except preserves .bundle/.
|
25
25
|
END
|
26
26
|
|
27
27
|
task :clean do
|
@@ -36,7 +36,7 @@ module Shoe
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def preserved_files
|
39
|
-
%w( .bundle/
|
39
|
+
%w( .bundle/ )
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|