lib/spandx/spdx/license.rb in spandx-0.11.0 vs lib/spandx/spdx/license.rb in spandx-0.12.0
- old
+ new
@@ -63,19 +63,29 @@
def content
@content ||= ::Spandx::Core::Content.new(raw_content)
end
- def raw_content
- @raw_content ||= (Spandx.spdx_db.read("text/#{id}.txt") || '')
+ def content=(value)
+ @content = ::Spandx::Core::Content.new(value)
end
def <=>(other)
id <=> other.id
end
def to_s
id
+ end
+
+ def self.unknown(text)
+ new(licenseId: 'Nonstandard', name: 'Unknown').tap { |x| x.content = text }
+ end
+
+ private
+
+ def raw_content
+ @raw_content ||= (Spandx.git[:spdx].read("text/#{id}.txt") || '')
end
end
end
end