shoe 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -3
- data/Rakefile +2 -1
- data/bin/shoe +16 -29
- data/features/cucumber.feature +17 -0
- data/features/getting_started.feature +26 -0
- data/features/step_definitions/shoe_steps.rb +26 -0
- data/features/support/env.rb +46 -0
- data/lib/shoe.rb +8 -6
- data/shoe.gemspec +8 -5
- metadata +18 -4
data/README.rdoc
CHANGED
@@ -11,14 +11,14 @@ Here's how your Rakefile looks:
|
|
11
11
|
require 'shoe'
|
12
12
|
|
13
13
|
Shoe.tie('myproject', '0.1.0', "This is my project, and it's awesome!") do |spec|
|
14
|
-
spec.add_development_dependency '
|
14
|
+
spec.add_development_dependency 'shoulda'
|
15
15
|
end
|
16
16
|
|
17
17
|
And here's what you get, at most:
|
18
18
|
|
19
19
|
rake clean # Remove ignored files
|
20
|
+
rake cucumber # Run features
|
20
21
|
rake default # Run tests / Run features
|
21
|
-
rake features # Run features
|
22
22
|
rake rdoc # Generate documentation
|
23
23
|
rake release # Release myproject-0.1.0
|
24
24
|
rake shell # Run an irb console
|
@@ -30,7 +30,7 @@ See what I mean by reading Shoe#define_tasks.
|
|
30
30
|
|
31
31
|
== Install
|
32
32
|
|
33
|
-
gem install
|
33
|
+
gem install shoe
|
34
34
|
|
35
35
|
== Getting Started
|
36
36
|
|
data/Rakefile
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
2
|
require 'shoe'
|
3
3
|
|
4
|
-
Shoe.tie('shoe', '0.1.
|
4
|
+
Shoe.tie('shoe', '0.1.9', 'Another take on hoe, jeweler & friends.') do |spec|
|
5
5
|
spec.remove_development_dependency_on_shoe
|
6
6
|
spec.requirements = ['git']
|
7
7
|
spec.add_runtime_dependency 'cucumber'
|
8
|
+
spec.add_runtime_dependency 'gemcutter'
|
8
9
|
spec.add_runtime_dependency 'rake'
|
9
10
|
end
|
data/bin/shoe
CHANGED
@@ -1,43 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
def create_file(name, contents)
|
4
|
+
project_name = File.basename(File.expand_path(Dir.pwd))
|
5
|
+
|
6
|
+
if File.exists?(name)
|
7
|
+
STDERR.puts("#{name} exists. Not clobbering.")
|
8
|
+
else
|
9
|
+
File.open(name, 'w') { |file| file.write(contents.gsub('NAME', project_name)) }
|
10
|
+
end
|
5
11
|
end
|
6
12
|
|
7
|
-
|
8
|
-
|
9
|
-
File.open('Rakefile', 'w') do |file|
|
10
|
-
file.write <<-END_RAKEFILE.gsub('NAME', project_name)
|
11
|
-
this_rakefile_uses_shoe = <<END
|
12
|
-
----------------------------------------
|
13
|
-
Please install Shoe:
|
14
|
-
gem sources --add http://gems.github.com
|
15
|
-
gem install matthewtodd-shoe
|
16
|
-
----------------------------------------
|
17
|
-
END
|
18
|
-
|
13
|
+
# TODO read about heredocs at http://tomayko.com to see if I can clean this up a little.
|
14
|
+
create_file 'Rakefile', <<-END
|
19
15
|
begin
|
20
|
-
gem 'matthewtodd-shoe'
|
21
|
-
rescue Gem::LoadError
|
22
|
-
abort this_rakefile_uses_shoe
|
23
|
-
else
|
24
16
|
require 'shoe'
|
17
|
+
rescue LoadError
|
18
|
+
abort 'Please `gem install shoe` to get started.'
|
25
19
|
end
|
26
20
|
|
27
21
|
Shoe.tie('NAME', '0.1.0', 'TODO write a summary of NAME here.') do |spec|
|
28
|
-
# spec.add_development_dependency '
|
29
|
-
end
|
30
|
-
END_RAKEFILE
|
31
|
-
end
|
32
|
-
|
33
|
-
if File.exists?('README.rdoc')
|
34
|
-
abort 'README.rdoc exists. Not clobbering.'
|
22
|
+
# spec.add_development_dependency 'shoulda'
|
35
23
|
end
|
24
|
+
END
|
36
25
|
|
37
|
-
|
38
|
-
file.write <<-END_README.gsub('NAME', project_name.capitalize)
|
26
|
+
create_file 'README.rdoc', <<-END
|
39
27
|
= NAME
|
40
28
|
|
41
29
|
NAME is one of my favorite things! Let me tell you about it:
|
42
|
-
|
43
|
-
end
|
30
|
+
END
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Feature: Cucumber
|
2
|
+
In order to use cucumber conveniently
|
3
|
+
As a developer
|
4
|
+
I want shoe to give me a rake task
|
5
|
+
|
6
|
+
Scenario: Running rake --tasks in a shoe project without Cucumber features
|
7
|
+
Given I have created a directory called "my_project"
|
8
|
+
And I have run shoe inside "my_project"
|
9
|
+
When I run rake --tasks inside "my_project"
|
10
|
+
Then I should not see "rake cucumber" on standard out
|
11
|
+
|
12
|
+
Scenario: Running rake --tasks in a shoe project with Cucumber features
|
13
|
+
Given I have created a directory called "my_project"
|
14
|
+
Given I have created a directory called "my_project/features"
|
15
|
+
And I have run shoe inside "my_project"
|
16
|
+
When I run rake --tasks inside "my_project"
|
17
|
+
Then I should see "rake cucumber" on standard out
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: Getting started
|
2
|
+
In order to start using shoe
|
3
|
+
As a developer
|
4
|
+
I want a little help generating my Rakefile
|
5
|
+
|
6
|
+
Scenario: Running shoe with no arguments in an empty directory
|
7
|
+
Given I have created a directory called "my_project"
|
8
|
+
When I run shoe inside "my_project"
|
9
|
+
Then I should see a file "my_project/Rakefile"
|
10
|
+
And I should see a file "my_project/README.rdoc"
|
11
|
+
|
12
|
+
Scenario: Running shoe with no arguments in a directory that already has a Rakefile
|
13
|
+
Given I have created a directory called "my_project"
|
14
|
+
And I have created a file called "my_project/Rakefile" containing "# RAKEFILE CONTENTS"
|
15
|
+
When I run shoe inside "my_project"
|
16
|
+
Then I should see "Rakefile exists. Not clobbering." on standard error
|
17
|
+
And the contents of "my_project/Rakefile" should still be "# RAKEFILE CONTENTS"
|
18
|
+
And I should see a file "my_project/README.rdoc"
|
19
|
+
|
20
|
+
Scenario: Running shoe with no arguments in a directory that already has a README.rdoc
|
21
|
+
Given I have created a directory called "my_project"
|
22
|
+
And I have created a file called "my_project/README.rdoc" containing "= README CONTENTS"
|
23
|
+
When I run shoe inside "my_project"
|
24
|
+
Then I should see a file "my_project/Rakefile"
|
25
|
+
Then I should see "README.rdoc exists. Not clobbering." on standard error
|
26
|
+
And the contents of "my_project/README.rdoc" should still be "= README CONTENTS"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Given /^I have created a directory called "([^\"]*)"$/ do |name|
|
2
|
+
create_directory(name)
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /^I have created a file called "([^\"]*)" containing "([^\"]*)"$/ do |path, contents|
|
6
|
+
create_file(path, contents)
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I (?:have )?run (.*) inside "([^\"]*)"$/ do |command, path|
|
10
|
+
run(command, path)
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^I (should.*) see "([^\"]*)" on (standard.*)$/ do |should_or_should_not, message, standard_out_or_error|
|
14
|
+
standard_out_or_error.tr!(' ', '_')
|
15
|
+
should_or_should_not.tr!(' ', '_')
|
16
|
+
|
17
|
+
send(standard_out_or_error).send(should_or_should_not, include(message))
|
18
|
+
end
|
19
|
+
|
20
|
+
Then /^I should see a file "([^\"]*)"$/ do |path|
|
21
|
+
file(path).exist?.should == true
|
22
|
+
end
|
23
|
+
|
24
|
+
Then /^the contents of "([^\"]*)" should still be "([^\"]*)"$/ do |path, expected|
|
25
|
+
file(path).read.should == expected
|
26
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'pathname'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
class WorkingDirectory
|
6
|
+
PROJECT_ROOT = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..', '..')))
|
7
|
+
|
8
|
+
attr_reader :working_directory
|
9
|
+
attr_reader :standard_out
|
10
|
+
attr_reader :standard_error
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@working_directory = Pathname.new(Dir.mktmpdir)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_directory(name)
|
17
|
+
working_directory.join(name).mkpath
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_file(path, contents)
|
21
|
+
working_directory.join(path).open('w') { |file| file.write(contents) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def file(path)
|
25
|
+
working_directory.join(path)
|
26
|
+
end
|
27
|
+
|
28
|
+
def run(command, path)
|
29
|
+
Dir.chdir(working_directory.join(path)) do
|
30
|
+
Open3.popen3(rejigger_the_path(command)) do |stdin, stdout, stderr|
|
31
|
+
@standard_out = stdout.read
|
32
|
+
@standard_error = stderr.read
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def rejigger_the_path(command)
|
40
|
+
"/usr/bin/env PATH='#{PROJECT_ROOT.join('bin')}:#{ENV['PATH']}' RUBYLIB='#{PROJECT_ROOT.join('lib')}' #{command}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
World { WorkingDirectory.new }
|
45
|
+
Before { working_directory.mkpath }
|
46
|
+
After { working_directory.rmtree }
|
data/lib/shoe.rb
CHANGED
@@ -6,7 +6,7 @@ require 'rubygems/doc_manager'
|
|
6
6
|
#
|
7
7
|
# require 'shoe'
|
8
8
|
# Shoe.tie('myproject', '0.1.0', "This is my project, and it's awesome!") do |spec|
|
9
|
-
# spec.add_development_dependency '
|
9
|
+
# spec.add_development_dependency 'shoulda'
|
10
10
|
# end
|
11
11
|
#
|
12
12
|
# Shoe comes with an executable named "shoe" that will generate a Rakefile like this (but slightly fancier) for you.
|
@@ -31,15 +31,15 @@ class Shoe
|
|
31
31
|
spec.files = FileList['Rakefile', '*.gemspec', '**/*.rdoc', 'bin/**/*', 'examples/**/*', 'features/**/*', 'lib/**/*', 'resources/**/*', 'shoulda_macros/**/*', 'test/**/*'].to_a
|
32
32
|
spec.executables = everything_in_the_bin_directory
|
33
33
|
spec.rdoc_options = %W(--main README.rdoc --title #{name}-#{version} --inline-source) # MAYBE include --all, so that we document private methods?
|
34
|
-
spec.extra_rdoc_files = FileList['
|
34
|
+
spec.extra_rdoc_files = FileList['**/*.rdoc', 'shoulda_macros/**/*'].to_a
|
35
35
|
spec.has_rdoc = true
|
36
36
|
spec.author = `git config --get user.name`.chomp
|
37
37
|
spec.email = `git config --get user.email`.chomp
|
38
|
-
spec.add_development_dependency '
|
38
|
+
spec.add_development_dependency 'shoe'
|
39
39
|
end
|
40
40
|
|
41
41
|
def @spec.remove_development_dependency_on_shoe
|
42
|
-
dependencies.delete_if { |d| d.name == '
|
42
|
+
dependencies.delete_if { |d| d.name == 'shoe' }
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -85,8 +85,8 @@ class Shoe
|
|
85
85
|
|
86
86
|
if File.directory?('features')
|
87
87
|
require 'cucumber/rake/task'
|
88
|
-
Cucumber::Rake::Task.new(
|
89
|
-
default_depends_on(:
|
88
|
+
Cucumber::Rake::Task.new(:cucumber, 'Run features')
|
89
|
+
default_depends_on(:cucumber)
|
90
90
|
end
|
91
91
|
|
92
92
|
desc 'Show latest gemspec contents'
|
@@ -103,6 +103,8 @@ class Shoe
|
|
103
103
|
sh "git tag #{spec.version}"
|
104
104
|
sh 'git push'
|
105
105
|
sh 'git push --tags'
|
106
|
+
sh "gem build #{spec.name}.gemspec"
|
107
|
+
sh "gem push #{spec.file_name}"
|
106
108
|
end
|
107
109
|
end
|
108
110
|
end
|
data/shoe.gemspec
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{shoe}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Matthew Todd"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-10-16}
|
10
10
|
s.default_executable = %q{shoe}
|
11
11
|
s.email = %q{matthew.todd@gmail.com}
|
12
12
|
s.executables = ["shoe"]
|
13
13
|
s.extra_rdoc_files = ["README.rdoc"]
|
14
|
-
s.files = ["Rakefile", "shoe.gemspec", "README.rdoc", "bin/shoe", "lib/shoe.rb"]
|
15
|
-
s.rdoc_options = ["--main", "README.rdoc", "--title", "shoe-0.1.
|
14
|
+
s.files = ["Rakefile", "shoe.gemspec", "README.rdoc", "bin/shoe", "features/cucumber.feature", "features/getting_started.feature", "features/step_definitions", "features/step_definitions/shoe_steps.rb", "features/support", "features/support/env.rb", "lib/shoe.rb"]
|
15
|
+
s.rdoc_options = ["--main", "README.rdoc", "--title", "shoe-0.1.9", "--inline-source"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.requirements = ["git"]
|
18
18
|
s.rubygems_version = %q{1.3.5}
|
19
|
-
s.summary = %q{
|
19
|
+
s.summary = %q{Another take on hoe, jeweler & friends.}
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
@@ -24,13 +24,16 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
26
|
s.add_runtime_dependency(%q<cucumber>, [">= 0"])
|
27
|
+
s.add_runtime_dependency(%q<gemcutter>, [">= 0"])
|
27
28
|
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
28
29
|
else
|
29
30
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
31
|
+
s.add_dependency(%q<gemcutter>, [">= 0"])
|
30
32
|
s.add_dependency(%q<rake>, [">= 0"])
|
31
33
|
end
|
32
34
|
else
|
33
35
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
36
|
+
s.add_dependency(%q<gemcutter>, [">= 0"])
|
34
37
|
s.add_dependency(%q<rake>, [">= 0"])
|
35
38
|
end
|
36
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Todd
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-16 00:00:00 +03:00
|
13
13
|
default_executable: shoe
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,16 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: gemcutter
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: rake
|
27
37
|
type: :runtime
|
@@ -45,6 +55,10 @@ files:
|
|
45
55
|
- shoe.gemspec
|
46
56
|
- README.rdoc
|
47
57
|
- bin/shoe
|
58
|
+
- features/cucumber.feature
|
59
|
+
- features/getting_started.feature
|
60
|
+
- features/step_definitions/shoe_steps.rb
|
61
|
+
- features/support/env.rb
|
48
62
|
- lib/shoe.rb
|
49
63
|
has_rdoc: true
|
50
64
|
homepage:
|
@@ -55,7 +69,7 @@ rdoc_options:
|
|
55
69
|
- --main
|
56
70
|
- README.rdoc
|
57
71
|
- --title
|
58
|
-
- shoe-0.1.
|
72
|
+
- shoe-0.1.9
|
59
73
|
- --inline-source
|
60
74
|
require_paths:
|
61
75
|
- lib
|
@@ -77,6 +91,6 @@ rubyforge_project:
|
|
77
91
|
rubygems_version: 1.3.5
|
78
92
|
signing_key:
|
79
93
|
specification_version: 3
|
80
|
-
summary:
|
94
|
+
summary: Another take on hoe, jeweler & friends.
|
81
95
|
test_files: []
|
82
96
|
|