Permalink
Browse files

+ Deleted pre-gauntlet scripts.

+ Added .autotest.
[git-p4: depot-paths = "//src/flog/dev/": change = 5505]
  • Loading branch information...
1 parent 7d9da5e commit afef750a3900c4c09b2cc153e83c7dee793fd7ac @zenspider zenspider committed Nov 5, 2009
Showing with 16 additions and 445 deletions.
  1. +15 −0 .autotest
  2. +1 −17 Manifest.txt
  3. +0 −161 gem_updater.rb
  4. +0 −22 unpack.rb
  5. +0 −245 update_scores.rb
View
@@ -0,0 +1,15 @@
+# -*- ruby -*-
+
+require 'autotest/restart'
+require 'autotest/rcov'
+
+Autotest.add_hook :initialize do |at|
+ at.order = :random
+
+ at.add_mapping(/^spec\/.*_spec\.rb$/) do |filename, _|
+ filename
+ end
+
+ at.libs << ':../../minitest/dev/lib'
+ at.testlib = "minitest/autorun"
+end
View
@@ -1,26 +1,10 @@
+.autotest
History.txt
Manifest.txt
README.txt
Rakefile
bin/flog
-gem_updater.rb
lib/flog.rb
lib/flog_task.rb
lib/gauntlet_flog.rb
-unpack.rb
-update_scores.rb
-spec_fixtures/collection/bigger_example/acts/date_range.rb
-spec_fixtures/collection/bigger_example/acts/range.rb
-spec_fixtures/collection/bigger_example/association_extensions/date_ranged.rb
-spec_fixtures/collection/bigger_example/association_extensions/ranged.rb
-spec_fixtures/collection/bigger_example/reflection_extensions/ranged.rb
-spec_fixtures/directory/bot_filter.rb
-spec_fixtures/directory/bot_parser.rb
-spec_fixtures/directory/bot_parser_format.rb
-spec_fixtures/directory/bot_sender.rb
-spec_fixtures/empty/empty.rb
-spec_fixtures/simple/simple.rb
test/test_flog.rb
-test/test_flog_command.rb
-test/test_flog_integration.rb
-test/test_helper.rb
View
@@ -1,161 +0,0 @@
-require 'rubygems/remote_fetcher'
-
-$u ||= false
-
-module GemUpdater
- GEMURL = URI.parse 'http://gems.rubyforge.org'
-
- @@index = nil
-
- def self.stupid_gems
- ["ruby-aes-table1-1.0.gem", # stupid dups usually because of "dash" renames
- "ruby-aes-unroll1-1.0.gem",
- "hpricot-scrub-0.2.0.gem",
- "extract_curves-0.0.1.gem",
- "extract_curves-0.0.1-i586-linux.gem",
- "extract_curves-0.0.1-mswin32.gem",
- "rfeedparser-ictv-0.9.931.gem",
- "spec_unit-0.0.1.gem"]
- end
-
- def self.initialize_dir
- Dir.mkdir "../gems" unless File.directory? "../gems"
- self.in_gem_dir do
- File.symlink ".", "cache" unless File.exist? "cache"
- end
- end
-
- def self.get_source_index
- return @@index if @@index
-
- dump = if $u or not File.exist? '.source_index' then
- url = GEMURL + "Marshal.#{Gem.marshal_version}.Z"
- dump = Gem::RemoteFetcher.fetcher.fetch_path url
- require 'zlib'
- dump = Gem.inflate dump
- open '.source_index', 'wb' do |io| io.write dump end
- dump
- else
- open '.source_index', 'rb' do |io| io.read end
- end
-
- @@index = Marshal.load dump
- end
-
- def self.get_latest_gems
- @@cache ||= get_source_index.latest_specs
- end
-
- def self.get_gems_by_name
- @@by_name ||= Hash[*get_latest_gems.map { |gem|
- [gem.name, gem, gem.full_name, gem]
- }.flatten]
- end
-
- def self.dependencies_of name
- index = self.get_source_index
- get_gems_by_name[name].dependencies.map { |dep| index.search(dep).last }
- end
-
- def self.dependent_upon name
- get_latest_gems.find_all { |gem|
- gem.dependencies.any? { |dep| dep.name == name }
- }
- end
-
- def self.update_gem_tarballs
- GemUpdater.initialize_dir
-
- latest = GemUpdater.get_latest_gems
-
- puts "updating mirror"
-
- self.in_gem_dir do
- gems = Dir["*.gem"]
- tgzs = Dir["*.tgz"]
-
- old = tgzs - latest.map { |spec| "#{spec.full_name}.tgz" }
- unless old.empty? then
- puts "deleting #{old.size} tgzs"
- old.each do |tgz|
- File.unlink tgz
- end
- end
-
- new = latest.map { |spec|
- "#{spec.full_name}.tgz"
- } - tgzs
-
- puts "fetching #{new.size} tgzs"
-
- latest.sort.each do |spec|
- full_name = spec.full_name
- tgz_name = "#{full_name}.tgz"
- gem_name = "#{full_name}.gem"
-
- next if tgzs.include? tgz_name
-
- unless gems.include? gem_name then
- begin
- warn "downloading #{full_name}"
- Gem::RemoteFetcher.fetcher.download(spec, GEMURL, Dir.pwd)
- rescue Gem::RemoteFetcher::FetchError
- warn " failed"
- next
- end
- end
-
- warn "converting #{gem_name} to tarball"
-
- unless File.directory? full_name then
- system "gem unpack cache/#{gem_name}"
- system "gem spec -l cache/#{gem_name} > #{full_name}/gemspec.rb"
- end
-
- system "tar zmcf #{tgz_name} #{full_name}"
- system "rm -rf #{full_name} #{gem_name}"
- end
- end
- end
-
- def self.each_gem filter = /^[\w-]+-\d+(\.\d+)*\.tgz$/
- self.in_gem_dir do
- Dir["*.tgz"].each do |tgz|
- next unless tgz =~ filter
-
- yield File.basename(tgz, ".tgz")
- end
- end
- end
-
- def self.with_gem name
- self.in_gem_dir do
- begin
- system "tar zxmf #{name}.tgz 2> /dev/null"
- Dir.chdir name do
- yield name
- end
- ensure
- system "rm -r #{name}"
- end
- end
- end
-
- def self.load_yaml path, default = {}
- YAML.load(File.read(path)) rescue default
- end
-
- def self.save_yaml path, data
- File.open("#{path}.new", 'w') do |f|
- warn "*** saving #{path}"
- YAML.dump data, f
- end
- File.rename "#{path}.new", path
- end
-
- def self.in_gem_dir
- Dir.chdir "../gems" do
- yield
- end
- end
-end
View
@@ -1,22 +0,0 @@
-#!/usr/local/bin/ruby -w
-
-code = '../code'
-
-pattern = ARGV.empty? ? nil : Regexp.union(*ARGV)
-
-Dir.mkdir code unless File.directory? code
-
-Dir.chdir code do
- Dir["../gems/*.gem"].each do |gem|
- project = File.basename gem
- next unless project =~ pattern if pattern
- dir = project.sub(/\.gem$/, '')
- warn dir
- unless File.directory? dir then
- Dir.mkdir dir
- Dir.chdir dir do
- system "(tar -Oxf ../#{gem} data.tar.gz | tar zxf -) 2> /dev/null"
- end
- end
- end
-end
Oops, something went wrong. Retry.

0 comments on commit afef750

Please sign in to comment.