Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #32 from stereobooster/master

can't download yui_compressor (404)
  • Loading branch information...
commit 77608212c604a4d14566ffee40c39d827db13f3c 2 parents ec080e5 + 3652dad
@cjohansen authored
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in rb-notifu.gemspec
+gemspec
View
33 Gemfile.lock
@@ -0,0 +1,33 @@
+PATH
+ remote: .
+ specs:
+ juicer (1.0.9)
+ cmdparse
+ nokogiri
+ rubyzip
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ cmdparse (2.0.3)
+ fakefs (0.3.2)
+ git (1.2.5)
+ jeweler (1.6.0)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ mocha (0.9.12)
+ nokogiri (1.4.4.1-x86-mingw32)
+ rake (0.9.0)
+ rubyzip (0.9.4)
+ shoulda (2.11.3)
+
+PLATFORMS
+ x86-mingw32
+
+DEPENDENCIES
+ fakefs (>= 0.2.1)
+ jeweler (>= 0.2.1)
+ juicer!
+ mocha (>= 0.9.8)
+ shoulda (>= 2.10.2)
View
7 lib/juicer/install/yui_compressor_installer.rb
@@ -13,6 +13,7 @@ class YuiCompressorInstaller < Base
def initialize(install_dir = Juicer.home)
super(install_dir)
@latest = nil
+ @href = nil
@website = "http://yuilibrary.com/downloads/"
end
@@ -28,7 +29,7 @@ def initialize(install_dir = Juicer.home)
def install(version = nil)
version = super(version)
base = "yuicompressor-#{version}"
- filename = download(File.join(@website, "yuicompressor", "#{base}.zip"))
+ filename = download(@href)
target = File.join(@install_dir, path)
Zip::ZipFile.open(filename) do |file|
@@ -60,7 +61,9 @@ def uninstall(version = nil)
def latest
return @latest if @latest
webpage = Nokogiri::HTML(open(@website))
- @latest = (webpage / "h3#yuicompressor + ul li a:last").text.match(/(\d\.\d\.\d)/)[1]
+ a = (webpage / "h3#yuicompressor + ul li a:last")[0]
+ @href = a["href"]
+ @latest = a.text.match(/(\d\.\d\.\d)/)[1]
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.