Permalink
Browse files

Remove Sprockets files

  • Loading branch information...
1 parent 94ca05b commit 90d7957a0b15ce983f8763641acfbe82170cfe7d @nhowell committed Sep 11, 2011
Showing with 0 additions and 1,737 deletions.
  1. +0 −4 vendor/sprockets/.gitignore
  2. +0 −22 vendor/sprockets/CHANGELOG
  3. +0 −20 vendor/sprockets/LICENSE
  4. +0 −230 vendor/sprockets/README.markdown
  5. +0 −19 vendor/sprockets/Rakefile
  6. +0 −54 vendor/sprockets/bin/sprocketize
  7. +0 −127 vendor/sprockets/ext/nph-sprockets.cgi
  8. +0 −42 vendor/sprockets/lib/sprockets.rb
  9. +0 −44 vendor/sprockets/lib/sprockets/concatenation.rb
  10. +0 −52 vendor/sprockets/lib/sprockets/environment.rb
  11. +0 −5 vendor/sprockets/lib/sprockets/error.rb
  12. +0 −37 vendor/sprockets/lib/sprockets/pathname.rb
  13. +0 −91 vendor/sprockets/lib/sprockets/preprocessor.rb
  14. +0 −107 vendor/sprockets/lib/sprockets/secretary.rb
  15. +0 −77 vendor/sprockets/lib/sprockets/server.rb
  16. +0 −54 vendor/sprockets/lib/sprockets/source_file.rb
  17. +0 −82 vendor/sprockets/lib/sprockets/source_line.rb
  18. +0 −9 vendor/sprockets/lib/sprockets/version.rb
  19. +0 −15 vendor/sprockets/sprockets.gemspec
  20. +0 −1 vendor/sprockets/test/fixtures/assets/images/script_with_assets/one.png
  21. +0 −1 vendor/sprockets/test/fixtures/assets/images/script_with_assets/two.png
  22. +0 −1 vendor/sprockets/test/fixtures/assets/stylesheets/script_with_assets.css
  23. +0 −1 vendor/sprockets/test/fixtures/constants.yml
  24. +0 −8 ...res/double_slash_comments_that_are_not_requires_should_be_ignored_when_strip_comments_is_false.js
  25. +0 −2 ...rockets/test/fixtures/double_slash_comments_that_are_not_requires_should_be_removed_by_default.js
  26. +0 −4 vendor/sprockets/test/fixtures/multiline_comments_should_be_removed_by_default.js
  27. +0 −5 .../sprockets/test/fixtures/requiring_a_file_after_it_has_already_been_required_should_do_nothing.js
  28. +0 −1 vendor/sprockets/test/fixtures/requiring_a_file_that_does_not_exist_should_raise_an_error.js
  29. +0 −3 ...est/fixtures/requiring_a_single_file_should_replace_the_require_comment_with_the_file_contents.js
  30. +0 −1 vendor/sprockets/test/fixtures/requiring_the_current_file_should_do_nothing.js
  31. +0 −3 vendor/sprockets/test/fixtures/src/constants.yml
  32. +0 −1 vendor/sprockets/test/fixtures/src/foo.js
  33. +0 −4 vendor/sprockets/test/fixtures/src/foo/bar.js
  34. +0 −1 vendor/sprockets/test/fixtures/src/foo/foo.js
  35. +0 −3 vendor/sprockets/test/fixtures/src/script_with_assets.js
  36. +0 −13 vendor/sprockets/test/fixtures/src/script_with_comments.js
  37. +0 −36 vendor/sprockets/test/test_concatenation.rb
  38. +0 −64 vendor/sprockets/test/test_environment.rb
  39. +0 −55 vendor/sprockets/test/test_helper.rb
  40. +0 −43 vendor/sprockets/test/test_pathname.rb
  41. +0 −107 vendor/sprockets/test/test_preprocessor.rb
  42. +0 −89 vendor/sprockets/test/test_secretary.rb
  43. +0 −76 vendor/sprockets/test/test_server.rb
  44. +0 −34 vendor/sprockets/test/test_source_file.rb
  45. +0 −89 vendor/sprockets/test/test_source_line.rb
@@ -1,4 +0,0 @@
-doc
-pkg
-tmp
-README.html
View
@@ -1,22 +0,0 @@
-* Add a :strip_comments option to Secretary that is passed through to its Preprocessor. [#12 state:resolved]
-
-
-*1.0.2* (February 24, 2009)
-
-* Update the sprockets-rails installation instructions to use `script/plugin`. [#7 state:resolved]
-
-* Fix Secretary#source_last_modified not to raise an exception when one of the preprocessor's source files has been moved or deleted. (Jonathan Goldman) [#10 state:resolved]
-
-* Avoid hanging when preprocessing minified source files. (Maciej Pasternacki) [#9 state:resolved]
-
-
-*1.0.1* (February 19, 2009)
-
-* Change the CGI output generation environment variable name to "sprockets_generate_output_file" and use the right path in Concatenation#save_to.
-
-* Prefer "vendor/gems/sprockets/lib" to "vendor/sprockets/lib" when looking for an externaled Sprockets checkout in nph-sprockets.cgi.
-
-
-*1.0.0* (February 17, 2009)
-
-* Initial public release.
View
@@ -1,20 +0,0 @@
-Copyright (c) 2009 Sam Stephenson
-
-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.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,19 +0,0 @@
-require "rubygems"
-require "rake/testtask"
-require "rake/gempackagetask"
-
-task :default => :test
-
-Rake::TestTask.new do |t|
- t.libs << "test"
- t.test_files = FileList["test/test_*.rb"]
- t.verbose = true
-end
-
-Rake::GemPackageTask.new(eval(IO.read(File.join(File.dirname(__FILE__), "sprockets.gemspec")))) do |pkg|
- require File.join(File.dirname(__FILE__), "lib", "sprockets", "version")
- raise "Error: Sprockets::Version doesn't match gemspec" if Sprockets::Version::STRING != pkg.version.to_s
-
- pkg.need_zip = true
- pkg.need_tar = true
-end
@@ -1,54 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.join(File.dirname(__FILE__), *%w".. lib sprockets")
-require "optparse"
-
-load_path = (ENV["SPROCKETS_PATH"] || "").split(":")
-filenames = []
-options = { :load_path => load_path, :source_files => filenames, :expand_paths => false }
-
-OptionParser.new do |opts|
- opts.summary_width = 28
- opts.banner = "Usage: sprocketize [options] filename [filename ...]"
-
- def opts.show_usage
- puts self
- exit
- end
-
- opts.on("-C DIRECTORY", "--directory=DIRECTORY", "Change to DIRECTORY before doing anything") do |directory|
- Dir.chdir(directory)
- end
-
- opts.on("-I DIRECTORY", "--include-dir=DIRECTORY", "Adds the directory to the Sprockets load path") do |directory|
- load_path << directory
- end
-
- opts.on("-a DIRECTORY", "--asset-root=DIRECTORY", "Copy provided assets into DIRECTORY") do |directory|
- options[:asset_root] = directory
- end
-
- opts.on_tail("-h", "--help", "Shows this help message") do
- opts.show_usage
- end
-
- opts.on_tail("-v", "--version", "Shows version") do
- puts Sprockets::Version::STRING
- exit
- end
-
- opts.show_usage if ARGV.empty?
-
- begin
- opts.order(ARGV) do |filename|
- filenames << filename
- end
- rescue OptionParser::ParseError => e
- opts.warn e.message
- opts.show_usage
- end
-end
-
-secretary = Sprockets::Secretary.new(options)
-secretary.install_assets if options[:asset_root]
-print secretary.concatenation
@@ -1,127 +0,0 @@
-#!/usr/bin/env ruby
-
-# This is a simple CGI wrapper around Sprockets.
-#
-# Copy it into a directory on your site with CGI enabled. When invoked, the
-# script will search its directory and parent directories for a YAML file named
-# "config/sprockets.yml" in order to load configuration information.
-#
-# If you set the environment variable "sprockets_generate_output_file" to
-# "true" the concatenation will be cached to disk. Use it in conjunction with
-# URL rewriting to cache your Sprockets output on the first request.
-#
-# Assuming a site layout like this:
-#
-# mysite/
-# config/
-# sprockets.yml
-# javascripts/
-# mysite.js
-# ...
-# public/
-# index.html
-# nph-sprockets.cgi (this file)
-# vendor/
-# sprockets/
-# prototype/ -> ...
-# scriptaculous/ -> ...
-#
-# mysite/config/sprockets.yml might look like this:
-#
-# :load_path:
-# - javascripts
-# - vendor/sprockets/*/src
-# :source_files:
-# - javascripts/mysite.js
-# - javascripts/*.js
-# :output_file: public/sprockets.js
-#
-# The <script> tag in mysite/public/index.html could look like this:
-#
-# <script type="text/javascript" src="/sprockets.js"></script>
-#
-# And you might have the following Apache configuration:
-#
-# <VirtualHost ...>
-# ServerName mysite.example.org
-# DocumentRoot "/path/to/mysite/public"
-#
-# <Directory "/path/to/mysite/public">
-# Options +ExecCGI +FollowSymLinks
-# AddHandler cgi-script .cgi
-#
-# RewriteEngine on
-# RewriteCond /sprockets.js !-f
-# RewriteRule ^sprockets\.js /nph-sprockets.cgi [P,L]
-# </Directory>
-# </VirtualHost>
-#
-# All requests to /sprockets.js will transparently proxy /nph-sprockets.cgi if
-# mysite/public/sprockets.js does not exist. In production, you can add
-#
-# SetEnv sprockets_generate_output_file true
-#
-# to your Apache configuration and mysites/public/sprockets.js will be cached
-# on the first request to /sprockets.js.
-
-require "yaml"
-require "fileutils"
-
-def respond_with(options = {})
- options = { :code => 200, :content => "", :type => "text/plain" }.merge(options)
- print "HTTP/1.0 #{options[:code]}\r\n"
- print "Content-Type: #{options[:type]}\r\n"
- print "Content-Length: #{options[:content].length}\r\n"
- print "\r\n#{options[:content]}"
- $stdout.flush
- exit!
-end
-
-def search_upwards_for(filename)
- pwd = original_pwd = Dir.pwd
- loop do
- return File.expand_path(filename) if File.file?(filename)
- Dir.chdir("..")
- respond_with(:code => 500, :content => "couldn't find config/sprockets.yml") if Dir.pwd == pwd
- pwd = Dir.pwd
- end
-ensure
- Dir.chdir(original_pwd)
-end
-
-def generate_output_file?
- (ENV["REDIRECT_sprockets_generate_output_file"] || ENV["sprockets_generate_output_file"]) =~ /true/i
-end
-
-configuration_file = search_upwards_for("config/sprockets.yml")
-sprockets_root = File.dirname(File.dirname(configuration_file))
-configuration = YAML.load(IO.read(configuration_file))
-
-begin
- if File.directory?(sprockets_dir = File.join(sprockets_root, "vendor/gems/sprockets/lib"))
- $:.unshift sprockets_dir
- elsif File.directory?(sprockets_dir = File.join(sprockets_root, "vendor/sprockets/lib"))
- $:.unshift sprockets_dir
- else
- require "rubygems"
- end
-
- require "sprockets"
-
-rescue Exception => e
- respond_with(:code => 500, :content => "couldn't find sprockets: #{e}")
-end
-
-begin
- secretary = Sprockets::Secretary.new(
- :root => sprockets_root,
- :load_path => configuration[:load_path],
- :source_files => configuration[:source_files]
- )
-
- secretary.concatenation.save_to(File.join(sprockets_root, configuration[:output_file])) if generate_output_file?
- respond_with(:content => secretary.concatenation.to_s, :type => "text/javascript")
-
-rescue Exception => e
- respond_with(:code => 500, :content => "couldn't generate concatenated javascript: #{e}")
-end
@@ -1,42 +0,0 @@
-$:.unshift File.dirname(__FILE__)
-
-require "yaml"
-require "fileutils"
-
-module Sprockets
- class << self
- def running_on_windows?
- RUBY_PLATFORM =~ /(win|w)32$/
- end
-
- def absolute?(location)
- same_when_expanded?(location) || platform_absolute_path?(location)
- end
-
- protected
- def same_when_expanded?(location)
- location[0, 1] == File.expand_path(location)[0, 1]
- end
-
- def platform_absolute_path?(location)
- false
- end
-
- if Sprockets.running_on_windows?
- def platform_absolute_path?(location)
- location[0, 1] == File::SEPARATOR && File.expand_path(location) =~ /[A-Za-z]:[\/\\]/
- end
- end
- end
-end
-
-require "sprockets/version"
-require "sprockets/error"
-require "sprockets/environment"
-require "sprockets/pathname"
-require "sprockets/source_line"
-require "sprockets/source_file"
-require "sprockets/concatenation"
-require "sprockets/preprocessor"
-require "sprockets/secretary"
-require "sprockets/server"
@@ -1,44 +0,0 @@
-require 'digest/md5'
-
-module Sprockets
- class Concatenation
- attr_reader :source_lines
-
- def initialize
- @source_lines = []
- @source_file_mtimes = {}
- @source_md5 = nil
- end
-
- def record(source_line)
- @source_md5 = nil
- source_lines << source_line
- record_mtime_for(source_line.source_file)
- source_line
- end
-
- def to_s
- source_lines.join
- end
-
- def md5
- @source_md5 ||= Digest::MD5.hexdigest(to_s)
- end
-
- def mtime
- @source_file_mtimes.values.max
- end
-
- def save_to(filename)
- timestamp = mtime
- File.open(filename, "w") { |file| file.write(to_s) }
- File.utime(timestamp, timestamp, filename)
- true
- end
-
- protected
- def record_mtime_for(source_file)
- @source_file_mtimes[source_file] ||= source_file.mtime
- end
- end
-end
@@ -1,52 +0,0 @@
-module Sprockets
- class Environment
- attr_reader :root, :load_path
-
- def initialize(root, load_path = [])
- @load_path = [@root = Pathname.new(self, root)]
-
- load_path.reverse_each do |location|
- register_load_location(location)
- end
- end
-
- def pathname_from(location)
- Pathname.new(self, absolute_location_from(location))
- end
-
- def register_load_location(location)
- pathname = pathname_from(location)
- load_path.delete(pathname)
- load_path.unshift(pathname)
- location
- end
-
- def find(location)
- if Sprockets.absolute?(location) && File.exists?(location)
- pathname_from(location)
- else
- find_all(location).first
- end
- end
-
- def constants(reload = false)
- @constants = nil if reload
- @constants ||= find_all("constants.yml").inject({}) do |constants, pathname|
- contents = YAML.load(pathname.contents) rescue nil
- contents = {} unless contents.is_a?(Hash)
- constants.merge(contents)
- end
- end
-
- protected
- def absolute_location_from(location)
- location = location.to_s
- location = File.join(root.absolute_location, location) unless Sprockets.absolute?(location)
- File.expand_path(location)
- end
-
- def find_all(location)
- load_path.map { |pathname| pathname.find(location) }.compact
- end
- end
-end
@@ -1,5 +0,0 @@
-module Sprockets
- class Error < ::StandardError; end
- class LoadError < Error; end
- class UndefinedConstantError < Error; end
-end
Oops, something went wrong.

0 comments on commit 90d7957

Please sign in to comment.