aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-09-17 21:25:42 -0500
committerJack Nagel2013-09-17 21:29:55 -0500
commitbf6333c2195e3436d632b5dfc9fd06a95e5a4e77 (patch)
tree300d45f75b82d59eb4ed612fce2e71b8a23ebaf7 /Library/Formula
parent735ec9f0ccbf972750cb4761a207b3289ecba01d (diff)
downloadhomebrew-bf6333c2195e3436d632b5dfc9fd06a95e5a4e77.tar.bz2
scala: use resources
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/scala.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/Library/Formula/scala.rb b/Library/Formula/scala.rb
index 172e737f8..26398a7c9 100644
--- a/Library/Formula/scala.rb
+++ b/Library/Formula/scala.rb
@@ -1,16 +1,5 @@
require 'formula'
-class ScalaDocs < Formula
- homepage 'http://www.scala-lang.org/'
- url 'http://www.scala-lang.org/files/archive/scala-docs-2.10.2.zip'
- sha1 '96107dafb44af30d24c07fc29feddbf470377cdd'
-
- devel do
- url 'http://www.scala-lang.org/files/archive/scala-docs-2.11.0-M4.zip'
- sha1 '24be02960fda935ab8d5a67b902147af3c95ced4'
- end
-end
-
class Scala < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/files/archive/scala-2.10.2.tgz'
@@ -20,10 +9,21 @@ class Scala < Formula
url 'http://www.scala-lang.org/files/archive/scala-2.11.0-M4.tgz'
sha1 '43e0983cebe75154e41a6b35a5b82bdc5bdbbaa2'
version '2.11.0-M4'
+
+ resource 'docs' do
+ url 'http://www.scala-lang.org/files/archive/scala-docs-2.11.0-M4.zip'
+ sha1 '24be02960fda935ab8d5a67b902147af3c95ced4'
+ version '2.11.0-M4'
+ end
end
option 'with-docs', 'Also install library documentation'
+ resource 'docs' do
+ url 'http://www.scala-lang.org/files/archive/scala-docs-2.10.2.zip'
+ sha1 '96107dafb44af30d24c07fc29feddbf470377cdd'
+ end
+
resource 'completion' do
url 'https://raw.github.com/scala/scala-dist/27bc0c25145a83691e3678c7dda602e765e13413/completion.d/2.9.1/scala'
sha1 'e2fd99fe31a9fb687a2deaf049265c605692c997'
@@ -38,10 +38,10 @@ class Scala < Formula
bash_completion.install resource('completion')
- ScalaDocs.new.brew do
+ if build.with? 'docs'
branch = build.stable? ? 'scala-2.10' : 'scala-2.11'
- (share/'doc'/branch).install Dir['*']
- end if build.include? 'with-docs'
+ (share/'doc'/branch).install resource('docs')
+ end
# Set up an IntelliJ compatible symlink farm in 'idea'
idea = prefix/'idea'