shoe 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
2
  require 'shoe'
3
3
 
4
- Shoe.tie('shoe', '0.1.10', 'Another take on hoe, jeweler & friends.') do |spec|
4
+ Shoe.tie('shoe', '0.1.11', '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'
@@ -0,0 +1,44 @@
1
+ Feature: Release
2
+ In order to conveniently make a release of my project
3
+ As a developer
4
+ I want shoe to give me a rake task
5
+
6
+ Background:
7
+ Given I have created a directory called "origin"
8
+ And I have run git init inside "origin"
9
+ Given I have created a directory called "my_project"
10
+ And I have run shoe inside "my_project"
11
+ And I have run git init inside "my_project"
12
+ And I have run git add . inside "my_project"
13
+ And I have run git commit -m "Initial commit" inside "my_project"
14
+ And I have run git remote add origin ../origin inside "my_project"
15
+
16
+ Scenario: I can release
17
+ When I run git push origin master inside "my_project"
18
+ And I replace "0.0.0" with "0.1.0" in the file "my_project/Rakefile"
19
+ And I run rake --tasks inside "my_project"
20
+ Then I should see "rake release" on standard out
21
+
22
+ Scenario: I cannot release when the version is 0.0.0
23
+ When I run git push origin master inside "my_project"
24
+ And I run rake --tasks inside "my_project"
25
+ Then I should not see "rake release" on standard out
26
+
27
+ Scenario: I cannot release when I already have a tag for the current version
28
+ When I run git push origin master inside "my_project"
29
+ And I run git tag 0.1.0 inside "my_project"
30
+ And I replace "0.0.0" with "0.1.0" in the file "my_project/Rakefile"
31
+ And I run rake --tasks inside "my_project"
32
+ Then I should not see "rake release" on standard out
33
+
34
+ Scenario: I cannot release when I have not yet pushed master to origin
35
+ When I replace "0.0.0" with "0.1.0" in the file "my_project/Rakefile"
36
+ And I run rake --tasks inside "my_project"
37
+ Then I should not see "rake release" on standard out
38
+
39
+ Scenario: I cannot release from a branch other than master
40
+ When I run git push origin master inside "my_project"
41
+ And I run git checkout -b topic inside "my_project"
42
+ And I replace "0.0.0" with "0.1.0" in the file "my_project/Rakefile"
43
+ And I run rake --tasks inside "my_project"
44
+ Then I should not see "rake release" on standard out
@@ -10,6 +10,10 @@ Given /^I have created a file called "([^\"]*)" containing:$/ do |path, contents
10
10
  create_file(path, contents)
11
11
  end
12
12
 
13
+ When /^I replace "([^\"]*)" with "([^\"]*)" in the file "([^\"]*)"$/ do |search, replace, path|
14
+ edit_file(path, search, replace)
15
+ end
16
+
13
17
  When /^I (?:have )?run (.*) inside "([^\"]*)"$/ do |command, path|
14
18
  run(command, path)
15
19
  end
@@ -13,12 +13,18 @@ class WorkingDirectory
13
13
  @working_directory = Pathname.new(Dir.mktmpdir)
14
14
  end
15
15
 
16
- def create_directory(name)
17
- working_directory.join(name).mkpath
16
+ def create_directory(path)
17
+ file(path).mkpath
18
18
  end
19
19
 
20
20
  def create_file(path, contents)
21
- working_directory.join(path).open('w') { |file| file.write(contents) }
21
+ file(path).open('w') { |file| file.write(contents) }
22
+ end
23
+
24
+ def edit_file(path, search, replace)
25
+ old_contents = file(path).read
26
+ new_contents = old_contents.gsub(search, replace)
27
+ create_file(path, new_contents)
22
28
  end
23
29
 
24
30
  def file(path)
@@ -100,7 +100,7 @@ class Shoe
100
100
  puts spec.to_ruby
101
101
  end
102
102
 
103
- if the_current_version_is_not_zero && there_is_no_tag_for_the_current_version && we_are_on_the_master_branch && we_have_already_pushed_the_master_branch_to_a_remote_called_origin
103
+ if the_current_version_is_greater_than_zero && there_is_no_tag_for_the_current_version && we_are_on_the_master_branch && we_have_already_pushed_the_master_branch_to_a_remote_called_origin
104
104
  desc "Release #{spec.name}-#{spec.version}"
105
105
  task :release do
106
106
  File.open("#{spec.name}.gemspec", 'w') { |f| f.write spec.to_ruby }
@@ -126,8 +126,8 @@ class Shoe
126
126
  File.directory?('bin') ? Dir.entries('bin') - ['.', '..'] : []
127
127
  end
128
128
 
129
- def the_current_version_is_not_zero
130
- spec.version != '0.0.0'
129
+ def the_current_version_is_greater_than_zero
130
+ spec.version > Gem::Version.new('0.0.0')
131
131
  end
132
132
 
133
133
  def there_are_any_work_in_progress_features
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{shoe}
5
- s.version = "0.1.10"
5
+ s.version = "0.1.11"
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-10-19}
9
+ s.date = %q{2009-10-20}
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", "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.10", "--inline-source"]
14
+ s.files = ["Rakefile", "shoe.gemspec", "README.rdoc", "bin/shoe", "features/cucumber.feature", "features/getting_started.feature", "features/release.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.11", "--inline-source"]
16
16
  s.require_paths = ["lib"]
17
17
  s.requirements = ["git"]
18
18
  s.rubygems_version = %q{1.3.5}
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.10
4
+ version: 0.1.11
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-10-19 00:00:00 +03:00
12
+ date: 2009-10-20 00:00:00 +03:00
13
13
  default_executable: shoe
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ files:
57
57
  - bin/shoe
58
58
  - features/cucumber.feature
59
59
  - features/getting_started.feature
60
+ - features/release.feature
60
61
  - features/step_definitions/shoe_steps.rb
61
62
  - features/support/env.rb
62
63
  - lib/shoe.rb
@@ -69,7 +70,7 @@ rdoc_options:
69
70
  - --main
70
71
  - README.rdoc
71
72
  - --title
72
- - shoe-0.1.10
73
+ - shoe-0.1.11
73
74
  - --inline-source
74
75
  require_paths:
75
76
  - lib