* tring out the screenshot gem

This commit is contained in:
Seth Call 2013-01-29 21:36:19 -06:00
parent f0bf0545cd
commit 53a0a0a91f
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,36 @@
class ArtifactsController < ApplicationController
def versioncheck
# the reported client version
client_version = params[:ver]
# the name of the client
product = params[:product]
# the os (Win32/MacOSX/Unix)
os = params[:os]
product = "#{product}/#{os}"
unless ArtifactUpdate::PRODUCTS.include? product
render :text => "Unknown product type"
return
end
@artifact = ArtifactUpdate.find_by_product_and_environment(product, ArtifactUpdate::DEFAULT_ENVIRONMENT)
if @artifact.nil?
@log.error "no product was found for #{product} and environment: #{ArtifactUpdate::DEFAULT_ENVIRONMENT}"
render :text => "No product available"
return
elsif @artifact.version == client_version
render :text => "You have the latest version."
return
else
render :layout => false
end
end
end

View File

@ -0,0 +1,10 @@
<!-- modeled after dialog in original client -->
<table style="background: #262626; color: #000000; font-family: Raleway, Arial, Helvetica, sans-serif;">
<tr>
<td width=70><%= image_tag "logo.png" %></td>
<td><h1>New version available</h1>
<p>Version <%= @artifact.version %> is now released on Jamkazam.com<br/>
Please <a href="<%= @artifact.uri %>">download directly</a> from here.</p></td>
</tr>
</table>