licit 0.2 → 0.2.1
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/lib/licit/command.rb +6 -1
- data/lib/licit/licenser.rb +1 -1
- data/lib/licit/version.rb +1 -1
- data/spec/command_spec.rb +1 -1
- data/spec/licenser_spec.rb +4 -4
- metadata +3 -3
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
|
-
|
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
|
data/lib/licit/licenser.rb
CHANGED
data/lib/licit/version.rb
CHANGED
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
|
8
|
+
subject.load_config.should == {:copyright => 'Copyright Line', :program_name => 'My App'}
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/spec/licenser_spec.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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:
|
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: &
|
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: *
|
24
|
+
version_requirements: *70203488830540
|
25
25
|
description: Apply public licenses to files in ruby projects
|
26
26
|
email:
|
27
27
|
- jwajnerman@manas.com.ar
|