coldshoulder 1.1.3 → 1.1.4

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/bin/coldshoulder CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'coldshoulder'
4
4
 
5
- Coldshoulder::Commander.new({:command => ARGV[0], :language => ARGV[1]})
5
+ Coldshoulder::Commander.new({:command => ARGV[0], :language => ARGV[1], :optional => ARGV[2]})
@@ -2,41 +2,37 @@ module Coldshoulder
2
2
 
3
3
  class Commander
4
4
 
5
- attr_accessor :command, :language
5
+ attr_accessor :command, :language, :optional
6
6
 
7
7
  def initialize(arg_hash)
8
8
  self.language = arg_hash[:language]
9
9
  self.command = arg_hash[:command]
10
- if self.command == "generate"
11
- generate!
12
- else
13
- parse!([self.command])
14
- end
10
+ self.optional = arg_hash[:optional]
11
+ parse!([self.command, self.optional])
15
12
  end
16
13
 
17
14
  def parse!(commands)
18
15
  options = {}
19
16
  if self.command == "generate"
20
17
  generate!
21
- else
22
- begin
23
- opts = OptionParser.new do |opts|
24
- opts.banner = "Usage: coldshoulder [options] [template name]"
25
- opts.separator ""
26
- opts.separator "Commands: "
27
-
28
- opts.on_tail("-v", "--version", "Display the version") do
29
- puts "Current version: #{Coldshoulder::VERSION}"
30
- end
31
-
32
- opts.on_tail("-h", "--help", "Displays this message") do
33
- puts opts
34
- end
18
+ end
19
+ begin
20
+ opts = OptionParser.new do |opts|
21
+ opts.banner = "Usage: coldshoulder [options] [template name]"
22
+ opts.separator ""
23
+ opts.separator "Commands: "
24
+
25
+ opts.on_tail("-v", "--version", "Display the version") do
26
+ puts "Current version: #{Coldshoulder::VERSION}"
27
+ end
28
+
29
+ opts.on_tail("-h", "--help", "Displays this message") do
30
+ puts opts
35
31
  end
36
- opts.parse!(commands)
37
- rescue OptionParser::ParseError => e
38
- puts "Error: #{e.message}"
39
32
  end
33
+ opts.parse!(commands)
34
+ rescue OptionParser::ParseError => e
35
+ puts "Error: #{e.message}"
40
36
  end
41
37
  end
42
38
 
@@ -1,3 +1,3 @@
1
1
  module Coldshoulder
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -17,10 +17,9 @@ describe Coldshoulder::Commander do
17
17
  Coldshoulder::Commander.new({:command => "generate", :language => "Ruby"})
18
18
  end
19
19
 
20
- it 'it will not generate a gitingore file if generate is not specified' do
20
+ it 'will not generate a gitingore file if generate is not specified' do
21
21
  Coldshoulder::Generator.should_not_receive(:build)
22
22
  Coldshoulder::Commander.new({:command => "-v", :language => "Ruby"})
23
23
  end
24
24
 
25
-
26
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coldshoulder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: