Permalink
Browse files

Application booting, seems to work for the most part

  • Loading branch information...
1 parent 1da640c commit dccafbd076b16d3c22c5cf393b03e01bfc008ff3 @qrush qrush committed Jun 14, 2010
Showing with 1,797 additions and 4,826 deletions.
  1. +17 −14 Gemfile
  2. +2 −6 Rakefile
  3. +1 −1 app/controllers/api/v1/rubygems_controller.rb
  4. +2 −1 app/helpers/rubygems_helper.rb
  5. +2 −2 app/models/dependency.rb
  6. +1 −1 lib/gemcutter.rb → app/models/pusher.rb
  7. +4 −4 app/models/rubygem.rb
  8. +8 −8 app/models/version.rb
  9. +2 −2 app/models/web_hook.rb
  10. +28 −32 app/views/layouts/application.html.erb
  11. +1 −1 app/views/rubygems/index.html.erb
  12. +4 −0 config.ru
  13. +15 −0 config/application.rb
  14. +13 −128 config/boot.rb
  15. +4 −11 config/environment.rb
  16. +8 −6 config/environments/development.rb
  17. +13 −11 config/environments/maintenance.rb
  18. +9 −7 config/environments/production.rb
  19. +9 −8 config/environments/staging.rb
  20. +9 −7 config/environments/test.rb
  21. +0 −12 config/initializers/new_rails_defaults.rb
  22. +1 −0 config/initializers/redis.rb
  23. +7 −0 config/initializers/secret_token.rb
  24. +7 −9 config/initializers/session_store.rb
  25. +0 −20 config/preinitializer.rb
  26. +1 −1 config/routes.rb
  27. +0 −4 script/about
  28. +0 −3 script/console
  29. +0 −9 script/cucumber
  30. +0 −3 script/dbconsole
  31. +0 −3 script/destroy
  32. +0 −3 script/generate
  33. +0 −3 script/performance/benchmarker
  34. +0 −3 script/performance/profiler
  35. +0 −3 script/plugin
  36. +6 −0 script/rails
  37. +0 −28 script/rfownerships2gc
  38. +0 −106 script/rfusers2gc
  39. +0 −3 script/runner
  40. +0 −3 script/server
  41. +1 −1 test/test_helper.rb
  42. +5 −5 test/unit/{gemcutter_test.rb → pusher_test.rb}
  43. BIN vendor/cache/abstract-1.0.0.gem
  44. BIN vendor/cache/actionmailer-2.3.5.gem
  45. BIN vendor/cache/actionmailer-3.0.0.beta4.gem
  46. BIN vendor/cache/actionpack-2.3.5.gem
  47. BIN vendor/cache/actionpack-3.0.0.beta4.gem
  48. BIN vendor/cache/activemodel-3.0.0.beta4.gem
  49. BIN vendor/cache/activerecord-2.3.5.gem
  50. BIN vendor/cache/activerecord-3.0.0.beta4.gem
  51. BIN vendor/cache/activeresource-2.3.5.gem
  52. BIN vendor/cache/activeresource-3.0.0.beta4.gem
  53. BIN vendor/cache/activesupport-2.3.5.gem
  54. BIN vendor/cache/activesupport-3.0.0.beta4.gem
  55. BIN vendor/cache/arel-0.4.0.gem
  56. BIN vendor/cache/bundler-0.9.26.gem
  57. BIN vendor/cache/clearance-0.8.2.gem
  58. BIN vendor/cache/clearance-0.9.0.rc1.gem
  59. BIN vendor/cache/cucumber-0.3.101.gem
  60. BIN vendor/cache/cucumber-0.8.0.gem
  61. BIN vendor/cache/cucumber-rails-0.3.2.gem
  62. BIN vendor/cache/daemons-1.0.10.gem
  63. BIN vendor/cache/delayed_job-2.0.3.gem
  64. BIN vendor/cache/erubis-2.6.5.gem
  65. BIN vendor/cache/factory_girl-1.2.3.gem
  66. BIN vendor/cache/factory_girl-1.3.0.gem
  67. BIN vendor/cache/factory_girl_rails-1.0.gem
  68. BIN vendor/cache/gherkin-1.0.30.gem
  69. BIN vendor/cache/high_voltage-0.9.0.gem
  70. BIN vendor/cache/i18n-0.4.1.gem
  71. BIN vendor/cache/json_pure-1.4.3.gem
  72. BIN vendor/cache/mail-2.2.4.gem
  73. BIN vendor/cache/rack-1.0.1.gem
  74. BIN vendor/cache/rack-1.1.0.gem
  75. BIN vendor/cache/rack-mount-0.6.4.gem
  76. BIN vendor/cache/rack-test-0.5.0.gem
  77. BIN vendor/cache/rack-test-0.5.4.gem
  78. BIN vendor/cache/rails-2.3.5.gem
  79. BIN vendor/cache/rails-3.0.0.beta4.gem
  80. BIN vendor/cache/railties-3.0.0.beta4.gem
  81. BIN vendor/cache/shoulda-2.10.2.gem
  82. BIN vendor/cache/shoulda-2.11.0.gem
  83. BIN vendor/cache/thor-0.13.6.gem
  84. BIN vendor/cache/treetop-1.4.3.gem
  85. BIN vendor/cache/treetop-1.4.5.gem
  86. BIN vendor/cache/trollop-1.16.2.gem
  87. BIN vendor/cache/tzinfo-0.3.22.gem
  88. +0 −9 vendor/plugins/coulda/CHANGELOG.textile
  89. +0 −145 vendor/plugins/coulda/README.textile
  90. +0 −4 vendor/plugins/coulda/TODO.textile
  91. +0 −54 vendor/plugins/coulda/features/controller_generator.feature
  92. +0 −12 vendor/plugins/coulda/features/helper_generator.feature
  93. +0 −37 vendor/plugins/coulda/features/model_generator.feature
  94. +0 −185 vendor/plugins/coulda/features/step_definitions/controller_steps.rb
  95. +0 −16 vendor/plugins/coulda/features/step_definitions/generator_steps.rb
  96. +0 −14 vendor/plugins/coulda/features/step_definitions/helper_steps.rb
  97. +0 −14 vendor/plugins/coulda/features/step_definitions/migration_steps.rb
  98. +0 −122 vendor/plugins/coulda/features/step_definitions/model_steps.rb
  99. +0 −4 vendor/plugins/coulda/features/step_definitions/view_steps.rb
  100. +0 −99 vendor/plugins/coulda/features/support/env.rb
  101. +0 −23 vendor/plugins/coulda/generators/controller/controller_generator.rb
  102. +0 −56 vendor/plugins/coulda/generators/controller/templates/controller.rb
  103. +0 −92 vendor/plugins/coulda/generators/controller/templates/functional_test.rb
  104. +0 −23 vendor/plugins/coulda/generators/helper/helper_generator.rb
  105. +0 −2 vendor/plugins/coulda/generators/helper/templates/helper.rb
  106. +0 −4 vendor/plugins/coulda/generators/helper/templates/helper_test.rb
  107. +0 −79 vendor/plugins/coulda/generators/model/model_generator.rb
  108. +0 −5 vendor/plugins/coulda/generators/model/templates/factory.rb
  109. +0 −30 vendor/plugins/coulda/generators/model/templates/migration.rb
  110. +0 −8 vendor/plugins/coulda/generators/model/templates/model.rb
  111. +0 −16 vendor/plugins/coulda/generators/model/templates/unit_test.rb
  112. +0 −6 vendor/plugins/coulda/generators/view/templates/view_new.html.erb
  113. +0 −14 vendor/plugins/coulda/generators/view/view_generator.rb
  114. +0 −20 vendor/plugins/delayed_job/MIT-LICENSE
  115. +0 −107 vendor/plugins/delayed_job/README.textile
  116. +0 −22 vendor/plugins/delayed_job/Rakefile
  117. +0 −1 vendor/plugins/delayed_job/VERSION
  118. +0 −61 vendor/plugins/delayed_job/delayed_job.gemspec
  119. +0 −11 vendor/plugins/delayed_job/generators/delayed_job/delayed_job_generator.rb
  120. +0 −20 vendor/plugins/delayed_job/generators/delayed_job/templates/migration.rb
  121. +0 −7 vendor/plugins/delayed_job/generators/delayed_job/templates/script
  122. +0 −1 vendor/plugins/delayed_job/init.rb
  123. +0 −65 vendor/plugins/delayed_job/lib/delayed/command.rb
  124. +0 −271 vendor/plugins/delayed_job/lib/delayed/job.rb
  125. +0 −17 vendor/plugins/delayed_job/lib/delayed/message_sending.rb
  126. +0 −55 vendor/plugins/delayed_job/lib/delayed/performable_method.rb
  127. +0 −54 vendor/plugins/delayed_job/lib/delayed/worker.rb
  128. +0 −13 vendor/plugins/delayed_job/lib/delayed_job.rb
  129. +0 −26 vendor/plugins/delayed_job/recipes/delayed_job.rb
  130. +0 −42 vendor/plugins/delayed_job/spec/database.rb
  131. +0 −128 vendor/plugins/delayed_job/spec/delayed_method_spec.rb
  132. +0 −389 vendor/plugins/delayed_job/spec/job_spec.rb
  133. +0 −17 vendor/plugins/delayed_job/spec/story_spec.rb
  134. +0 −1 vendor/plugins/delayed_job/tasks/jobs.rake
  135. +0 −15 vendor/plugins/delayed_job/tasks/tasks.rb
  136. +0 −75 vendor/plugins/high_voltage/README.markdown
  137. +0 −26 vendor/plugins/high_voltage/app/controllers/high_voltage/pages_controller.rb
  138. +0 −5 vendor/plugins/high_voltage/config/high_voltage_routes.rb
  139. +0 −2 vendor/plugins/high_voltage/init.rb
  140. +0 −1 vendor/plugins/high_voltage/install.rb
  141. +0 −5 vendor/plugins/high_voltage/lib/high_voltage.rb
  142. +0 −15 vendor/plugins/high_voltage/lib/high_voltage/extensions/routes.rb
  143. +0 −4 vendor/plugins/high_voltage/tasks/nothing_to_see_here_move_along_tasks.rake
  144. +0 −44 vendor/plugins/high_voltage/test/pages_controller_test.rb
  145. +0 −14 vendor/plugins/high_voltage/test/test_helper.rb
  146. +0 −43 vendor/plugins/jrails/CHANGELOG
  147. +0 −18 vendor/plugins/jrails/LICENSE
  148. +0 −21 vendor/plugins/jrails/README.rdoc
  149. +0 −18 vendor/plugins/jrails/Rakefile
  150. +0 −4 vendor/plugins/jrails/VERSION.yml
  151. +0 −30 vendor/plugins/jrails/bin/jrails
  152. +0 −1 vendor/plugins/jrails/init.rb
  153. +0 −9 vendor/plugins/jrails/install.rb
  154. +0 −188 vendor/plugins/jrails/javascripts/jquery-ui.js
  155. +0 −19 vendor/plugins/jrails/javascripts/jquery.js
  156. +0 −1 vendor/plugins/jrails/javascripts/jrails.js
  157. +0 −197 vendor/plugins/jrails/javascripts/sources/jrails.js
  158. +0 −50 vendor/plugins/jrails/jrails.gemspec
  159. +0 −421 vendor/plugins/jrails/lib/jrails.rb
  160. +0 −15 vendor/plugins/jrails/rails/init.rb
  161. +0 −25 vendor/plugins/jrails/tasks/jrails.rake
  162. +0 −20 vendor/plugins/limerick_rake/MIT-LICENSE
  163. +0 −140 vendor/plugins/limerick_rake/README.textile
  164. +0 −2 vendor/plugins/limerick_rake/Rakefile
  165. +0 −91 vendor/plugins/limerick_rake/lib/find_mass_assignment.rb
  166. +0 −20 vendor/plugins/limerick_rake/limerick_rake.gemspec
  167. +0 −39 vendor/plugins/limerick_rake/tasks/backup.rake
  168. +0 −14 vendor/plugins/limerick_rake/tasks/coverage.rake
  169. +0 −15 vendor/plugins/limerick_rake/tasks/db/bootstrap.rake
  170. +0 −22 vendor/plugins/limerick_rake/tasks/db/indexes.rake
  171. +0 −23 vendor/plugins/limerick_rake/tasks/db/shell.rake
  172. +0 −27 vendor/plugins/limerick_rake/tasks/db/validate_models.rake
  173. +0 −5 vendor/plugins/limerick_rake/tasks/find_mass_assignment_tasks.rake
  174. +0 −109 vendor/plugins/limerick_rake/tasks/git.rake
  175. +0 −78 vendor/plugins/limerick_rake/tasks/haml_sass.rake
  176. +0 −20 vendor/plugins/limerick_rake/tasks/rails_two.rake
  177. +0 −21 vendor/plugins/limerick_rake/tasks/svn.rake
  178. +1 −1 vendor/plugins/{high_voltage → rails_upgrade}/MIT-LICENSE
  179. +20 −0 vendor/plugins/rails_upgrade/README
  180. +4 −5 vendor/plugins/{high_voltage → rails_upgrade}/Rakefile
  181. +2 −0 vendor/plugins/rails_upgrade/init.rb
  182. +38 −0 vendor/plugins/rails_upgrade/install.rb
  183. +433 −0 vendor/plugins/rails_upgrade/lib/application_checker.rb
  184. +95 −0 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  185. +51 −0 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  186. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  187. +349 −0 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  188. +78 −0 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  189. +264 −0 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  190. +72 −0 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  191. +63 −0 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  192. +142 −0 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  193. +5 −0 vendor/plugins/rails_upgrade/test/test_helper.rb
  194. 0 vendor/plugins/{high_voltage → rails_upgrade}/uninstall.rb
  195. +0 −20 vendor/plugins/wheres-your-database-yml-dude/README.markdown
  196. +0 −15 vendor/plugins/wheres-your-database-yml-dude/tasks/wheres-your-database-yml-dude.rake
View
31 Gemfile
@@ -1,13 +1,15 @@
source :rubygems
-gem "rails", "2.3.5"
-gem "rack", "1.0.1"
+gem "rails", "3.0.0.beta4"
+gem "rack", "1.1.0"
gem "aws-s3", "0.6.2", :require => "aws/s3"
-gem "clearance", "0.8.2"
+gem "clearance", "0.9.0.rc1"
gem "ddollar-pacecar", "1.1.6", :require => "pacecar"
+gem "delayed_job", "2.0.3"
gem "gchartrb", "0.8", :require => "google_chart"
gem "gravtastic", "2.1.3"
+gem "high_voltage", "0.9.0"
gem "hoptoad_notifier", "2.2.0"
gem "json", "1.2.0"
gem "rack-maintenance", "0.3.0", :require => "rack/maintenance"
@@ -22,15 +24,16 @@ gem "pg", "0.8.0"
# gem "mysql", "2.8.1"
group :test do
- gem "cucumber", "0.3.101"
- gem "factory_girl", "1.2.3"
- gem "fakeweb", "1.2.6"
- gem "nokogiri", "1.4.1"
- gem "rack-test", "0.5.0", :require => "rack/test"
- gem "redgreen", "1.2.2"
- gem "rr", "0.10.11"
- gem "shoulda", "2.10.2"
- gem "treetop", "1.4.3"
- gem "webrat", "0.5.3"
- gem "webmock", "0.7.3"
+ gem "cucumber-rails", "0.3.2"
+ gem "factory_girl_rails", "1.0"
+
+ gem "fakeweb", "1.2.6"
+ gem "nokogiri", "1.4.1"
+ gem "rack-test", "0.5.4", :require => "rack/test"
+ gem "redgreen", "1.2.2"
+ gem "rr", "0.10.11"
+ gem "shoulda", "2.11.0"
+ gem "treetop", "1.4.5"
+ gem "webrat", "0.5.3"
+ gem "webmock", "0.7.3"
end
View
8 Rakefile
@@ -1,10 +1,6 @@
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+require File.expand_path('../config/application', __FILE__)
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
+Rails::Application.load_tasks
desc "Run all tests and features"
task :default => [:test, :cucumber]
View
2 app/controllers/api/v1/rubygems_controller.rb
@@ -19,7 +19,7 @@ def show
end
def create
- gemcutter = Gemcutter.new(current_user, request.body, request.host_with_port)
+ gemcutter = Pusher.new(current_user, request.body, request.host_with_port)
gemcutter.process
render :text => gemcutter.message, :status => gemcutter.code
end
View
3 app/helpers/rubygems_helper.rb
@@ -41,6 +41,7 @@ def clippy(text, bgcolor='#AADD44')
/>
</object>
EOF
+ html.html_safe
end
def subscribe_link(gem)
@@ -70,7 +71,7 @@ def unsubscribe_link(gem)
:style => gem.subscribers.find_by_id(current_user.try(:id)) ? 'display:inline-block' : 'display:none'
}) if signed_in?
end
-
+
def download_link(version)
link_to "Download", "/downloads/#{version.full_name}.gem", :id => :download
end
View
4 app/models/dependency.rb
@@ -8,8 +8,8 @@ class Dependency < ActiveRecord::Base
validates_presence_of :requirements
validates_inclusion_of :scope, :in => %w( development runtime )
- named_scope :development, { :conditions => { :scope => 'development' }}
- named_scope :runtime, { :conditions => { :scope => 'runtime' }}
+ scope :development, { :conditions => { :scope => 'development' }}
+ scope :runtime, { :conditions => { :scope => 'runtime' }}
attr_accessor :gem_dependency
View
2 lib/gemcutter.rb → app/models/pusher.rb
@@ -1,4 +1,4 @@
-class Gemcutter
+class Pusher
if Rails.env.development? || Rails.env.test?
include Vault::FS
else
View
8 app/models/rubygem.rb
@@ -18,21 +18,21 @@ def latest
validates_presence_of :name
validates_uniqueness_of :name
- named_scope :with_versions,
+ scope :with_versions,
:conditions => "rubygems.id IN (SELECT rubygem_id FROM versions where versions.indexed IS true)"
- named_scope :with_one_version,
+ scope :with_one_version,
:select => 'rubygems.*',
:joins => :versions,
:group => column_names.map{ |name| "rubygems.#{name}" }.join(', '),
:having => 'COUNT(versions.id) = 1'
- named_scope :name_is, lambda { |name| {
+ scope :name_is, lambda { |name| {
:conditions => ["name = ?", name.strip],
:limit => 1 }
}
- named_scope :search, lambda { |query| {
+ scope :search, lambda { |query| {
:conditions => ["(upper(name) like upper(:query) or upper(versions.description) like upper(:query))",
{:query => "%#{query.strip}%"}],
:include => [:versions],
View
16 app/models/version.rb
@@ -8,25 +8,25 @@ class Version < ActiveRecord::Base
validates_format_of :number, :with => /\A#{Gem::Version::VERSION_PATTERN}\z/
- named_scope :owned_by, lambda { |user|
+ scope :owned_by, lambda { |user|
{ :conditions => { :rubygem_id => user.rubygem_ids } }
}
- named_scope :subscribed_to_by, lambda { |user|
+ scope :subscribed_to_by, lambda { |user|
{ :conditions => { :rubygem_id => user.subscribed_gem_ids },
:order => 'created_at desc' }
}
- named_scope :with_associated, {
+ scope :with_associated, {
:conditions => ["versions.rubygem_id IN (SELECT versions.rubygem_id FROM versions GROUP BY versions.rubygem_id HAVING COUNT(versions.id) > 1)"],
:include => :rubygem,
:order => "versions.built_at desc"
}
- named_scope :latest, { :conditions => { :latest => true }}
- named_scope :with_deps, { :include => { :dependencies => :rubygem }}
- named_scope :prerelease, { :conditions => { :prerelease => true }}
- named_scope :release, { :conditions => { :prerelease => false }}
+ scope :latest, { :conditions => { :latest => true }}
+ scope :with_deps, { :include => { :dependencies => :rubygem }}
+ scope :prerelease, { :conditions => { :prerelease => true }}
+ scope :release, { :conditions => { :prerelease => false }}
before_save :update_prerelease
after_save :reorder_versions
@@ -71,7 +71,7 @@ def self.find_from_slug!(rubygem_id, slug)
end
def self.platforms
- find(:all, :select => 'platform').map(&:platform).uniq
+ select('platform').map(&:platform).uniq
end
def platformed?
View
4 app/models/web_hook.rb
@@ -2,8 +2,8 @@ class WebHook < ActiveRecord::Base
belongs_to :user
belongs_to :rubygem
- named_scope :global, :conditions => {:rubygem_id => nil}
- named_scope :specific, :conditions => "rubygem_id is not null"
+ scope :global, :conditions => {:rubygem_id => nil}
+ scope :specific, :conditions => "rubygem_id is not null"
GLOBAL_PATTERN = '*'
View
60 app/views/layouts/application.html.erb
@@ -5,57 +5,53 @@
<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="<%=t :title %>" href="/opensearch.xml">
- <%= stylesheet_link_tag "reset", "960", "screen", :cache => true %>
+ <%= stylesheet_link_tag "reset", "960", "screen", "humanmsg", :cache => true %>
<!--[if IE 7]>
<%= stylesheet_link_tag "ie7" %>
<![endif]-->
<%= render "layouts/feeds" %>
<title><%= page_title %></title>
</head>
<body>
+ <% flash.each do |name, msg| %>
+ <div id="flash_<%= name %>"><%= msg %></div>
+ <% end %>
<div class="container_12">
<div class="prefix_1 grid_4 header">
<h1><%= link_to t(:title), root_url, :title => "Home" %></h1>
</div>
<div class="grid_6 suffix_1 nav">
- <div id="nav-cap">
- <div id="nav">
- <% if signed_in? %>
- <div id="user-info">
- <a href="<%= edit_profile_path %>">
- <%= image_tag(current_user.gravatar_url(:size => 32), :id => "user_gravatar") %>
- <span><%= truncate(current_user.name) %></span>
- </a>
- </div>
- <ul id="signed_in">
- <li id="all-gems"><%= link_to "all gems", rubygems_url %></li>
- <li id="dashboard"><%= link_to "dashboard", dashboard_url %></li>
- <li id="sign-out"><%= link_to "sign out", sign_out_path %></li>
- </ul>
- <% else %>
- <ul id="signed_out">
- <li id="all-gems"><%= link_to "all gems", rubygems_url %></li>
- <li id="sign-in"><%= link_to "sign in", sign_in_path %></li>
- <li id="sign-up"><%= link_to "sign up", sign_up_path %></li>
- </ul>
- <% end %>
+ <% if signed_in? %>
+ <a href="<%= profile_url%>">
+ <%= image_tag(current_user.gravatar_url(:size => 24), :id => "user_gravatar") %>
+ <span><%= truncate(current_user.name) %></span>
+ </a>
+ <ul>
+ <li><%= link_to "all gems", rubygems_url %></li>
+ <li><%= link_to "dashboard", dashboard_url %></li>
+ <li><%= link_to "logout", sign_out_path %></li>
+ </ul>
+ <% else %>
+ <ul id="signed_out">
+ <li><%= link_to "all gems", rubygems_url %></li>
+ <li><%= link_to "sign in", sign_in_path %></li>
+ <li><%= link_to "sign up", sign_up_path %></li>
+ </ul>
+ <% end %>
+ <%= form_tag search_url, :method => :get do %>
+ <div class="text_field">
+ <%= text_field_tag :query, params[:query] ? h(params[:query]) : "Search gems&hellip;" %>
</div>
- </div>
- <% form_tag search_url, :id => "main-search", :method => :get do %>
- <%= text_field_tag :query, params[:query] ? h(params[:query]) : "Search gems&hellip;" %>
<%= submit_tag 'Search', :id => 'search_submit', :name => nil %>
<% end %>
</div>
<div class="prefix_1 grid_10 suffix_1 main">
- <% flash.each do |name, msg| %>
- <div id="flash_<%= name %>"><%= msg %></div>
- <% end %>
<% if content_for?(:fold) %>
<div class="fold">
<%= yield :fold %>
</div>
<% end %>
- <div class="info clearfix">
+ <div class="info">
<div class="title">
<% if @title %>
<h2><%= link_to @title, "" %></h2>
@@ -77,12 +73,12 @@
<%= link_to "Code", "http://github.com/rubygems/gemcutter" %>
<%= link_to "Discuss", "http://groups.google.com/group/gemcutter" %>
<%= link_to "Stats", statistics_url %>
- <%= link_to "designed by #{image_tag('thoughtbot.png')}", "http://thoughtbot.com", :title => "Designed by Thoughtbot", :id => "thoughtbot" %>
- <%= link_to "supported by #{image_tag('rubycentral.png')}", "http://rubycentral.org", :title => "Supported by Ruby Central", :id => "rubycentral" %>
+ <%= link_to "designed by #{image_tag('thoughtbot.png')}".html_safe, "http://thoughtbot.com", :title => "Designed by Thoughtbot", :id => "thoughtbot" %>
+ <%= link_to "supported by #{image_tag('rubycentral.png')}".html_safe, "http://rubycentral.org", :title => "Supported by Ruby Central", :id => "rubycentral" %>
</div>
</div>
</div>
- <%= javascript_include_tag "jquery", "jquery.easing.1.3", "application", :cache => true %>
+ <%= javascript_include_tag "jquery", "jquery.easing.1.3", "humanmsg", "application", :cache => true %>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
View
2 app/views/rubygems/index.html.erb
@@ -6,7 +6,7 @@
</ol>
</div>
<p class="entries">
- <%= page_entries_info @gems, :entry_name => 'gem' %>
+ <%= page_entries_info(@gems, :entry_name => 'gem').html_safe %>
</p>
<div class="gems border">
<ol>
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Gemcutter::Application
View
15 config/application.rb
@@ -0,0 +1,15 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Gemcutter
+ class Application < Rails::Application
+ config.time_zone = 'UTC'
+ config.action_mailer.delivery_method = :sendmail
+ config.load_paths << Rails.root.join('app', 'middleware')
+ config.encoding = "utf-8"
+ config.filter_parameters += [:password]
+ end
+end
View
141 config/boot.rb
@@ -1,128 +1,13 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-# Massive loadpath hack to make sure the rubygems in lib/ gets loaded
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.3.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# for bundler
-class Rails::Boot
- def run
- load_initializer
-
- Rails::Initializer.class_eval do
- def load_gems
- @bundler_loaded ||= Bundler.require :default, Rails.env
- end
- end
-
- Rails::Initializer.run(:set_load_path)
- end
-end
-
-# All that for this:
-Rails.boot!
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
View
15 config/environment.rb
@@ -1,12 +1,5 @@
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
+# Load the rails application
+require File.expand_path('../application', __FILE__)
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- config.time_zone = 'UTC'
- config.action_mailer.delivery_method = :sendmail
- config.frameworks -= [:active_resource]
- config.load_paths << Rails.root.join('app', 'middleware')
-end
-
-$redis = Redis.new
+# Initialize the rails application
+Gemcutter::Application.initialize!
View
14 config/environments/development.rb
@@ -1,10 +1,12 @@
-config.cache_classes = false
-config.whiny_nils = true
+Gemcutter::Application.configure do
+ config.cache_classes = false
+ config.whiny_nils = true
-config.action_controller.consider_all_requests_local = true
-config.action_view.debug_rjs = true
-config.action_controller.perform_caching = false
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
-config.action_mailer.raise_delivery_errors = false
+ config.action_mailer.raise_delivery_errors = false
+end
HOST = "localhost"
View
24 config/environments/maintenance.rb
@@ -1,14 +1,16 @@
-require Rails.root.join("config", "secret") if Rails.root.join("config", "secret.rb").file?
+Gemcutter::Application.configure do
+ config.frameworks -= [:active_record]
-HOST = "rubygems.org"
+ config.middleware.use ::Rack::Static,
+ :urls => ["/index.html",
+ "/favicon.ico",
+ "/images",
+ "/stylesheets"],
+ :root => "public/maintenance"
+ config.middleware.use ::Rack::Maintenance,
+ :file => File.join('public', 'maintenance', 'index.html')
+end
-config.frameworks -= [:active_record]
+require Rails.root.join("config", "secret") if Rails.root.join("config", "secret.rb").file?
-config.middleware.use ::Rack::Static,
- :urls => ["/index.html",
- "/favicon.ico",
- "/images",
- "/stylesheets"],
- :root => "public/maintenance"
-config.middleware.use ::Rack::Maintenance,
- :file => File.join('public', 'maintenance', 'index.html')
+HOST = "rubygems.org"
View
16 config/environments/production.rb
@@ -1,11 +1,13 @@
-config.cache_classes = true
-
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
+Gemcutter::Application.configure do
+ config.cache_classes = true
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
+ config.serve_static_assets = false
+ config.i18n.fallbacks = true
+ config.middleware.insert_after 'ActionController::ParamsParser', 'Redirector'
+end
require Rails.root.join("config", "secret") if Rails.root.join("config", "secret.rb").file?
HOST = "rubygems.org"
-
-config.middleware.insert_after 'ActionController::ParamsParser', 'Redirector'
View
17 config/environments/staging.rb
@@ -1,12 +1,13 @@
-config.cache_classes = true
-config.log_level = :info
-
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
+Gemcutter::Application.configure do
+ config.cache_classes = true
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
+ config.serve_static_assets = false
+ config.i18n.fallbacks = true
+ config.middleware.insert_after 'ActionController::ParamsParser', 'Redirector'
+end
require Rails.root.join("config", "secret") if Rails.root.join("config", "secret.rb").file?
HOST = "staging.rubygems.org"
-
-config.middleware.insert_after 'ActionController::ParamsParser', 'Redirector'
View
16 config/environments/test.rb
@@ -1,11 +1,13 @@
-config.cache_classes = true
-config.whiny_nils = true
+Gemcutter::Application.configure do
+ config.cache_classes = true
+ config.whiny_nils = true
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.cache_template_loading = true
-config.action_controller.allow_forgery_protection = false
-config.action_mailer.delivery_method = :test
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+ config.action_dispatch.show_exceptions = false
+ config.action_controller.allow_forgery_protection = false
+ config.action_mailer.delivery_method = :test
+end
HOST = 'www.example.com'
ENV['S3_KEY'] = 'this:is:an:ex:parrot'
View
12 config/initializers/new_rails_defaults.rb
@@ -1,12 +0,0 @@
-# DON'T Include Active Record class name as root for JSON serialized output.
-ActiveRecord::Base.include_root_in_json = false
-
-# Store the full class name (including module namespace) in STI type column.
-ActiveRecord::Base.store_full_sti_class = true
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
1 config/initializers/redis.rb
@@ -0,0 +1 @@
+$redis = Redis.new
View
7 config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Rails.application.config.secret_token = '53336f5ffda880aa2f6d5fbb7603b6df4d975408afbf44642d342547c25f92265eb01c34b118ee7fa87475f69949b07b292d95276aae2f6bda029ea25d28dc28'
View
16 config/initializers/session_store.rb
@@ -1,15 +1,13 @@
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rake db:sessions:create")
+# ActionController::Base.session_store = :active_record_store
+
# Be sure to restart your server when you modify this file.
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-ActionController::Base.session = {
- :key => '_test_session',
- :secret => '53336f5ffda880aa2f6d5fbb7603b6df4d975408afbf44642d342547c25f92265eb01c34b118ee7fa87475f69949b07b292d95276aae2f6bda029ea25d28dc28'
-}
+Rails.application.config.session_store :cookie_store, :key => '_test_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
+# Rails.application.config.session_store :active_record_store
View
20 config/preinitializer.rb
@@ -1,20 +0,0 @@
-begin
- require "rubygems"
- require "bundler"
-rescue LoadError
- raise "Could not load the bundler gem. Install it with `gem install bundler`."
-end
-
-if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
- raise RuntimeError, "Your bundler version is too old." +
- "Run `gem install bundler` to upgrade."
-end
-
-begin
- # Set up load paths for all bundled gems
- ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
- Bundler.setup
-rescue Bundler::GemNotFound
- raise RuntimeError, "Bundler couldn't find some gems." +
- "Did you run `bundle install`?"
-end
View
2 config/routes.rb
@@ -1,6 +1,6 @@
RUBYGEM_NAME_MATCHER = /[A-Za-z0-9\-\_\.]+/
-ActionController::Routing::Routes.draw do |map|
+Gemcutter::Application.routes.draw do |map|
################################################################################
# API v1
View
4 script/about
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
-require 'commands/about'
View
3 script/console
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/console'
View
9 script/cucumber
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-begin
- load File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/cucumber/bin/cucumber")
-rescue LoadError => e
- raise unless e.to_s =~ /cucumber/
- require 'rubygems'
- require 'cucumber'
- load Cucumber::BINARY
-end
View
3 script/dbconsole
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/dbconsole'
View
3 script/destroy
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/destroy'
View
3 script/generate
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/generate'
View
3 script/performance/benchmarker
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/benchmarker'
View
3 script/performance/profiler
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/profiler'
View
3 script/plugin
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/plugin'
View
6 script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
View
28 script/rfownerships2gc
@@ -1,28 +0,0 @@
-#!/usr/bin/env ruby
-# Create Gemcutter ownerships from YAML file of RubyForge ownerships
-#
-# Run this from inside a live production-environment application
-# directory on Gemcutter.
-
-require 'yaml'
-require 'config/environment'
-
-ownerships = YAML.load_file("ownerships.yml")
-
-ownerships.each do |gemname,rf_owners|
- rubygem = Rubygem.find_by_name(gemname)
-
- if rubygem.nil?
- puts "Couldn't find #{gemname}!"
- next
- end
-
- gc_owners = rubygem.owners
-
- diff = rf_owners - gc_owners
-
- diff.each do |email|
- gc_user = User.find_by_email(email)
- Ownership.create(:rubygem => rubygem, :user => gc_user, :approved => true)
- end
-end
View
106 script/rfusers2gc
@@ -1,106 +0,0 @@
-#!/usr/bin/env ruby
-# rf2gc.rb -- defines the RF2GC module
-#
-# To use, run the file via runner or console, and
-# add/give the command:
-#
-# RF2GC.transfer_records
-#
-# transfer_records expects a file called rfdata.txt, containing lines
-# like this:
-#
-# dblack@blah.com|asofasoinaosdfiansdofiansdelgoid|handle
-#
-# i.e., email address and 32-char MD5 password, separated by a pipe.
-#
-# Given such a file, it will go line by line and:
-#
-# * look for an existing Rubyforger or Gemcutter
-# with that email, and skip if found
-# * create a new Rubyforger record
-# * create a new Gemcutter record with a random password
-# * back out of both creations if either fails
-#
-# It logs progressively to rf2gclog.txt.
-#
-# Comment lines (#-based) and blank lines are permitted in the
-# input file.
-
-module RF2GC
-
- RFFILE = "rf2gcdata.txt"
- LOGFILE = File.join("log", "rf2gclog.txt")
-
- EMAIL_RE = /[^@|]+@[^@.|]+(\.\w+)+/
- PW_RE = /\w{32}/
- HANDLE_RE = /\w+/
- RECORD_RE = /\A#{EMAIL_RE}\|#{PW_RE}|#{HANDLE_RE}\Z/
- IGNORE_RE = /^\s*(#.*?)?\Z/
-
- def self.transfer_records
- @log = File.open(LOGFILE, "a")
-
- File.open(RFFILE) do |fh|
- fh.each_with_index do |record,i|
-
- next if ignore?(record)
-
- unless well_formed?(record)
- log("Bad record at line #{i}")
- next
- end
-
- record.chomp!
- email, password, handle = record.split('|')
-
- rfer = Rubyforger.find_by_email(email)
- gcer = User.find_by_email(email)
-
- if rfer
- log("Rubyforger exists: #{rfer.email}")
- next
- elsif gcer
- log("Gemcutter account exists: #{gcer.email}, setting handle to: #{handle}")
- gcer.update_attribute(:handle, handle)
- next
- end
-
- rfer = Rubyforger.new(:email => email, :encrypted_password => password)
- unless rfer.save
- log("Couldn't save Rubyforger: #{rfer.email}")
- next
- end
-
- user = User.new
- user.email = email
- user.password = ActiveSupport::SecureRandom.hex(16)
- user.handle = handle
- user.email_confirmed = true
-
- unless user.save
- log("Couldn't save user: #{user.email} --- #{user.errors.full_messages.join(' ')}")
- Rubyforger.delete(rfer.id)
- next
- end
-
- log("Created Rubyforger/User: #{email}/#{handle}")
- end
- end
- @log.close
- end
-
- def self.well_formed?(record)
- record =~ RECORD_RE
- end
-
- def self.ignore?(record)
- record =~ IGNORE_RE
- end
-
- def self.log(msg)
- puts msg
- end
-end
-
-require 'config/environment'
-RF2GC.transfer_records
View
3 script/runner
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/runner'
View
3 script/server
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/server'
View
2 test/test_helper.rb
@@ -1,6 +1,6 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
-require 'test_help'
+require 'rails/test_help'
set :environment, :test
WebMock.disable_net_connect!
View
10 test/unit/gemcutter_test.rb → test/unit/pusher_test.rb
@@ -1,25 +1,25 @@
require File.dirname(__FILE__) + '/../test_helper'
-class GemcutterTest < ActiveSupport::TestCase
+class PusherTest < ActiveSupport::TestCase
context "getting the server path" do
should "return just the root server path with no args" do
- assert_equal "#{Rails.root}/server", Gemcutter.server_path
+ assert_equal "#{Rails.root}/server", Pusher.server_path
end
should "return a directory inside if one argument is given" do
- assert_equal "#{Rails.root}/server/gems", Gemcutter.server_path("gems")
+ assert_equal "#{Rails.root}/server/gems", Pusher.server_path("gems")
end
should "return a directory inside if more than one argument is given" do
- assert_equal "#{Rails.root}/server/quick/Marshal.4.8", Gemcutter.server_path("quick", "Marshal.4.8")
+ assert_equal "#{Rails.root}/server/quick/Marshal.4.8", Pusher.server_path("quick", "Marshal.4.8")
end
end
context "creating a new gemcutter" do
setup do
@user = Factory(:email_confirmed_user)
@gem = gem_file
- @cutter = Gemcutter.new(@user, @gem)
+ @cutter = Pusher.new(@user, @gem)
end
should "have some state" do
View
BIN vendor/cache/abstract-1.0.0.gem
Binary file not shown.
View
BIN vendor/cache/actionmailer-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/actionmailer-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/actionpack-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/actionpack-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/activemodel-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/activerecord-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/activerecord-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/activeresource-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/activeresource-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/activesupport-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/activesupport-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/arel-0.4.0.gem
Binary file not shown.
View
BIN vendor/cache/bundler-0.9.26.gem
Binary file not shown.
View
BIN vendor/cache/clearance-0.8.2.gem
Binary file not shown.
View
BIN vendor/cache/clearance-0.9.0.rc1.gem
Binary file not shown.
View
BIN vendor/cache/cucumber-0.3.101.gem
Binary file not shown.
View
BIN vendor/cache/cucumber-0.8.0.gem
Binary file not shown.
View
BIN vendor/cache/cucumber-rails-0.3.2.gem
Binary file not shown.
View
BIN vendor/cache/daemons-1.0.10.gem
Binary file not shown.
View
BIN vendor/cache/delayed_job-2.0.3.gem
Binary file not shown.
View
BIN vendor/cache/erubis-2.6.5.gem
Binary file not shown.
View
BIN vendor/cache/factory_girl-1.2.3.gem
Binary file not shown.
View
BIN vendor/cache/factory_girl-1.3.0.gem
Binary file not shown.
View
BIN vendor/cache/factory_girl_rails-1.0.gem
Binary file not shown.
View
BIN vendor/cache/gherkin-1.0.30.gem
Binary file not shown.
View
BIN vendor/cache/high_voltage-0.9.0.gem
Binary file not shown.
View
BIN vendor/cache/i18n-0.4.1.gem
Binary file not shown.
View
BIN vendor/cache/json_pure-1.4.3.gem
Binary file not shown.
View
BIN vendor/cache/mail-2.2.4.gem
Binary file not shown.
View
BIN vendor/cache/rack-1.0.1.gem
Binary file not shown.
View
BIN vendor/cache/rack-1.1.0.gem
Binary file not shown.
View
BIN vendor/cache/rack-mount-0.6.4.gem
Binary file not shown.
View
BIN vendor/cache/rack-test-0.5.0.gem
Binary file not shown.
View
BIN vendor/cache/rack-test-0.5.4.gem
Binary file not shown.
View
BIN vendor/cache/rails-2.3.5.gem
Binary file not shown.
View
BIN vendor/cache/rails-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/railties-3.0.0.beta4.gem
Binary file not shown.
View
BIN vendor/cache/shoulda-2.10.2.gem
Binary file not shown.
View
BIN vendor/cache/shoulda-2.11.0.gem
Binary file not shown.
View
BIN vendor/cache/thor-0.13.6.gem
Binary file not shown.
View
BIN vendor/cache/treetop-1.4.3.gem
Binary file not shown.
View
BIN vendor/cache/treetop-1.4.5.gem
Binary file not shown.
View
BIN vendor/cache/trollop-1.16.2.gem
Binary file not shown.
View
BIN vendor/cache/tzinfo-0.3.22.gem
Binary file not shown.
View
9 vendor/plugins/coulda/CHANGELOG.textile
@@ -1,9 +0,0 @@
-h1. March 8, 2009
-
-* Updated functional tests to use shoulda 2.10 should_redirect_to block syntax
-
-h1. March 7, 2009
-
-* Added Paperclip option to model generator
-* Removed comments on model per complaints by thoughtbot
-
View
145 vendor/plugins/coulda/README.textile
@@ -1,145 +0,0 @@
-h1. Coulda generators
-
-A plugin that overrides Rails' model, controller, & helper generators. It also adds a view generator. It uses Shoulda & Factory Girl for tests.
-
-h2. Requirements
-
-* "Shoulda":http://github.com/thoughtbot/shoulda
-* "Factory Girl":http://github.com/thoughtbot/factory_girl
-
-h2. Installation
-
- $ script/plugin install git://github.com/dancroak/coulda.git
-
-h2. Model generator
-
- $ script/generate model User
-
-* factory (Factory Girl)
-* unit test (Shoulda)
-* migration
-* model
-
-h2. Controller generator
-
- $ script/generate controller Users new
-
-* functional test (Shoulda & Factory Girl), only test RESTful new action
-* controller, only RESTful new action
-* no helper file
-
-h2. Helper generator
-
- $ script/generate helper Navigation
-
-* empty helper test file
-* empty helper module
-
-h2. View generator
-
- $ script/generate view Posts new
-
-* We're not sure we like this one yet. Let us know what you think.
-
-h2. Model generator: belongs_to
-
- $ script/generate model post user:belongs_to
-
-* "add_index" in the migration
-* "belongs_to" in the model
-* "should_belong_to" in unit test
-* association in the factory
-
-<pre><code>class CreatePosts < ActiveRecord::Migration
- def self.up
- create_table :posts do |t|
- t.belongs_to :user
- t.timestamps
- end
-
- add_index :posts, :user_id
- end
-
- def self.down
- remove_index :posts, :user_id
- drop_table :posts
- end
-end
-
-class Post < ActiveRecord::Base
- belongs_to :user
-end
-
-class PostTest < ActiveSupport::TestCase
- should_belong_to :user
- should_have_index :user_id
-end
-
-Factory.define :post do |post|
- post.association(:user)
-end</code></pre>
-
-h2. Model generator: paperclip
-
- $ script/generate model design image:paperclip
-
-* all the necessary columns in the migration
-* "has_attached_file" in the model
-* "should_have_attached_file" in unit test
-
-<pre><code>class CreateDesigns < ActiveRecord::Migration
- def self.up
- create_table :designs do |t|
- t.string :image_file_name
- t.string :image_content_type
- t.integer :image_file_size
- t.datetime :image_updated_at
- t.timestamps
- end
- end
-
- def self.down
- drop_table :designs
- end
-end
-
-class Design < ActiveRecord::Base
- has_attached_file :image
-end
-
-class DesignTest < ActiveSupport::TestCase
- should "be valid with factory" do
- assert_valid Factory.build(:design)
- end
- should_have_attached_file :image
-end</code></pre>
-
-h2. Attribution
-
-"Mike Breen":http://github.com/hardbap and "Dan Croak":http://github.com/dancroak
-
-Inspired by "shoulda_generator":http://github.com/technicalpickles/shoulda_generator, "model_generator_with_factories":http://github.com/vigetlabs/model_generator_with_factories, and "nifty_generators":http://github.com/ryanb/nifty-generators
-
-h2. License
-
-The MIT License
-
-Copyright (c) 2008, 2009 Mike Breen
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
4 vendor/plugins/coulda/TODO.textile
@@ -1,4 +0,0 @@
-h1. To-do
-
-* Replace should_assign_to / :equals with a legitimate test.
-
View
54 vendor/plugins/coulda/features/controller_generator.feature
@@ -1,54 +0,0 @@
-Feature: Rails controller generator
- In order to better do Test-Driven Development with Rails
- As a user
- I want to generate Shoulda & Factory Girl tests for only RESTful action I need.
-
- Scenario: Controller generator for index action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "index" action
- Then a standard "index" functional test for "posts" should be generated
- And an empty "index" controller action for "posts" should be generated
-
- Scenario: Controller generator for new action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "new" action
- Then a standard "new" functional test for "posts" should be generated
- And a "new" controller action for "posts" should be generated
-
- Scenario: Controller generator for create action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "create" action
- Then a standard "create" functional test for "posts" should be generated
- And a "create" controller action for "posts" should be generated
-
- Scenario: Controller generator for show action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "show" action
- Then a standard "show" functional test for "posts" should be generated
- And a "show" controller action for "posts" should be generated
-
- Scenario: Controller generator for edit action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "edit" action
- Then a standard "edit" functional test for "posts" should be generated
- And a "edit" controller action for "posts" should be generated
-
- Scenario: Controller generator for update action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "update" action
- Then a standard "update" functional test for "posts" should be generated
- And a "update" controller action for "posts" should be generated
-
- Scenario: Controller generator for destroy action
- Given a Rails app
- And the coulda plugin is installed
- When I generate a "Posts" controller with "destroy" action
- Then a standard "destroy" functional test for "posts" should be generated
- And a "destroy" controller action for "posts" should be generated
-
View
12 vendor/plugins/coulda/features/helper_generator.feature
@@ -1,12 +0,0 @@
-Feature: Rails helper generator
- In order to better do Test-Driven Development with Rails
- As a user
- I want to generate just the module and test I need.
-
- Scenario: Helper
- Given a Rails app
- And the coulda plugin is installed
- When I generate a helper named "Navigation"
- Then a helper should be generated for "Navigation"
- And a helper test should be generated for "Navigation"
-
View
37 vendor/plugins/coulda/features/model_generator.feature
@@ -1,37 +0,0 @@
-Feature: Rails model generator
- In order to better do Test-Driven Development with Rails
- As a user
- I want to generate a Factory definition and Shoulda tests.
-
- Scenario: Model generator without attributes
- Given a Rails app
- And the coulda plugin is installed
- When I generate a model named "User"
- Then a factory should be generated for "User"
- And a unit test should be generated for "User"
-
- Scenario: Model generator with attributes
- Given a Rails app
- And the coulda plugin is installed
- When I generate a model "User" with a string "email"
- Then a factory for "User" should have an "email" string
- And a unit test should be generated for "User"
-
- Scenario: Model generator with association
- Given a Rails app
- And the coulda plugin is installed
- When I generate a model "Post" that belongs to a "User"
- Then a factory for "Post" should have an association to "User"
- And the "Post" unit test should have "should_belong_to :user" macro
- And the "Post" unit test should have "should_have_index :user_id" macro
- And the "posts" table should have db index on "user_id"
- And the "Post" model should have "belongs_to :user" macro
-
- Scenario: Model generator with Paperclip
- Given a Rails app
- And the coulda plugin is installed
- When I generate a model "Design" with file "Image"
- Then the "Design" model should have "has_attached_file :image" macro
- And the "Design" unit test should have "should_have_attached_file :image" macro
- And the "designs" table should have paperclip columns for "image"
-
View
185 vendor/plugins/coulda/features/step_definitions/controller_steps.rb
@@ -1,185 +0,0 @@
-When /^I generate a "(.*)" controller with "(.*)" action$/ do |controller, action|
- system "cd #{@rails_root} && " <<
- "script/generate controller #{controller} #{action} && " <<
- "cd .."
-end
-
-Then /^a standard "index" functional test for "(.*)" should be generated$/ do |controller|
- assert_generated_functional_test_for(controller) do |body|
- expected = " context 'GET to index' do\n" <<
- " setup { get :index }\n\n" <<
- " should_respond_with :success\n" <<
- " should_render_template :index\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "new" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'GET to new' do\n" <<
- " setup { get :new }\n\n" <<
- " should_respond_with :success\n" <<
- " should_render_template :new\n" <<
- " should_assign_to :post\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "create" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'POST to create with valid parameters' do\n" <<
- " setup do\n" <<
- " post :create, :post => Factory.attributes_for(:post)\n" <<
- " end\n\n" <<
- " should_change 'Post.count', :by => 1\n" <<
- " should_set_the_flash_to /created/i\n" <<
- " should_redirect_to('posts index') { posts_path }\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "show" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'GET to show for existing post' do\n" <<
- " setup do\n" <<
- " @post = Factory(:post)\n" <<
- " get :show, :id => @post.to_param\n" <<
- " end\n\n" <<
- " should_respond_with :success\n" <<
- " should_render_template :show\n" <<
- " should_assign_to :post, :equals => '@post'\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "edit" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'GET to edit for existing post' do\n" <<
- " setup do\n" <<
- " @post = Factory(:post)\n" <<
- " get :edit, :id => @post.to_param\n" <<
- " end\n\n" <<
- " should_respond_with :success\n" <<
- " should_render_template :edit\n" <<
- " should_assign_to :post, :equals => '@post'\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "update" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'PUT to update for existing post' do\n" <<
- " setup do\n" <<
- " @post = Factory(:post)\n" <<
- " put :update, :id => @post.to_param,\n" <<
- " :post => Factory.attributes_for(:post)\n" <<
- " end\n\n" <<
- " should_set_the_flash_to /updated/i\n" <<
- " should_redirect_to('posts index') { posts_path }\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a standard "destroy" functional test for "posts" should be generated$/ do
- assert_generated_functional_test_for("posts") do |body|
- expected = " context 'given a post' do\n" <<
- " setup { @post = Factory(:post) }\n\n" <<
- " context 'DELETE to destroy' do\n" <<
- " setup { delete :destroy, :id => @post.to_param }\n" <<
- " should_change 'Post.count', :from => 1, :to => 0\n" <<
- " should_set_the_flash_to /deleted/i\n" <<
- " should_redirect_to('posts index') { posts_path }\n" <<
- " end\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "new" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def new\n" <<
- " @post = Post.new\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "create" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def create\n" <<
- " @post = Post.new(params[:post])\n" <<
- " @post.save\n" <<
- " flash[:success] = 'Post created.'\n" <<
- " redirect_to posts_path\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "show" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def show\n" <<
- " @post = Post.find(params[:id])\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "edit" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def edit\n" <<
- " @post = Post.find(params[:id])\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "update" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def update\n" <<
- " @post = Post.find(params[:id])\n" <<
- " @post.update_attributes(params[:post])\n" <<
- " flash[:success] = 'Post updated.'\n" <<
- " redirect_to posts_path\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^a "destroy" controller action for "posts" should be generated$/ do
- assert_generated_controller_for("posts") do |body|
- expected = " def destroy\n" <<
- " @post = Post.find(params[:id])\n" <<
- " @post.destroy\n" <<
- " flash[:success] = 'Post deleted.'\n" <<
- " redirect_to posts_path\n" <<
- " end"
- assert body.include?(expected),
- "expected #{expected} but was #{body.inspect}"
- end
-end
-
-Then /^an empty "(.*)" controller action for "(.*)" should be generated$/ do |action, controller|
- assert_generated_controller_for(controller) do |body|
- assert_has_empty_method(body, action)
- end
-end
-
View
16 vendor/plugins/coulda/features/step_definitions/generator_steps.rb
@@ -1,16 +0,0 @@
-Given 'a Rails app' do
- system "rails rails_root"
- @rails_root = File.join(File.dirname(__FILE__), "..", "..", "rails_root")
-end
-
-Given /^the coulda plugin is installed$/ do
- plugin_dir = File.join(@rails_root, "vendor", "plugins")
- target = File.join(File.dirname(__FILE__), "..", "..", "generators")
- FileUtils.mkdir_p "#{plugin_dir}/coulda"
- system "cp -r #{target} #{plugin_dir}/coulda"
-end
-
-After do
- FileUtils.rm_rf @rails_root if @rails_root
-end
-
View
14 vendor/plugins/coulda/features/step_definitions/helper_steps.rb
@@ -1,14 +0,0 @@
-When /^I generate a helper named "(.*)"$/ do |name|
- system "cd #{@rails_root} && " <<
- "script/generate helper #{name} && " <<
- "cd .."
-end
-
-Then /^a helper should be generated for "(.*)"$/ do |name|
- assert_generated_helper_for(name)
-end
-
-Then /^a helper test should be generated for "(.*)"$/ do |name|
- assert_generated_helper_test_for(name)
-end
-
View
14 vendor/plugins/coulda/features/step_definitions/migration_steps.rb
@@ -1,14 +0,0 @@
-Then /^the paperclip migration should add "(.*)" columns to the "(.*)"$/ do |attr, table|
- up = " add_column :#{table}, :#{attr}_file_name, :string\n" <<
- " add_column :#{table}, :#{attr}_content_type, :string\n" <<
- " add_column :#{table}, :#{attr}_file_size, :integer\n" <<
- " add_column :#{table}, :#{attr}_updated_at, :datetime"
- down = " remove_column :#{table}, :#{attr}_file_name\n" <<
- " remove_column :#{table}, :#{attr}_content_type\n" <<
- " remove_column :#{table}, :#{attr}_file_size\n" <<
- " remove_column :#{table}, :#{attr}_updated_at"
- assert_generated_migration(table) do |body|
- assert body.include?(up), body.inspect
- assert body.include?(down), body.inspect
- end
-end
View
122 vendor/plugins/coulda/features/step_definitions/model_steps.rb
@@ -1,122 +0,0 @@
-# GENERATION
-
-When /^I generate a model named "(.*)"$/ do |model|
- system "cd #{@rails_root} && " <<
- "script/generate model #{model} && " <<
- "cd .."
-end
-
-When /^I generate a model "(.*)" with a (.*) "(.*)"$/ do |model, attr_type, attr_name|
- system "cd #{@rails_root} && " <<
- "script/generate model #{model} #{attr_name}:#{attr_type} && " <<
- "cd .."
-end
-
-When /^I generate a model "(.*)" that belongs to a "(.*)"$/ do |model, association|
- association.downcase!
- system "cd #{@rails_root} && " <<
- "script/generate model #{model} #{association}:belongs_to && " <<
- "cd .."
-end
-
-When /^I generate a model "(.*)" with file "(.*)"$/ do |model, file|
- file.downcase!
- system "cd #{@rails_root} && " <<
- "script/generate model #{model} #{file}:paperclip && " <<
- "cd .."
-end
-
-# MODEL
-
-Then /^a model with comments should be generated for "(.*)"$/ do |model|
- model.downcase!
- assert_generated_model_for(model) do |body|
- comments = []
- comments << "# includes: mixed in behavior" <<
- "# properties: attributes, associations" <<
- "# lifecycle: validations, callbacks" <<
- "# class methods: self.method, named_scopes" <<
- "# instance methods" <<
- "# non-public interface: protected helpers"
- comments.each do |comment|
- assert body.include?(comment), body.inspect
- end
- end
-end
-
-Then /^the "(.*)" model should have "(.*)" macro$/ do |model, macro|
- model.downcase!
- assert_generated_model_for(model) do |body|
- assert body.include?(macro), body.inspect
- end
-end
-
-# FACTORY
-
-Then /^a factory should be generated for "(.*)"$/ do |model|
- model.downcase!
- assert_generated_factory_for(model) do |body|
- expected = "Factory.define :#{model.downcase} do |#{model.downcase}|\n" <<
- "end\n"
- assert_equal expected, body
- end
-end
-
-Then /^a factory for "(.*)" should have an? "(.*)" (.*)$/ do |model, attr_name, attr_type|
- model.downcase!
- assert_generated_factory_for(model) do |body|
- expected = "Factory.define :#{model} do |#{model}|\n" <<
- " #{model}.#{attr_name} { '#{attr_type}' }\n" <<
- "end\n"
- assert_equal expected, body
- end
-end
-
-Then /^a factory for "(.*)" should have an association to "(.*)"$/ do |model, associated_model|
- model.downcase!