propel 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -3
- data/lib/propel/configuration.rb +11 -7
- data/lib/propel/option_parser.rb +9 -9
- data/lib/propel/version.rb +1 -1
- data/spec/propel/configuration_spec.rb +8 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/propel/configuration.rb
CHANGED
@@ -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
|
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[:
|
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
|
34
|
-
|
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
|
data/lib/propel/option_parser.rb
CHANGED
@@ -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('-
|
21
|
-
options[:
|
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('-
|
33
|
-
options[:
|
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
|
data/lib/propel/version.rb
CHANGED
@@ -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:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Leitgeb
|