Permalink
Browse files

Remove Version#to_spec and legacy index rake task. Use http://github.…

…com/rubygems/rubygems-mirror instead for mirroring
  • Loading branch information...
1 parent fb55bd6 commit 9d6794ffbfb6623030c2e22071812057dfc53a54 @nickrivadeneira nickrivadeneira committed Aug 5, 2011
Showing with 0 additions and 72 deletions.
  1. +0 −15 app/models/version.rb
  2. +0 −23 lib/tasks/gemcutter.rake
  3. +0 −34 test/unit/version_test.rb
View
15 app/models/version.rb
@@ -218,21 +218,6 @@ def to_install
command
end
- def to_spec
- Gem::Specification.new do |spec|
- spec.name = rubygem.name
- spec.version = to_gem_version
- spec.authors = authors.split(', ')
- spec.date = built_at
- spec.description = description
- spec.summary = summary
-
- dependencies.each do |dep|
- spec.add_dependency(dep.rubygem.name, dep.requirements.split(', '))
- end
- end
- end
-
private
def self.to_rows(scope)
View
23 lib/tasks/gemcutter.rake
@@ -10,29 +10,6 @@ namespace :gemcutter do
end
end
- desc "Store legacy index"
- task :store_legacy_index => :environment do
- puts "Loading up versions..."
- versions = Version.with_deps.indexed.order("full_name")
-
- puts "Mapping specs..."
- index = versions.map do |version|
- [version.full_name, version.to_spec]
- end
-
- puts "Uploading to S3..."
- class Uploader
- include Vault
- end
- file = Uploader.new.directory.files.create(
- :body => Gem.deflate(Marshal.dump(index)),
- :key => "Marshal.4.8.Z",
- :public => true
- )
-
- puts "Ding, legacy index is done!"
- end
-
desc "fix full names"
task :fix_full_names => :environment do
Version.without_any_callbacks do
View
34 test/unit/version_test.rb
@@ -248,40 +248,6 @@ class VersionTest < ActiveSupport::TestCase
assert_equal "This rubygem does not have a description or summary.", @version.info
end
- should "create a gem spec" do
- spec = @version.to_spec
- assert spec.is_a?(Gem::Specification)
- assert_equal @version.rubygem.name, spec.name
- assert_equal @version.number, spec.version.to_s
- assert_equal [@version.authors], spec.authors
- assert_equal @version.description, spec.description
- assert_equal @version.summary.blank?, spec.summary.blank?
-
- date = @version.built_at
- assert_equal Time.utc(date.year, date.month, date.day), spec.date.utc
- end
-
- should "join multiple authors on gemspecs" do
- @version.authors = "Geddy Lee, Neil Peart, Alex Lifeson"
- assert_equal ["Geddy Lee", "Neil Peart", "Alex Lifeson"], @version.to_spec.authors
- end
-
- should "create gemspec with some dependencies" do
- @dep_one = Factory(:dependency, :version => @version, :requirements => ">= 0, = 1.2.3")
- @dep_two = Factory(:dependency, :version => @version, :requirements => "= 3.0.0")
- spec = @version.to_spec
-
- @spec_dep_one = spec.dependencies.detect { |d| d.name == @dep_one.rubygem.name }
- @spec_dep_two = spec.dependencies.detect { |d| d.name == @dep_two.rubygem.name }
-
- assert_equal 2, spec.dependencies.size
- assert @spec_dep_one
- assert @spec_dep_two
-
- assert_equal @dep_one.requirements.split(", "), @spec_dep_one.requirements_list
- assert_equal @dep_two.requirements.split(", "), @spec_dep_two.requirements_list
- end
-
context "when yanked" do
setup do
@version.yank!

0 comments on commit 9d6794f

Please sign in to comment.