Skip to content
Browse files

code lookup is such a pile of garbage

  • Loading branch information...
1 parent 87bc41f commit 70ce59962fe0c203d68bae791b944ef057deba77 @hiredman committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/hiredman/clojurebot/code_lookup.clj
View
9 src/hiredman/clojurebot/code_lookup.clj
@@ -57,7 +57,7 @@
[url project rev]
(-> url
(.replaceAll "http://code.google.com/p/clojure/source/browse/trunk"
- (str "http://github.com/clojure/" project "/blob/" rev))
+ (str "https://github.com/clojure/" project "/blob/" rev))
(.replaceAll "\\?r=(.*)#(\\d+)" "#LID$2")))
@@ -107,16 +107,17 @@
(filter #(= (:name %) thing) (:vars @contrib))))
(defmethod lookup :clojure [msg thing]
- (let [[file line] (get-file-and-ln thing)]
+ (println msg thing)
+ (let [[line file] (get-file-and-ln thing)]
(if (or (nil? file) (nil? line))
(if-let [results (seq (contrib-lookup thing))]
(reduce #(str % " " %2) (str thing ":") results)
(befuddled))
- (str thing ": " (make-url-cached [file line])))))
+ (str thing ": " (make-url-cached [line file])))))
(defn code-lookup? [{:keys [message]}]
(re-find #"^(def|source) " message))
(defn do-code-lookup [{:keys [message channel sender bot]}]
- (let [thing (.replaceAll message "^(def|source) " "")]
+ (let [thing (.replaceAl message "^(def|source) " "")]
(lookup message thing)))

0 comments on commit 70ce599

Please sign in to comment.
Something went wrong with that request. Please try again.