Permalink
Browse files

Change alg.garron.us links to alg.cubing.net.

  • Loading branch information...
1 parent 00f7780 commit 107c5237c8f670e5775730addabc6208e9eefbbe @lgarron committed Feb 22, 2014
Showing with 7 additions and 14 deletions.
  1. +6 −13 lib/garronizer.rb
  2. +1 −1 views/solve_links.erb
View
@@ -4,11 +4,10 @@ class << self
def garronize(solve)
params = {
"alg" => escape_chars(solve.canonical_solution),
- "ini" => escape_chars(solve.scramble),
- "animtype" => animtype(solve),
- "cube" => solve.puzzle.garronized_name,
- "name" => garron_title(solve),
- "displines" => display_lines(solve.canonical_solution),
+ "setup" => escape_chars(solve.scramble),
+ "type" => animtype(solve),
+ "puzzle" => solve.puzzle.garronized_name,
+ "title" => garron_title(solve),
}
garron_url_from_params(params)
end
@@ -18,7 +17,7 @@ def garronize(solve)
def garron_url_from_params(params)
url_params = params.reject { |k, v| v.blank? }
.map { |k, v| "#{k}=#{v}"}.join("&")
- "http://alg.garron.us/?#{url_params}"
+ "http://alg.cubing.net/?#{url_params}"
end
def escape_chars(alg)
@@ -28,13 +27,7 @@ def escape_chars(alg)
# if we don't have a scramble we need to set the 'animtype' to
# have it set the cube up by doing the inverse of the solution
def animtype(solve)
- solve.scramble.blank? ? "solve" : ""
- end
-
- # when scrambles are too long, the solution being displayed covers the cube.
- # we pick 12 arbitrarily to turn off the solution being displayed.
- def display_lines(solution)
- solution.lines.count > 12 ? "0" : ""
+ solve.scramble.blank? ? "reconstruction-end-with-setup" : "reconstruction"
end
def garron_title(solve)
@@ -1,7 +1,7 @@
<div class="solve-links">
<% if @solve.puzzle.garronizable? %>
<div class="garron solve-link">
- <%= link_to "alg.garron", garronize(@solve), target: "_blank" %>
+ <%= link_to "alg.cubing.net", garronize(@solve), target: "_blank" %>
</div>
<% end %>

0 comments on commit 107c523

Please sign in to comment.