patchy 1.0.0b3 → 1.0.0b4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +1 -1
  2. data/bin/patchy +10 -9
  3. data/lib/patchy/version.rb +1 -1
  4. metadata +4 -4
data/README.md CHANGED
@@ -50,7 +50,7 @@ commit message. Patchy shows you which commands it runs and asks you to approve
50
50
  the output of certain critical commands before moving on.
51
51
 
52
52
  I encourage you to take a look at the source code (in `bin/patchy`). It's only
53
- 61 lines "long" and helps you understand what exactly Patchy does for you.
53
+ 62 lines "long" and helps you understand what exactly Patchy does for you.
54
54
 
55
55
  ## Copyright
56
56
 
data/bin/patchy CHANGED
@@ -2,20 +2,19 @@
2
2
 
3
3
  def run(command)
4
4
  headline = "Running: #{command}"
5
+ puts
5
6
  puts headline
6
7
  puts '=' * headline.length
7
8
  `#{command}`
8
- puts
9
9
  end
10
10
 
11
11
  def run_and_approve(command)
12
- run(command)
13
- print('Approve? (Y/n) ')
12
+ puts run(command)
13
+ puts('Approve? (Y/n) ')
14
14
  input = gets
15
15
  if input != $/ && input.chomp.downcase != 'y'
16
16
  exit
17
17
  end
18
- puts
19
18
  end
20
19
 
21
20
  def current_branch
@@ -32,12 +31,14 @@ if ARGV[0] =~ /^\d+$/
32
31
  unless base_branch == current_branch
33
32
  run("git checkout #{base_branch}")
34
33
  end
35
- run("git pull")
34
+ puts run("git pull")
36
35
  run("git checkout -b #{ticket}")
37
36
  if base_branch == 'master'
38
- run("bin/rails new railties/tmp/ticket_#{ticket} --dev")
39
- File.open("railties/tmp/ticket_#{ticket}/Gemfile", 'r+') do |f|
40
- f.write(f.read.sub(/gem 'rails', :path => '(.+)'/, "gem 'rails', :git => '\\1', :branch => '#{ticket}'"))
37
+ puts run("bin/rails new railties/tmp/ticket_#{ticket} --dev")
38
+ gemfile = "railties/tmp/ticket_#{ticket}/Gemfile"
39
+ gemfile_data = File.read(gemfile)
40
+ File.open(gemfile, 'w') do |f|
41
+ f.write(gemfile_data.sub(/gem 'rails', :path => '(.+)'/, "gem 'rails', :git => '\\1', :branch => '#{ticket}'"))
41
42
  end
42
43
  end
43
44
  else
@@ -46,7 +47,7 @@ else
46
47
 
47
48
  ARGV.clear
48
49
 
49
- run("git commit -m \"#{message} [##{ticket} state:committed]\"")
50
+ puts run("git commit -m \"#{message} [##{ticket} state:committed]\"")
50
51
  run("git checkout #{base_branch}")
51
52
  run_and_approve("git pull")
52
53
  run("git checkout #{ticket}")
@@ -1,3 +1,3 @@
1
1
  module Patchy
2
- VERSION = '1.0.0b3'
2
+ VERSION = '1.0.0b4'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patchy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 415574163
4
+ hash: 415574160
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0b3
10
- version: 1.0.0b3
9
+ - 0b4
10
+ version: 1.0.0b4
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Trasbo
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-30 00:00:00 +02:00
18
+ date: 2010-07-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21