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
end
def hash_for_pod(pod)
if (license = pod.license)
if (license = pod.license_text)
{
:Type => "PSGroupSpecifier",
:Title => pod.name,
:FooterText => license[:text]
:FooterText => license
}
else
puts "[!] No licence for #{pod.name}"
puts "[!] No license for #{pod.name}"
end
end
......
......@@ -75,8 +75,14 @@ module Pod
source_files.select { |f| f.extname == '.h' }
end
def license
specification.license
def license_text
if (license_hash = specification.license)
if (result = license_hash[:text])
result
elsif (filename = license_hash[:file])
result = IO.read(root + filename)
end
end
end
def link_headers
......
......@@ -49,12 +49,8 @@ describe Pod::LocalPod do
@pod.header_files.should == [Pathname.new("BananaLib/Classes/Banana.h")]
end
it 'returns a license' do
@pod.license.should == {
:type => "MIT",
:file => "LICENSE",
:text => "Permission is hereby granted ..."
}
it 'returns some license text' do
@pod.license_text.should == "Permission is hereby granted ..."
end
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