licit 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/licit/command.rb CHANGED
@@ -30,7 +30,12 @@ class Licit::Command
30
30
  puts "Could not find licit.yml config file"
31
31
  exit 1
32
32
  end
33
- YAML.load_file(config_file).each_with_object({}) { |(k,v), h| h[k.to_sym] = v }
33
+
34
+ config = {}
35
+ YAML.load_file(config_file).each do |key, value|
36
+ config[key.to_sym] = value
37
+ end
38
+ config
34
39
  end
35
40
 
36
41
  def find_file probes
@@ -3,7 +3,7 @@ require 'erb'
3
3
  class Licit::Licenser
4
4
 
5
5
  def initialize(options = {})
6
- defaults = { dir: '.', license: 'GPLv3', exclude: [] }
6
+ defaults = { :dir => '.', :license => 'GPLv3', :exclude => [] }
7
7
  @options = defaults.merge options
8
8
  end
9
9
 
data/lib/licit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Licit
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  end
data/spec/command_spec.rb CHANGED
@@ -5,7 +5,7 @@ describe Licit::Command do
5
5
 
6
6
  it "load config file" do
7
7
  Dir.chdir(File.expand_path '../dir3', __FILE__) do
8
- subject.load_config.should == {copyright: 'Copyright Line', program_name: 'My App'}
8
+ subject.load_config.should == {:copyright => 'Copyright Line', :program_name => 'My App'}
9
9
  end
10
10
  end
11
11
 
@@ -17,7 +17,7 @@ describe Licit::Licenser do
17
17
  end
18
18
 
19
19
  it "composes header" do
20
- licenser = Licit::Licenser.new copyright: 'Copyright Line', program_name: 'FooBar'
20
+ licenser = Licit::Licenser.new :copyright => 'Copyright Line', :program_name => 'FooBar'
21
21
  licenser.copyright.should == 'Copyright Line'
22
22
  licenser.program_name.should == 'FooBar'
23
23
  licenser.header.should == <<-END
@@ -45,7 +45,7 @@ END
45
45
  end
46
46
 
47
47
  context "dir1" do
48
- let(:licenser) { Licit::Licenser.new dir: File.expand_path('../dir1', __FILE__) }
48
+ let(:licenser) { Licit::Licenser.new :dir => File.expand_path('../dir1', __FILE__) }
49
49
  after(:each) { FileUtils.rm_f Dir.glob(File.join(File.expand_path('../dir1', __FILE__), '*')) }
50
50
 
51
51
  it "checks missing files" do
@@ -59,7 +59,7 @@ END
59
59
  end
60
60
 
61
61
  context "dir2" do
62
- let(:licenser) { Licit::Licenser.new dir: File.expand_path('../dir2.tmp', __FILE__), copyright: 'Copyright Line', program_name: 'FooBar' }
62
+ let(:licenser) { Licit::Licenser.new :dir => File.expand_path('../dir2.tmp', __FILE__), :copyright => 'Copyright Line', :program_name => 'FooBar' }
63
63
  before(:each) { FileUtils.cp_r File.expand_path('../dir2', __FILE__), File.expand_path('../dir2.tmp', __FILE__)}
64
64
  after(:each) { FileUtils.rm_rf File.expand_path('../dir2.tmp', __FILE__) }
65
65
 
@@ -68,7 +68,7 @@ END
68
68
  end
69
69
 
70
70
  it "check headers excluding directory" do
71
- licenser = Licit::Licenser.new dir: File.expand_path('../dir2.tmp', __FILE__), copyright: 'Copyright Line', program_name: 'FooBar', exclude: ['subdir/']
71
+ licenser = Licit::Licenser.new :dir => File.expand_path('../dir2.tmp', __FILE__), :copyright => 'Copyright Line', :program_name => 'FooBar', :exclude => ['subdir/']
72
72
  licenser.check_headers.should =~ [[:error, 'test.rb', 'Missing header in test.rb']]
73
73
  end
74
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licit
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70251677218640 !ruby/object:Gem::Requirement
16
+ requirement: &70203488830540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70251677218640
24
+ version_requirements: *70203488830540
25
25
  description: Apply public licenses to files in ruby projects
26
26
  email:
27
27
  - jwajnerman@manas.com.ar