gotascii-crags 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/crags.gemspec +1 -1
- data/lib/crags.rb +2 -1
- data/lib/crags/searcher.rb +2 -1
- metadata +1 -1
data/crags.gemspec
CHANGED
data/lib/crags.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'curb'
|
3
3
|
require 'hpricot'
|
4
|
+
require "erb"
|
4
5
|
|
5
6
|
module Crags
|
6
|
-
VERSION = '1.2.
|
7
|
+
VERSION = '1.2.7'
|
7
8
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
8
9
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
9
10
|
|
data/lib/crags/searcher.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Crags
|
2
2
|
module Searcher
|
3
3
|
include Fetch
|
4
|
+
include ERB::Util
|
4
5
|
|
5
6
|
def strip_http(url)
|
6
7
|
url.gsub(/http\:\/\/(.*)(\/|(.html))/,'\1\3')
|
@@ -49,7 +50,7 @@ module Crags
|
|
49
50
|
end
|
50
51
|
|
51
52
|
def search_location_link(keyword, loc, category = 'sss')
|
52
|
-
"http://#{loc}/search/#{category}?query=#{keyword}"
|
53
|
+
"http://#{loc}/search/#{category}?query=#{url_encode(keyword)}"
|
53
54
|
end
|
54
55
|
|
55
56
|
def search_location(keyword, loc, category = 'sss', &block)
|