aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorDavid Yun2016-10-06 21:27:44 +0800
committerDavid Yun2016-10-06 23:25:42 +0800
commit5fead8eb5ec9613799f51774f90050b475e5e166 (patch)
tree011d5c62d26809f300cd852b95bcab883776a93e /Library/Homebrew/cask/lib
parentfaebc6481585bf352572c36ccec5e68a6fb037eb (diff)
downloadbrew-5fead8eb5ec9613799f51774f90050b475e5e166.tar.bz2
Deprecate license stanza
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/audit.rb1
-rw-r--r--Library/Homebrew/cask/lib/hbc/cask.rb1
-rw-r--r--Library/Homebrew/cask/lib/hbc/dsl.rb12
-rw-r--r--Library/Homebrew/cask/lib/hbc/dsl/license.rb70
4 files changed, 0 insertions, 84 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/audit.rb b/Library/Homebrew/cask/lib/hbc/audit.rb
index 476f2aec0..533ede70d 100644
--- a/Library/Homebrew/cask/lib/hbc/audit.rb
+++ b/Library/Homebrew/cask/lib/hbc/audit.rb
@@ -50,7 +50,6 @@ module Hbc
%i{version sha256 url homepage}.each do |sym|
add_error "a #{sym} stanza is required" unless cask.send(sym)
end
- add_error "a license stanza is required (:unknown is OK)" unless cask.license
add_error "at least one name stanza is required" if cask.name.empty?
# TODO: specific DSL knowledge should not be spread around in various files like this
# TODO: nested_container should not still be a pseudo-artifact at this point
diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb
index 1e2056efc..b66f16a8e 100644
--- a/Library/Homebrew/cask/lib/hbc/cask.rb
+++ b/Library/Homebrew/cask/lib/hbc/cask.rb
@@ -102,7 +102,6 @@ module Hbc
:url,
:appcast,
:version,
- :license,
:sha256,
:artifacts,
:caveats,
diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb
index 8e0a7715a..f074830cb 100644
--- a/Library/Homebrew/cask/lib/hbc/dsl.rb
+++ b/Library/Homebrew/cask/lib/hbc/dsl.rb
@@ -9,7 +9,6 @@ require "hbc/dsl/container"
require "hbc/dsl/depends_on"
require "hbc/dsl/gpg"
require "hbc/dsl/installer"
-require "hbc/dsl/license"
require "hbc/dsl/postflight"
require "hbc/dsl/preflight"
require "hbc/dsl/stanza_proxy"
@@ -66,7 +65,6 @@ module Hbc
:gpg,
:homepage,
:language,
- :license,
:name,
:sha256,
:staged_path,
@@ -206,16 +204,6 @@ module Hbc
@sha256 ||= arg
end
- def license(arg = nil)
- return @license if arg.nil?
- assert_only_one_stanza_allowed :license, !arg.nil?
- @license ||= begin
- DSL::License.new(arg) unless arg.nil?
- rescue StandardError => e
- raise CaskInvalidError.new(token, e)
- end
- end
-
# depends_on uses a load method so that multiple stanzas can be merged
def depends_on(*args)
return @depends_on if args.empty?
diff --git a/Library/Homebrew/cask/lib/hbc/dsl/license.rb b/Library/Homebrew/cask/lib/hbc/dsl/license.rb
deleted file mode 100644
index affbc08f5..000000000
--- a/Library/Homebrew/cask/lib/hbc/dsl/license.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-module Hbc
- class DSL
- class License
- # a generic category can always be given as a license, so
- # category names should be given as both key and value
- VALID_LICENSES = {
- # license category
- unknown: :unknown,
-
- other: :other,
-
- closed: :closed,
- commercial: :closed,
- gratis: :closed,
- freemium: :closed,
-
- oss: :oss,
- affero: :oss,
- apache: :oss,
- arphic: :oss,
- artistic: :oss,
- bsd: :oss,
- cc: :oss,
- eclipse: :oss,
- gpl: :oss,
- isc: :oss,
- lppl: :oss,
- ncsa: :oss,
- mit: :oss,
- mpl: :oss,
- ofl: :oss,
- public_domain: :oss,
- ubuntu_font: :oss,
- x11: :oss,
- }.freeze
-
- DEFAULT_LICENSE = :unknown
- DEFAULT_CATEGORY = VALID_LICENSES[DEFAULT_LICENSE]
-
- attr_reader :value
-
- def self.check_constants
- categories = Set.new(VALID_LICENSES.values)
- categories.each do |cat|
- next if VALID_LICENSES.key?(cat)
- raise "license category is not a value: '#{@cat.inspect}'"
- end
- end
-
- def self.category(license)
- VALID_LICENSES.fetch(license, DEFAULT_CATEGORY)
- end
-
- def initialize(arg)
- @value = arg
- @value = DEFAULT_LICENSE if @value.nil?
- return if VALID_LICENSES.key?(@value)
- raise "invalid license value: '#{@value.inspect}'"
- end
-
- def category
- self.class.category(@value)
- end
-
- def to_s
- @value.inspect
- end
- end
- end
-end