coldshoulder 0.0.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/bin/coldshoulder CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'coldshoulder'
4
4
 
5
- Coldshoulder::Commander.new(ARGV).generate!
5
+ Coldshoulder::Commander.new({:command => ARGV[0], :language => ARGV[1]}).generate!
@@ -4,23 +4,15 @@ module Coldshoulder
4
4
 
5
5
  attr_accessor :command, :language
6
6
 
7
- def initialize(*args)
8
- self.command = args.shift
9
- self.language = args.shift
10
- generate!
7
+ def initialize(arg_hash)
8
+ self.command = arg_hash[:command]
9
+ self.language = arg_hash[:language]
11
10
  end
12
11
 
13
12
  def generate!
14
- process
13
+ Coldshoulder::Generator.new.build(self.language)
15
14
  end
16
15
 
17
- protected
18
-
19
- def process
20
- if self.command == "generate"
21
- Coldshoulder::Generator.new.build(self.language)
22
- end
23
- end
24
16
  end
25
17
 
26
18
  end
@@ -16,7 +16,7 @@ module Coldshoulder
16
16
  end
17
17
  puts "Ignore file generated for language #{language}"
18
18
  else
19
- puts "The gitignore file could not be generated. Ignore file for the language #{language} not found"
19
+ puts "The gitignore file could not be generated. Language #{language} not found"
20
20
  end
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module Coldshoulder
2
- VERSION = "0.0.7"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -3,18 +3,18 @@ require 'spec_helper'
3
3
  describe Coldshoulder::Commander do
4
4
 
5
5
  it 'takes in a command' do
6
- Coldshoulder::Commander.new("generate", "Python").command.should == "generate"
6
+ Coldshoulder::Commander.new({:command => "generate",:language => "Python"}).command.should == "generate"
7
7
  end
8
8
 
9
9
  it 'takes in a language' do
10
- Coldshoulder::Commander.new("generate", "Ruby").language.should == "Ruby"
10
+ Coldshoulder::Commander.new({:command => "generate",:language => "Ruby"}).language.should == "Ruby"
11
11
  end
12
12
 
13
13
  it 'drives the generation of a gitignore file' do
14
14
  file = mock('file')
15
15
  File.should_receive(:open).with(".gitignore", "w").and_yield(file)
16
16
  file.should_receive(:write)
17
- Coldshoulder::Commander.new("generate",'Ruby')
17
+ Coldshoulder::Commander.new({:command => "generate", :language => "Ruby"}).generate!
18
18
  end
19
19
 
20
20
  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: 0.0.7
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: