Commit 908327e6 authored by Will Pragnell's avatar Will Pragnell

Changed Local_pod license method to license_text and added fallback to file if no text specified

parent 6ec5ea89
...@@ -31,14 +31,14 @@ module Pod ...@@ -31,14 +31,14 @@ module Pod
end end
def hash_for_pod(pod) def hash_for_pod(pod)
if (license = pod.license) if (license = pod.license_text)
{ {
:Type => "PSGroupSpecifier", :Type => "PSGroupSpecifier",
:Title => pod.name, :Title => pod.name,
:FooterText => license[:text] :FooterText => license
} }
else else
puts "[!] No licence for #{pod.name}" puts "[!] No license for #{pod.name}"
end end
end end
......
...@@ -75,8 +75,14 @@ module Pod ...@@ -75,8 +75,14 @@ module Pod
source_files.select { |f| f.extname == '.h' } source_files.select { |f| f.extname == '.h' }
end end
def license def license_text
specification.license if (license_hash = specification.license)
if (result = license_hash[:text])
result
elsif (filename = license_hash[:file])
result = IO.read(root + filename)
end
end
end end
def link_headers def link_headers
......
...@@ -49,12 +49,8 @@ describe Pod::LocalPod do ...@@ -49,12 +49,8 @@ describe Pod::LocalPod do
@pod.header_files.should == [Pathname.new("BananaLib/Classes/Banana.h")] @pod.header_files.should == [Pathname.new("BananaLib/Classes/Banana.h")]
end end
it 'returns a license' do it 'returns some license text' do
@pod.license.should == { @pod.license_text.should == "Permission is hereby granted ..."
:type => "MIT",
:file => "LICENSE",
:text => "Permission is hereby granted ..."
}
end end
it 'can clean up after itself' do it 'can clean up after itself' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment