propel 0.3.1 → 0.3.2

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/Gemfile.lock CHANGED
@@ -1,14 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- propel (0.3.0)
5
- colored
4
+ propel (0.3.2)
6
5
  json
7
6
 
8
7
  GEM
9
8
  remote: http://rubygems.org/
10
9
  specs:
11
- colored (1.2)
12
10
  diff-lcs (1.1.2)
13
11
  json (1.5.1)
14
12
  rspec (2.5.0)
@@ -3,7 +3,7 @@ module Propel
3
3
 
4
4
  def initialize(command_line_arguments, repository)
5
5
  @command_line_options = command_line_arguments
6
- @repository = repository
6
+ @repository = repository
7
7
  end
8
8
 
9
9
  DEFAULTS = {
@@ -19,22 +19,26 @@ module Propel
19
19
  correct_color_setting!(opts)
20
20
  end
21
21
 
22
+ def config_file
23
+ File.join(@repository.project_root, ".propel")
24
+ end
25
+
26
+ private
22
27
  def correct_color_setting!(opts)
23
- if opts[:color_enabled] && RUBY_PLATFORM =~ /mswin|mingw/
28
+ if opts[:color] && ruby_platform =~ /mswin|mingw/
24
29
  unless ENV['ANSICON']
25
30
  warn "You must use ANSICON 1.31 or later (http://adoxa.110mb.com/ansicon/) to use colour on Windows"
26
31
  opts[:color] = false
27
32
  end
28
33
  end
29
-
34
+
30
35
  opts
31
36
  end
32
37
 
33
- def config_file
34
- File.join(@repository.project_root, ".propel")
38
+ def ruby_platform
39
+ RUBY_PLATFORM
35
40
  end
36
-
37
- private
41
+
38
42
  def options_from_config_file
39
43
  File.exist?(config_file) ? File.read(config_file).split : [ ]
40
44
  end
@@ -16,30 +16,30 @@ module Propel
16
16
  def parser(options)
17
17
  ::OptionParser.new do |parser|
18
18
  parser.banner = "Usage: propel [options]\n\n"
19
-
20
- parser.on('-s', '--status-url STATUS_URL', 'Location of build status feed') do |build_status_url|
21
- options[:status_url] = build_status_url
19
+
20
+ parser.on('-c', '--[no-]color', '--[no-]colour', 'Turn on or off colored output. Color is off by default.') do |o|
21
+ options[:color] = o
22
22
  end
23
23
 
24
24
  parser.on('-f', '--fix-ci', 'Use when fixing the CI build') do |o|
25
25
  options[:fix_ci] = o
26
26
  end
27
27
 
28
+ parser.on('-q', '--[no-]quiet', 'Silences normal output messages.') do |o|
29
+ options[:quiet] = o
30
+ end
31
+
28
32
  parser.on('-r', '--[no-]rebase', 'Use pull with --rebase. Rebase is used by default.') do |o|
29
33
  options[:rebase] = o
30
34
  end
31
35
 
32
- parser.on('-c', '--[no-]color', '--[no-]colour', 'Turn on or off colored output. Color is off by default.') do |o|
33
- options[:color] = o
36
+ parser.on('-s', '--status-url STATUS_URL', 'Location of build status feed') do |build_status_url|
37
+ options[:status_url] = build_status_url
34
38
  end
35
39
 
36
40
  parser.on('-w', '--[no-]wait', 'Waits for fixes to remote build.') do |o|
37
41
  options[:wait] = o
38
42
  end
39
-
40
- parser.on('-q', '--[no-]quiet', 'Silences normal output messages.') do |o|
41
- options[:quiet] = o
42
- end
43
43
  end
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module Propel
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -21,7 +21,14 @@ describe Propel::Configuration do
21
21
  configuration.stub!(:options_from_config_file).and_return([])
22
22
 
23
23
  configuration.options.should == { :rebase => true, :fix_ci => false, :verbose => false, :wait => false, :color => false }
24
- end
24
+ end
25
+
26
+ it "should correct the color setting if on a Windows 32 system that does not support color" do
27
+ configuration = Propel::Configuration.new(['--color', '--quiet'], Propel::GitRepository.new)
28
+ configuration.stub(:ruby_platform).and_return('mswin')
29
+ configuration.stub!(:warn)
30
+ configuration.options[:color].should be_false
31
+ end
25
32
  end
26
33
 
27
34
  describe "#config_file" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Leitgeb