diff --git a/History.txt b/History.txt index 68899f2..5a11b0e 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,10 @@ +== 0.2.1 2009-08-30 + +* Typing in an argument in the command line will launch to that specific search: +e.g. $ gembox rack #=> opens gembox to the rack page. +* If a search exactly matches a gem name it will open that gems info page instead of displaying search results +* Updated to latest version of Vegas + == 0.2.0 2009-07-06 * Updated to latest version of Vegas for Windows compatability diff --git a/Rakefile b/Rakefile index 503a940..e2c1117 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -%w[rubygems rake rake/clean fileutils newgem rubigen jeweler].each { |f| require f } +%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f } require File.dirname(__FILE__) + '/lib/gembox' # Generate all the Rake tasks @@ -13,7 +13,7 @@ $hoe = Hoe.new('gembox', Gembox::VERSION) do |p| p.url = ['http://code.quirkey.com/gembox', 'http://github.com/quirkey/gembox'] p.extra_deps = [ ['sinatra', '>=0.9.2'], - ['vegas', '>=0.0.3.1'], + ['vegas', '>=0.1.0'], ['haml', '>=2.0.9'], ['rdoc', '=2.4.3'], ['activesupport', '>=2.2.2'], diff --git a/bin/gembox b/bin/gembox index 5d2b370..c28ec7a 100755 --- a/bin/gembox +++ b/bin/gembox @@ -6,4 +6,6 @@ require File.expand_path(File.dirname(__FILE__) + "/../lib/gembox") require 'vegas' -Vegas::Runner.new(Gembox::App, 'gembox') \ No newline at end of file +Vegas::Runner.new(Gembox::App, 'gembox', { + :launch_path => lambda {|r| r.args.first ? "/gems/?search=#{r.args.first}" : '' } +}) \ No newline at end of file diff --git a/gembox.gemspec b/gembox.gemspec index d3a3f59..d0ecead 100644 --- a/gembox.gemspec +++ b/gembox.gemspec @@ -2,11 +2,11 @@ Gem::Specification.new do |s| s.name = %q{gembox} - s.version = "0.2.0" + s.version = "0.2.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Aaron Quint"] - s.date = %q{2009-07-06} + s.date = %q{2009-08-30} s.default_executable = %q{gembox} s.description = %q{A sinatra based interface for browsing and admiring your gems.} s.email = ["aaron@quirkey.com"] @@ -18,7 +18,7 @@ Gem::Specification.new do |s| s.rdoc_options = ["--main", "README.rdoc"] s.require_paths = ["lib"] s.rubyforge_project = %q{quirkey} - s.rubygems_version = %q{1.3.3} + s.rubygems_version = %q{1.3.5} s.summary = %q{A sinatra based interface for browsing and admiring your gems.} s.test_files = ["test/test_gembox_app.rb", "test/test_gembox_gems.rb", "test/test_helper.rb"] @@ -28,7 +28,7 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q, [">= 0.9.2"]) - s.add_runtime_dependency(%q, [">= 0.0.3.1"]) + s.add_runtime_dependency(%q, [">= 0.1.0"]) s.add_runtime_dependency(%q, [">= 2.0.9"]) s.add_runtime_dependency(%q, ["= 2.4.3"]) s.add_runtime_dependency(%q, [">= 2.2.2"]) @@ -38,7 +38,7 @@ Gem::Specification.new do |s| s.add_development_dependency(%q, [">= 1.8.0"]) else s.add_dependency(%q, [">= 0.9.2"]) - s.add_dependency(%q, [">= 0.0.3.1"]) + s.add_dependency(%q, [">= 0.1.0"]) s.add_dependency(%q, [">= 2.0.9"]) s.add_dependency(%q, ["= 2.4.3"]) s.add_dependency(%q, [">= 2.2.2"]) @@ -49,7 +49,7 @@ Gem::Specification.new do |s| end else s.add_dependency(%q, [">= 0.9.2"]) - s.add_dependency(%q, [">= 0.0.3.1"]) + s.add_dependency(%q, [">= 0.1.0"]) s.add_dependency(%q, [">= 2.0.9"]) s.add_dependency(%q, ["= 2.4.3"]) s.add_dependency(%q, [">= 2.2.2"]) diff --git a/lib/gembox.rb b/lib/gembox.rb index 60d4fc3..6a322f4 100644 --- a/lib/gembox.rb +++ b/lib/gembox.rb @@ -10,7 +10,7 @@ require 'will_paginate/view_helpers' module Gembox - VERSION = '0.2.0' + VERSION = '0.2.1' end require 'gembox/extensions' diff --git a/lib/gembox/app.rb b/lib/gembox/app.rb index 9860a4e..b76accb 100644 --- a/lib/gembox/app.rb +++ b/lib/gembox/app.rb @@ -61,7 +61,11 @@ class App < ::Sinatra::Default show_layout = params[:layout] != 'false' @show_as = params[:as] || 'columns' if @search = params[:search] - @gems = Gembox::Gems.search(@search).paginate :page => params[:page] + @gems = Gembox::Gems.search(@search).paginate :page => params[:page] + if !@gems.empty? && gem = @gems.find {|k,v| k.strip == @search.strip } + gem = gem[1][0] + redirect "/gems/#{gem.name}/#{gem.version}" and return + end end haml "gems_#{@show_as}".to_sym, :layout => show_layout end diff --git a/test/test_gembox_app.rb b/test/test_gembox_app.rb index 9004e0e..1686557 100644 --- a/test/test_gembox_app.rb +++ b/test/test_gembox_app.rb @@ -110,7 +110,7 @@ describe 'getting gems/name/version' do before do - get '/gems/sinatra/0.9.0.4' + get "/gems/sinatra/#{Sinatra::VERSION}" end should "display dependencies" do @@ -122,7 +122,7 @@ end should "load gem spec specified version" do - body.should have_element('.version', '0.9.0.4') + body.should have_element('.version', Sinatra::VERSION) end should "display links to all versions" do