propel 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- propel (0.0.4)
4
+ propel (0.1.0)
5
5
  json
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -24,3 +24,8 @@ passing as of the latest commit for Jenkins, Team City and CI Joe.
24
24
 
25
25
  Once you figure out the options that work for you, just put a .propel file in the root of your project.
26
26
  Command line parameters override the options found in the configuration file.
27
+
28
+ ## Credits
29
+
30
+ Thanks to Jose Carrion (http://joselo.github.com/) for pair programming with me for several hours during the
31
+ development of Propel.
@@ -4,8 +4,15 @@ module Propel
4
4
  @command_line_options = command_line_arguments
5
5
  end
6
6
 
7
+ DEFAULTS = {
8
+ :force => false,
9
+ :rebase => true,
10
+ :verbose => false,
11
+ :wait => false
12
+ }
13
+
7
14
  def options
8
- parse(options_from_config_file).merge(parse @command_line_options)
15
+ DEFAULTS.merge(parse(options_from_config_file).merge(parse @command_line_options))
9
16
  end
10
17
 
11
18
  private
@@ -17,28 +17,23 @@ module Propel
17
17
  ::OptionParser.new do |parser|
18
18
  parser.banner = "Usage: propel [options]\n\n"
19
19
 
20
- options[:force] = false
21
- options[:rebase] = true
22
- options[:verbose] = false
23
- options[:wait] = false
24
-
25
20
  parser.on('-s', '--status-url STATUS_URL', 'Location of build status feed') do |build_status_url|
26
21
  options[:status_url] = build_status_url
27
22
  end
28
23
 
29
- parser.on('-f', '--[no-]force', 'Use propel --force to ignore any remote build failures') do |o|
24
+ parser.on('-f', '--[no-]force', 'Ignores any remote build failures') do |o|
30
25
  options[:force] = o
31
26
  end
32
27
 
33
- parser.on('-r', '--[no-]rebase', 'Use propel --no-rebase. Defaults to --rebase') do |o|
28
+ parser.on('-r', '--[no-]rebase', 'Determines whether or not pull uses rebase. Propel uses rebase by default.') do |o|
34
29
  options[:rebase] = o
35
30
  end
36
31
 
37
- parser.on('-w', '--[no-]wait', 'Wait for the remote build to pass if it is currently failing. Use propel --wait.') do |o|
32
+ parser.on('-w', '--[no-]wait', 'Waits for fixes to remote build') do |o|
38
33
  options[:wait] = o
39
34
  end
40
35
 
41
- parser.on('-v', '--verbose', 'Use propel --verbose.') do |o|
36
+ parser.on('-v', '--verbose', 'Shows extra information') do |o|
42
37
  options[:verbose] = o
43
38
  end
44
39
  end
@@ -10,9 +10,9 @@ module Propel
10
10
  end
11
11
 
12
12
  FAIL_PATTERNS = {
13
- :jenkins => /\(broken/,
14
- :team_city => /(?:has failed)$/,
15
- :ci_joe => /^failed$/
13
+ :jenkins => /\(broken/,
14
+ :team_city => /(?:has failed)$/,
15
+ :ci_joe => /^failed$/
16
16
  }
17
17
 
18
18
  def passing?
@@ -1,3 +1,3 @@
1
1
  module Propel
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
data/propel.gemspec CHANGED
@@ -6,16 +6,15 @@ Gem::Specification.new do |s|
6
6
  s.name = "propel"
7
7
  s.version = Propel::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.authors = ["Justin Leitgeb", "Jose Carrion"]
10
- s.email = ["justin@stackbuilders.com", "jcarrion@stackbuilders.com"]
9
+ s.authors = ["Justin Leitgeb"]
10
+ s.email = ["justin@stackbuilders.com"]
11
11
  s.homepage = "http://github.com/stackbuilders/propel"
12
12
  s.summary = "Propel helps you to follow best practices for pushing code to a remote git repo"
13
13
  s.description = <<-EOS
14
- The 'propel' script helps you to push your code to a remote server while following best practices,
15
- especially in regard to Continuous Integration (CI). Propel first checks the CI server to make sure
16
- it's passing, and then runs the local spec suite and pushes changes. If the remote server is failing,
17
- you can tell propel to wait until it passes, and then proceed to run your build and push if the local
18
- build passes.
14
+ The 'propel' script helps you to push your code to a remote server while following Continuous Integration (CI)
15
+ best practices. Propel first checks the CI server to make sure it's passing, and then runs the local spec
16
+ suite and pushes changes. If the remote server is failing, just have propel wait for it to pass while you get
17
+ a coffee.
19
18
  EOS
20
19
 
21
20
  s.files = `git ls-files`.split("\n")
@@ -8,5 +8,19 @@ describe Propel::Configuration do
8
8
 
9
9
  configuration.options[:rebase].should be_true
10
10
  end
11
+
12
+ it "should not overwrite options from config file with defaults" do
13
+ configuration = Propel::Configuration.new([])
14
+ configuration.stub!(:options_from_config_file).and_return(['--wait'])
15
+
16
+ configuration.options[:wait].should be_true
17
+ end
18
+
19
+ it "should set default options" do
20
+ configuration = Propel::Configuration.new([])
21
+ configuration.stub!(:options_from_config_file).and_return([])
22
+
23
+ configuration.options.should == { :rebase => true, :force => false, :verbose => false, :wait => false}
24
+ end
11
25
  end
12
26
  end
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Propel::OptionParser do
4
4
  describe ".parse!" do
5
- it "should set default options" do
6
- Propel::OptionParser.parse!.should == {:rebase => true, :force => false, :verbose => false, :wait => false}
7
- end
8
-
9
5
  it "should set force to true when given as an option" do
10
6
  Propel::OptionParser.parse!(['--force'])[:force].should be_true
11
7
  end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 4
10
- version: 0.0.4
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Leitgeb
14
- - Jose Carrion
15
14
  autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
@@ -49,10 +48,9 @@ dependencies:
49
48
  version: 2.5.0
50
49
  type: :development
51
50
  version_requirements: *id002
52
- description: " The 'propel' script helps you to push your code to a remote server while following best practices,\n especially in regard to Continuous Integration (CI). Propel first checks the CI server to make sure\n it's passing, and then runs the local spec suite and pushes changes. If the remote server is failing,\n you can tell propel to wait until it passes, and then proceed to run your build and push if the local\n build passes.\n"
51
+ description: " The 'propel' script helps you to push your code to a remote server while following Continuous Integration (CI)\n best practices. Propel first checks the CI server to make sure it's passing, and then runs the local spec\n suite and pushes changes. If the remote server is failing, just have propel wait for it to pass while you get\n a coffee.\n"
53
52
  email:
54
53
  - justin@stackbuilders.com
55
- - jcarrion@stackbuilders.com
56
54
  executables:
57
55
  - propel
58
56
  extensions: []