Skip to content

Commit

Permalink
Copy changes and more for the RubyGems.org move
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Feb 20, 2010
1 parent 0f3a968 commit 2b10076
Show file tree
Hide file tree
Showing 29 changed files with 108 additions and 178 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Expand Up @@ -12,9 +12,9 @@ def authenticate_with_api_key

def verify_authenticated_user
if current_user.nil?
render :text => "Access Denied. Please sign up for an account at http://gemcutter.org", :status => 401
render :text => t(:please_sign_up), :status => 401
elsif !current_user.email_confirmed
render :text => "Access Denied. Please confirm your Gemcutter account.", :status => 403
render :text => t(:please_confirm), :status => 403
end
end

Expand Down
10 changes: 1 addition & 9 deletions app/helpers/application_helper.rb
Expand Up @@ -5,16 +5,8 @@ def content_for?(name)
instance_variable_get("@content_for_#{name}").present?
end

def title
"gemcutter"
end

def subtitle
"awesome gem hosting"
end

def page_title
combo = "#{title} | #{subtitle}"
combo = "#{t :title} | #{t :subtitle}"
if @title
"#{@title} | #{combo}"
else
Expand Down
2 changes: 1 addition & 1 deletion app/metal/hostess.rb
Expand Up @@ -58,7 +58,7 @@ def serve_via_cf
/quick/latest_index
].each do |old_index|
head old_index do
"Please upgrade your RubyGems, it's quite old: http://gemcutter.org/pages/download"
t(:please_upgrade)
end

get old_index do
Expand Down
2 changes: 1 addition & 1 deletion app/models/rubygem.rb
Expand Up @@ -73,7 +73,7 @@ def owned_by?(user)

def metrics_link(project_path)
project_url = CGI.escape(project_path)
"http://devver.net/caliper/project?repo=#{project_url}"
"http://getcaliper.com/caliper/project?repo=#{project_url}"
end

def to_s
Expand Down
8 changes: 4 additions & 4 deletions app/views/home/index.html.erb
Expand Up @@ -14,7 +14,7 @@
<div class="learn">
<h3>learn</h3>
<dl>
<dt><%= link_to "Install RubyGems 1.3.5", page_url("download") %></dt>
<dt><%= link_to "Install RubyGems 1.3.6", page_url("download") %></dt>
<dd>Ruby's premier packaging system</dd>
<dt><%= link_to "Browse the Docs", "http://docs.rubygems.org" %></dt>
<dd>The comprehensive guide on RubyGems</dd>
Expand All @@ -25,8 +25,8 @@
<div class="share">
<h3>share</h3>
<dl>
<dt><code>gem install gemcutter</code></dt>
<dd>Provides plugins to share your code</dd>
<dt><code>gem update --system</code></dt>
<dd>Update to the latest RubyGems version</dd>
<dt><code>gem build foo.gemspec</code></dt>
<dd>Build your gem</dd>
<dt><code>gem push foo-1.0.0.gem</code></dt>
Expand All @@ -37,7 +37,7 @@
</div>

<p class="pitch">
<strong><%= link_to "Gemcutter", page_url("about") %></strong> is the Ruby community's gem hosting service.
<strong><%= link_to t(:title), page_url("about") %></strong> is the Ruby community's gem hosting service.
<strong><%= link_to "Instantly publish", page_url("gem_docs"), :anchor => "push" %></strong> your gems and install them.
<strong><%= link_to "Use the API", page_url("api_docs") %></strong> to interact and find out more information about available gems.
<strong><%= link_to "Become a contributor", "http://github.com/qrush/gemcutter" %></strong> and enhance the site with your own changes.
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/_feeds.html.erb
@@ -1,5 +1,5 @@
<% if signed_in? %>
<%= atom_feed_link 'Gemcutter | Subscribed Gems', dashboard_url(:api_key => current_user.api_key, :format => :atom) %>
<%= atom_feed_link t(:feed_subscribed), dashboard_url(:api_key => current_user.api_key, :format => :atom) %>
<% end %>
<%= atom_feed_link 'Gemcutter | Latest Gems', 'http://feeds.feedburner.com/gemcutter-latest' %>
<%= atom_feed_link t(:feed_latest), 'http://feeds.feedburner.com/gemcutter-latest' %>
10 changes: 5 additions & 5 deletions app/views/layouts/application.html.erb
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="fluid-icon" href="/apple-touch-icon.png"/>
<link rel="search" type="application/opensearchdescription+xml" title="gemcutter" href="/opensearch.xml">
<link rel="search" type="application/opensearchdescription+xml" title="<%=t :title %>" href="/opensearch.xml">
<%= stylesheet_link_tag "reset", "960", "screen", "humanmsg", :cache => true %>
<!--[if IE 7]>
<%= stylesheet_link_tag "ie7" %>
Expand All @@ -17,10 +17,10 @@
<div id="flash_<%= name %>"><%= msg %></div>
<% end %>
<div class="container_12">
<div class="prefix_1 grid_3 header">
<h1><%= link_to "Gemcutter", root_url, :title => "Home" %></h1>
<div class="prefix_1 grid_4 header">
<h1><%= link_to t(:title), root_url, :title => "Home" %></h1>
</div>
<div class="grid_7 suffix_1 nav">
<div class="grid_6 suffix_1 nav">
<ul>
<% if signed_in? %>
<li><%= link_to(image_tag(current_user.gravatar_url(:size => 24)), profile_url, :id => "user_gravatar") %></li>
Expand Down Expand Up @@ -65,7 +65,7 @@
<%= link_to "About", page_url("about") %>
<%= link_to "Blog", "http://update.gemcutter.org" %>
<%= link_to "Docs", page_url("docs") %>
<%= link_to "Help", "http://help.rubygems.org" %>
<%= link_to "Help", t(:help_url) %>
<%= link_to "Status", "http://twitter.com/gemcutter" %>
<%= link_to "Code", "http://github.com/qrush/gemcutter" %>
<%= link_to "Discuss", "http://groups.google.com/group/gemcutter" %>
Expand Down
16 changes: 8 additions & 8 deletions app/views/pages/about.html.erb
@@ -1,18 +1,18 @@
<% @title = "About" %>
<% @subtitle = "what this is" %>
<p>
Welcome to Gemcutter, the Ruby community's new way to host gems. The purpose of this project is three-fold:
Welcome to <%=t :title %>, the Ruby community's gem hosting service. The purpose of this project is three-fold:
</p>
<ol class="manual">
<li>Provide a better API for dealing with gems</li>
<li>Create more transparent and accessible project pages</li>
<li>Enable the community to improve and enhance the site</li>
</ol>
<ol class="manual">
<li>Provide a better API for dealing with gems</li>
<li>Create more transparent and accessible project pages</li>
<li>Enable the community to improve and enhance the site</li>
</ol>
<p>
The project was started in April 2009 by <%= link_to "Nick Quaranto", "http://twitter.com/qrush" %>, and has since grown to include the contributions of over 15 Rubyists and thousands of gem downloads.
The project was started in April 2009 by <%= link_to "Nick Quaranto", "http://twitter.com/qrush" %>, and has since grown to include the contributions of over <%= link_to "45 Rubyists", "http://twitter.com/gemcutter/contributors" %> and <%= link_to "millions of gem downloads", stats_url %>. As of the RubyGems 1.3.6 release, the site has been renamed to <%=t :title %> from Gemcutter to solidify the site's central role in the Ruby community.
</p>
<p>
Although Gemcutter is not run by one specific company, plenty have helped us out so far. The current design of the site was sponsored by <%= link_to "Thoughtbot", "http://thoughtbot.com" %>. <%= link_to "GitHub", "http://github.com" %> has also been invaluable for helping us collaborate and share code easily.
Although Gemcutter is not run by one specific company, plenty have helped us out so far. The current design of the site was sponsored by <%= link_to "Thoughtbot", "http://thoughtbot.com" %>. <%= link_to "GitHub", "http://github.com" %> has also been invaluable for helping us collaborate and share code easily. The site started on <%= link_to "Heroku", "http://heroku.com" %>, whose great service helped prove Gemcutter as a viable solution that the whole community could rely on.
</p>
<p>
Some insights into the technical aspects of the site: It's 100% Ruby. The main site is a <%= link_to "Rails", "http://rubyonrails.org" %> application, and the RubyGem serving is done through <%= link_to "Sinatra", "http://www.sinatrarb.com" %>. Gems are hosted on <%= link_to "Amazon S3", "http://aws.amazon.com/s3/" %>, and the time between publishing a new gem and having it ready for installation is minimal. For more info, <%= link_to "please check out the code", "http://github.com/qrush/gemcutter" %>, which is <%= link_to "MIT licensed", "http://www.opensource.org/licenses/mit-license.php" %> over at GitHub.
Expand Down
42 changes: 21 additions & 21 deletions app/views/pages/api_docs.html.erb
@@ -1,7 +1,7 @@
<% @title = "API Docs" %>
<% @subtitle = "get your code on" %>
<p>
The API is a work in progress, and <%= link_to "can use your help!", "http://github.com/qrush/gemcutter" %> The <%= link_to "gemcutter gem", rubygem_url("gemcutter") %> uses the API to push gems, add owners, and more. Check out all of the gem commands <%= link_to "here", page_url("gem_docs") %>.
The API is a work in progress, and <%= link_to "can use your help!", "http://github.com/qrush/gemcutter" %> RubyGems itself and <%= link_to "gemcutter gem", rubygem_url("gemcutter") %> uses the API to push gems, add owners, and more. Check out all of the gem commands <%= link_to "here", page_url("gem_docs") %>.
</p>

<h4>API Methods</h4>
Expand All @@ -17,7 +17,7 @@ The API is a work in progress, and <%= link_to "can use your help!", "http://git
<h5 class="api">GET - /api/v1/gems/[name].(json|xml)</h5>
<p>
Returns some basic information about the given gem. For example, here's Rails:
<pre><code>$ curl http://gemcutter.org/api/v1/gems/rails.json
<pre><code>$ curl <%=t :url %>/api/v1/gems/rails.json

{
"name": "rails",
Expand All @@ -28,8 +28,8 @@ The API is a work in progress, and <%= link_to "can use your help!", "http://git
"version_downloads": 2451,
"authors": "David Heinemeier Hansson",
"downloads": 134451,
"project_uri": "http://gemcutter.org/gems/rails",
"gem_uri": "http://gemcutter.org/gems/rails-2.3.5.gem",
"project_uri": "<%=t :url %>/gems/rails",
"gem_uri": "<%=t :url %>/gems/rails-2.3.5.gem",
"dependencies": {
"runtime": [
{
Expand All @@ -41,7 +41,7 @@ The API is a work in progress, and <%= link_to "can use your help!", "http://git
}
}

$ curl http://gemcutter.org/api/v1/gems/rails.xml
$ curl <%=t :url %>/api/v1/gems/rails.xml

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rubygem&gt;
Expand All @@ -51,8 +51,8 @@ $ curl http://gemcutter.org/api/v1/gems/rails.xml
Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick
on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
&lt;/info&gt;
&lt;gem-uri&gt;http://gemcutter.org/gems/rails-2.3.5.gem&lt;/gem-uri&gt;
&lt;project-uri&gt;http://gemcutter.org/gems/rails&lt;/project-uri&gt;
&lt;gem-uri&gt;<%=t :url %>/gems/rails-2.3.5.gem&lt;/gem-uri&gt;
&lt;project-uri&gt;<%=t :url %>/gems/rails&lt;/project-uri&gt;
&lt;version&gt;2.3.5&lt;/version&gt;
&lt;authors&gt;David Heinemeier Hansson&lt;/authors&gt;
&lt;version-downloads type="integer"&gt;141363&lt;/version-downloads&gt;
Expand All @@ -71,17 +71,17 @@ $ curl http://gemcutter.org/api/v1/gems/rails.xml
<h5 class="api">GET - /api/v1/search.(json|xml)?query=[YOUR QUERY]</h5>
<p>
Submit a search to Gemcutter for active gems, just like a search query on the site. Returns an array of the XML or JSON representation of gems that match.
<pre><code>$ curl 'http://gemcutter.org/api/v1/search.json?query=cucumber'
<pre><code>$ curl '<%=t :url %>/api/v1/search.json?query=cucumber'

$ curl 'http://gemcutter.org/api/v1/search.xml?query=cucumber'</code></pre>
$ curl '<%=t :url %>/api/v1/search.xml?query=cucumber'</code></pre>
</p>

<h5 class="api">POST - /api/v1/gems</h5>
<p>
Submit a gem to Gemcutter. Must have your API key supplied and give a built RubyGem in the body of the request.
<pre><code>$ curl --data-binary @gemcutter-0.2.1.gem \
-H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
http://gemcutter.org/api/v1/gems
<%=t :url %>/api/v1/gems

Successfully registered gem: gemcutter (0.2.1)</code></pre>
</p>
Expand All @@ -92,7 +92,7 @@ Successfully registered gem: gemcutter (0.2.1)</code></pre>
<p>
View all owners of a gem that you own. These users can all push to this gem.
<pre><code>$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
http://gemcutter.org/api/v1/gems/gemcutter/owners.json
<%=t :url %>/api/v1/gems/gemcutter/owners.json

[
{
Expand All @@ -110,7 +110,7 @@ Successfully registered gem: gemcutter (0.2.1)</code></pre>
Add an owner to a RubyGem you own, giving that user permission to manage it.
<pre><code>$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-F 'email=josh@technicalpickles.com' \
http://gemcutter.org/api/v1/gems/gemcutter/owners
<%=t :url %>/api/v1/gems/gemcutter/owners

Owner added successfully.
</code></pre>
Expand All @@ -121,7 +121,7 @@ Owner added successfully.
Remove a user's permission to manage a RubyGem you own.
<pre><code>$ curl -X DELETE -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-d "email=josh@technicalpickles.com" \
http://gemcutter.org/api/v1/gems/gemcutter/owners
<%=t :url %>/api/v1/gems/gemcutter/owners

Owner removed successfully.
</code></pre>
Expand All @@ -133,7 +133,7 @@ Owner removed successfully.
<p>
List the webhooks registered under your account.
<pre><code>$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
http://gemcutter.org/api/v1/web_hooks.json
<%=t :url %>/api/v1/web_hooks.json

{
"all gems": [
Expand All @@ -157,13 +157,13 @@ Owner removed successfully.
Create a webhook. Requires two parameters: <code>gem_name</code> and <code>url</code>. Specify <code>*</code> for the <code>gem_name</code> parameter to apply the hook globally to all gems.
<pre><code>$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-F 'gem_name=rails' -F 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks
<%=t :url %>/api/v1/web_hooks

Successfully created webhook for rails to http://example.com

$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-F 'gem_name=*' -F 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks
<%=t :url %>/api/v1/web_hooks

Successfully created webhook for all gems to http://example.com</code></pre>
</p>
Expand All @@ -173,13 +173,13 @@ Successfully created webhook for all gems to http://example.com</code></pre>
Remove a webhook. Requires two parameters: <code>gem_name</code> and <code>url</code>. Specify <code>*</code> for the <code>gem_name</code> parameter to apply the hook globally to all gems.
<pre><code>$ curl -X DELETE -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-d 'gem_name=rails' -d 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks/remove
<%=t :url %>/api/v1/web_hooks/remove

Successfully removed webhook for rails to http://example.com

$ curl -X DELETE -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-d 'gem_name=*' -d 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks/remove
<%=t :url %>/api/v1/web_hooks/remove

Successfully removed webhook for all gems to http://example.com</code></pre>
</p>
Expand All @@ -189,13 +189,13 @@ Successfully removed webhook for all gems to http://example.com</code></pre>
Test fire a webhook. This can be used to test out an endpoint at any time, for example when you're developing your application. Requires two parameters: <code>gem_name</code> and <code>url</code>. Specify <code>*</code> for the <code>gem_name</code> parameter to apply the hook globally to all gems.
<pre><code>$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-F 'gem_name=rails' -F 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks/fire
<%=t :url %>/api/v1/web_hooks/fire

Successfully deployed webhook for rails to http://example.com

$ curl -H 'Authorization:701243f217cdf23b1370c7b66b65ca97' \
-F 'gem_name=*' -F 'url=http://example.com' \
http://gemcutter.org/api/v1/web_hooks/fire
<%=t :url %>/api/v1/web_hooks/fire

Successfully deployed webhook for all gems to http://example.com</code></pre>
</p>
Expand All @@ -206,7 +206,7 @@ Successfully deployed webhook for all gems to http://example.com</code></pre>
<p>
Retrieve your API key using HTTP basic auth.
<pre><code>$ curl -u "nick@gemcutter.org:schwwwwing" \
http://gemcutter.org/api/v1/api_key
<%=t :url %>/api/v1/api_key

701243f217cdf23b1370c7b66b65ca97
</code></pre>
Expand Down
8 changes: 4 additions & 4 deletions app/views/pages/download.html.erb
@@ -1,12 +1,12 @@
<% @title = "Download RubyGems" %>
<% @subtitle = "v1.3.5" %>
<% @subtitle = "v1.3.6" %>
<p>
RubyGems is a package management framework for Ruby. Download the latest version here:
</p>
<ol class="formats" id="formats">
<li><%= link_to "tgz", "http://gemcutter-production.s3.amazonaws.com/rubygems/rubygems-1.3.5.tgz" %></li>
<li><%= link_to "zip", "http://gemcutter-production.s3.amazonaws.com/rubygems/rubygems-1.3.5.zip" %></li>
<li><%= link_to "gem", "http://gemcutter-production.s3.amazonaws.com/rubygems/rubygems-update-1.3.5.gem" %></li>
<li><%= link_to "tgz", "http://production.cf.rubygems.org/rubygems/rubygems-1.3.5.tgz" %></li>
<li><%= link_to "zip", "http://production.cf.rubygems.org/rubygems/rubygems-1.3.5.zip" %></li>
<li><%= link_to "gem", "http://production.cf.rubygems.org/rubygems/rubygems-update-1.3.5.gem" %></li>
</ol>
<p>
Or, to upgrade to the latest RubyGems:
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/faq.html.erb
@@ -1,3 +1,3 @@
<% @title = "FAQ" %>
<%= link_to "This page has been moved onto Gemcutter's new support site.", "http://help.rubygems.org/faqs/gemcutter/faq" %>
<%= link_to "This page has been moved onto #{t(:title)}'s new support site.", "http://help.rubygems.org/faqs/gemcutter/faq" %>
16 changes: 6 additions & 10 deletions app/views/pages/gem_docs.html.erb
@@ -1,22 +1,18 @@
<% @title = "Gem Docs" %>
<% @subtitle = "how to use gemcutter" %>
<% @subtitle = "how to use #{t(:title)}" %>
<p>
For gem publishers, you'll want to install the gemcutter gem to get started: <code>gem install gemcutter</code> Once the gem is installed, several new <code>gem</code> commands are available to you, and they are explained in detail below.
For gem publishers, you'll want to <%= link_to "first upgrade to the latest RubyGems version", page_url("download") %>. <strong>As of RubyGems 1.3.6, <code>gem push</code> and <code>gem owner</code> have been merged in, so you will only need to install the gemcutter gem for new commands like <code>gem webhook</code>.</strong>
</p>
<p>
The Gemcutter gem requires at least RubyGems 1.3.3 in order to work. Please upgrade by running <code>gem update --system</code> if you haven't already!
</p>


<h4 id="push">gem push</h4>
<p>
Publish your gems to the world with one command. All that's required is your very own Gemcutter account. The first time you push, you'll be asked to log in, and then Gemcutter will save your API key to <code>~/.gem/credentials</code>. Once your gem is pushed, it is processed, indexed, and uploaded to Amazon S3 behind the scenes and should be available for download within moments.
Publish your gems to the world with one command. All that's required is your very own <%=t :title %> account. The first time you push, you'll be asked to log in, and then it will save your API key to <code>~/.gem/credentials</code>. Once your gem is pushed, it is processed, indexed, and uploaded to Amazon S3 behind the scenes and should be available for download within moments.
<pre><code>$ gem push pkg/gemcutter-0.1.3.gem
Enter your Gemcutter credentials. Don't have an account yet? Create one at http://gemcutter.org/sign_up
Enter your <%=t :title %> credentials. Don't have an account yet? Create one at <%=t :url %>/sign_up
Email: nick@quaran.to
Password:
Signed in. Your api key has been stored in ~/.gem/credentials
Pushing gem to Gemcutter...
Pushing gem to <%=t :title %>...
Successfully registered gem: gemcutter (0.1.3)</code></pre>
</p>

Expand Down Expand Up @@ -75,7 +71,7 @@ Successfully deployed webhook for rack to http://example.com</code></pre>

<h4 id="tumble">gem tumble</h4>
<p>
This command has been deprecated since <%= link_to "Gemcutter is now the official gem source.", "http://update.gemcutter.org/2009/10/26/transition.html" %>
This command has been deprecated since <%= link_to "#{t(:title)} is now the official gem source.", "http://update.gemcutter.org/2009/10/26/transition.html" %>
</p>

<h4 id="migrate">gem migrate</h4>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/migrate.html.erb
Expand Up @@ -5,5 +5,5 @@
<code>gem migrate</code> has been deprecated, all of the RubyForge accounts and ownerships have been transferred over to Gemcutter.
</p>
<p>
If you're having problems with your gems and pushing, feel free to email <code>nick@gemcutter.org</code> about it.
If you're having problems with your gems and pushing, <%= link_to "please open a support request", t(:help_url) %>
</p>

0 comments on commit 2b10076

Please sign in to comment.