Permalink
Browse files

lets rename it to something that's not already taken

  • Loading branch information...
1 parent 8954464 commit 9776ec1954c1ed126a7703502220dc4e9849ba94 @aberant committed Feb 28, 2010
View
12 README.rdoc
@@ -1,4 +1,4 @@
-= Spriter, a sprite generator
+= CSS Spriter, a sprite generator
[ PNG, PNG, PNG ] (°_°)
[ PNG, PNG, PNG ] (° )
@@ -13,25 +13,25 @@
It takes your PNG's, chews them up and spits out sprites!
-point bin/spriter at a directory, and watch it sprite away!
+point bin/sprite at a directory, and watch it sprite away!
== Installation - standalone
- sudo gem install spriter
+ sudo gem install css-spriter
=== Usage - standalone
- spriter <directory>
+ css-spriter <directory>
If you point the sprite command at a directory tree by default it will construct sprites for each of the sub directories and generate a single css to access all of the sprites which is placed in the root of the directory tree
For a full list of options:
- spriter -h
+ css-spriter -h
== Installation - Rails plugin
- script/plugin install git://github.com/aberant/spriter.git
+ script/plugin install git://github.com/aberant/css-spriter.git
=== Usage - Rails plugin
View
6 bin/spriter → bin/css-spriter
@@ -1,12 +1,12 @@
#!/usr/bin/env ruby
require 'optparse'
-require File.dirname(__FILE__) + "/../lib/spriter.rb"
+require File.dirname(__FILE__) + "/../lib/css-spriter.rb"
options = {}
opts = OptionParser.new do |opts|
- opts.banner = "Usage: spriter [options] directory"
+ opts.banner = "Usage: css-spriter [options] directory"
opts.on("-c", "--cleanup", "Remove all generated files") do |file|
options[:cleanup] = true
@@ -36,7 +36,7 @@ unless dir
end
options[:source] = dir
-processor = Spriter::Processor.new(options)
+processor = CssSpriter::Processor.new(options)
if options[:cleanup]
processor.cleanup
View
2 bin/png_info
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require File.join( File.dirname( __FILE__ ), '..', 'lib', 'spriter' )
+require File.join( File.dirname( __FILE__ ), '..', 'lib', 'css-spriter' )
module PNG
class Parser
View
2 examples/filter_util.rb
@@ -1,6 +1,6 @@
# horrible place for this. just a sanity check for filtering
-require File.join( File.dirname( __FILE__ ), '..', 'lib', 'spriter' )
+require File.join( File.dirname( __FILE__ ), '..', 'lib', 'css-spriter' )
image = PNG::Image.open( "sprites/many_sized_cats/darth_cat.png")
View
2 examples/sprites/index.html
@@ -10,7 +10,7 @@
.clear {clear:both}
</style>
<div>
- Hello. See spriter run:
+ Hello. See css-spriter run:
<div class="words_of">of</div>
<div class="words_latitude">latitude</div>
<div class="words_set">set</div>
View
16 lib/css-spriter.rb
@@ -0,0 +1,16 @@
+require 'zlib'
+
+require 'css-spriter/png/file_header'
+require 'css-spriter/png/parser'
+require 'css-spriter/png/filters'
+require 'css-spriter/png/chunk'
+require 'css-spriter/png/ihdr'
+require 'css-spriter/png/idat'
+require 'css-spriter/png/iend'
+require 'css-spriter/png/image'
+require 'css-spriter/sprite'
+require 'css-spriter/directory_processor'
+require 'css-spriter/stylesheet_builder'
+require 'css-spriter/processor'
+require 'css-spriter/mtime_tracker'
+require 'css-spriter/image_data'
View
0 lib/spriter/directory_processor.rb → lib/css-spriter/directory_processor.rb
File renamed without changes.
View
2 lib/spriter/image_data.rb → lib/css-spriter/image_data.rb
@@ -1,6 +1,6 @@
require 'enumerator'
-module Spriter
+module CssSpriter
class ImageData
RGB_WIDTH = 3
RGBA_WIDTH = 4
View
0 lib/spriter/mtime_tracker.rb → lib/css-spriter/mtime_tracker.rb
File renamed without changes.
View
0 lib/spriter/png/chunk.rb → lib/css-spriter/png/chunk.rb
File renamed without changes.
View
0 lib/spriter/png/file_header.rb → lib/css-spriter/png/file_header.rb
File renamed without changes.
View
0 lib/spriter/png/filters.rb → lib/css-spriter/png/filters.rb
File renamed without changes.
View
0 lib/spriter/png/idat.rb → lib/css-spriter/png/idat.rb
File renamed without changes.
View
0 lib/spriter/png/iend.rb → lib/css-spriter/png/iend.rb
File renamed without changes.
View
6 lib/spriter/png/ihdr.rb → lib/css-spriter/png/ihdr.rb
@@ -11,10 +11,10 @@ def self.new_from_raw( data )
end
def initialize( width, height, depth=8, color_type=2, compression=0, filter=0, interlace=0 )
- raise "for now, spriter only supports non-interlaced images" unless interlace == 0
- raise "for now, spriter only supports images with a bit depth of 8" unless depth == 8
+ raise "for now, css-spriter only supports non-interlaced images" unless interlace == 0
+ raise "for now, css-spriter only supports images with a bit depth of 8" unless depth == 8
unless SUPPORTED_COLOR_TYPES.include? color_type
- raise "for now, spriter only supports color types #{SUPPORTED_COLOR_TYPES.JOIN(',')} color type was #{color_type}"
+ raise "for now, css-spriter only supports color types #{SUPPORTED_COLOR_TYPES.JOIN(',')} color type was #{color_type}"
end
@width, @height, @depth, @color_type = width, height, depth, color_type
end
View
2 lib/spriter/png/image.rb → lib/css-spriter/png/image.rb
@@ -84,7 +84,7 @@ def to_image
uncompressed = @idat.uncompressed
#scanline_width - 1 because we're stripping the filter bit
- n_out = Spriter::ImageData.new(:scanline_width => scanline_width - 1,
+ n_out = CssSpriter::ImageData.new(:scanline_width => scanline_width - 1,
:pixel_width => pixel_width,
:name => self.name,
:data => Array.new(height))
View
0 lib/spriter/png/parser.rb → lib/css-spriter/png/parser.rb
File renamed without changes.
View
2 lib/spriter/processor.rb → lib/css-spriter/processor.rb
@@ -1,4 +1,4 @@
-module Spriter
+module CssSpriter
class Processor
def initialize(opts)
@options = opts
View
0 lib/spriter/sprite.rb → lib/css-spriter/sprite.rb
File renamed without changes.
View
0 lib/spriter/stylesheet_builder.rb → lib/css-spriter/stylesheet_builder.rb
File renamed without changes.
View
18 lib/spriter.rb
@@ -1,18 +0,0 @@
-require 'zlib'
-
-$:.unshift( File.dirname( __FILE__ ))
-
-require 'spriter/png/file_header'
-require 'spriter/png/parser'
-require 'spriter/png/filters'
-require 'spriter/png/chunk'
-require 'spriter/png/ihdr'
-require 'spriter/png/idat'
-require 'spriter/png/iend'
-require 'spriter/png/image'
-require 'spriter/sprite'
-require 'spriter/directory_processor'
-require 'spriter/stylesheet_builder'
-require 'spriter/processor'
-require 'spriter/mtime_tracker'
-require 'spriter/image_data'
View
8 spec/image_data_spec.rb
@@ -1,10 +1,10 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe Spriter::ImageData do
+describe CssSpriter::ImageData do
before do
data = [[1,2,3],
[4,5,6]]
- @id = Spriter::ImageData.new(:scanline_width => 3, :pixel_width => 3, :data => data)
+ @id = CssSpriter::ImageData.new(:scanline_width => 3, :pixel_width => 3, :data => data)
end
it "can fill to a specified height" do
@@ -22,12 +22,12 @@
end
it "has an empty array by default" do
- id = Spriter::ImageData.new
+ id = CssSpriter::ImageData.new
id.empty?.should be_true
end
it "should return nil when asked for an index that doesn't exist" do
- id = Spriter::ImageData.new
+ id = CssSpriter::ImageData.new
id[0].should be_nil
end
View
2 spec/integration_spec.rb
@@ -114,7 +114,7 @@
before :all do
@dir = File.dirname(__FILE__) + "/sprite_dirs"
@css_file = @dir + "/sprite.css"
- @spriter = Spriter::Processor.new(:path_prefix => "/images", :source => @dir, :css_file => @css_file)
+ @spriter = CssSpriter::Processor.new(:path_prefix => "/images", :source => @dir, :css_file => @css_file)
@spriter.write
end
View
2 spec/spec_helper.rb
@@ -3,7 +3,7 @@
require 'spec'
require 'spec/autorun'
-require 'spriter'
+require 'css-spriter'
require 'builders/image_builder'
View
4 spriter.gemspec
@@ -84,7 +84,9 @@ Gem::Specification.new do |s|
"spec/sprite_dirs/words/set.png",
"spec/sprite_dirs/words/specified.png",
"spec/tmp/merge_right_test.png",
- "spec/tmp/write_test.png"
+ "spec/tmp/write_test.png",
+ "spriter.gemspec",
+ "tasks/spriter_tasks.rake"
]
s.homepage = %q{http://github.com/aberant/spriter}
s.rdoc_options = ["--charset=UTF-8"]
View
12 tasks/spriter_tasks.rake
@@ -1,8 +1,8 @@
#TODO - make this a rake task instead of a function
-module Spriter
+module CssSpriter
def self.setup
require 'fileutils'
- require File.dirname(__FILE__) + "/../lib/spriter.rb"
+ require File.dirname(__FILE__) + "/../lib/css-spriter.rb"
FileUtils.cd(RAILS_ROOT + "/public/images")
opts = {:source => "sprites",
@@ -14,12 +14,12 @@ end
namespace :sprite do
desc "Generates sprite images and stylesheets"
task :generate do
- opts = Spriter.setup
- Spriter::Processor.new(opts).write
+ opts = CssSpriter.setup
+ CssSpriter::Processor.new(opts).write
end
desc "Removes generated sprite images and stylesheets"
task :cleanup do
- opts = Spriter.setup
- Spriter::Processor.new(opts).cleanup
+ opts = CssSpriter.setup
+ CssSpriter::Processor.new(opts).cleanup
end
end

0 comments on commit 9776ec1

Please sign in to comment.