Class: Pod::Generator::Acknowledgements

Inherits:
Object
  • Object
show all
Defined in:
lib/swordfish/native/acknowledgements.rb

Instance Method Summary collapse

Instance Method Details

#license_text(spec) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/swordfish/native/acknowledgements.rb', line 6

def license_text(spec)
  return nil unless spec.license

  text = spec.license[:text]
  unless text
    if license_file = spec.license[:file]
      license_path = file_accessor(spec).root + license_file
      if File.exist?(license_path)
        text = IO.read(license_path)
      else
        # UI.warn "Unable to read the license file `#{license_file}` " \
        # "for the spec `#{spec}`"
      end
    elsif license_file = file_accessor(spec).license
      text = IO.read(license_file)
    end
  end
  text
end