Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renaming project to spriter

  • Loading branch information...
commit 92b8057aff8f3dd293785317bf994a15a3aeb4ad 1 parent d62ff75
@aberant authored
View
14 README.rdoc
@@ -1,4 +1,4 @@
-= Spittle, a sprite generator
+= 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/sprite at a directory, and watch it sprite away!
+point bin/spriter at a directory, and watch it sprite away!
== Installation - standalone
- sudo gem install spittle
+ sudo gem install spriter
=== Usage - standalone
- sprite <directory>
+ 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:
- sprite -h
+ spriter -h
== Installation - Rails plugin
- script/plugin install git://github.com/aberant/spittle.git
+ script/plugin install git://github.com/aberant/spriter.git
=== Usage - Rails plugin
@@ -47,7 +47,7 @@ Spittle assumes all of your sprites are located in the directory public/images/s
Running sprite:generate does all the work. Each sprite directory (cars, planes) will now contain a sprite.png. Spittle will also generate a sprites.css stylesheet in public/stylesheets/ that you should include in your layout. If you wished to use the ford image from the cars sprite you would give the 'cars_ford' class to the desired element in the view. That's it!
-Check out examples/sprites if you want to see what spittle can do without doing any work.
+Check out examples/sprites if you want to see what spriter can do without doing any work.
== Limitations
View
6 Rakefile
@@ -4,11 +4,11 @@ require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
- gem.name = "spittle"
+ gem.name = "spriter"
gem.summary = %Q{pure ruby PNG spriting library}
- gem.description = %Q{Spittle is a pure ruby PNG spriting library. It can be used standalone or as a Rails plugin, see the readme for details.}
+ gem.description = %Q{Spriter is a pure ruby PNG spriting library. It can be used standalone or as a Rails plugin, see the readme for details.}
gem.email = ["qzzzq1@gmail.com", "tyler.jennings@gmail.com"]
- gem.homepage = "http://github.com/aberant/spittle"
+ gem.homepage = "http://github.com/aberant/spriter"
gem.authors = ["aberant", "tjennings"]
gem.add_development_dependency "rspec" #, ">= 1.2.9"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
View
2  bin/png_info
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require File.join( File.dirname( __FILE__ ), '..', 'lib', 'spittle' )
+require File.join( File.dirname( __FILE__ ), '..', 'lib', 'spriter' )
module PNG
class Parser
View
8 bin/sprite → bin/spriter
@@ -1,12 +1,12 @@
#!/usr/bin/env ruby
require 'optparse'
-require File.dirname(__FILE__) + "/../lib/spittle.rb"
+require File.dirname(__FILE__) + "/../lib/spriter.rb"
options = {}
opts = OptionParser.new do |opts|
- opts.banner = "Usage: spittle [options] directory"
+ opts.banner = "Usage: spriter [options] directory"
opts.on("-c", "--cleanup", "Remove all generated files") do |file|
options[:cleanup] = true
@@ -20,7 +20,7 @@ opts = OptionParser.new do |opts|
options[:path_prefix] = prefix
end
- opts.on_tail("-h", "--help", "Prints this message") do
+ opts.on_tail("-h", "--help", "Prints this message") do
puts opts
exit
end
@@ -36,7 +36,7 @@ unless dir
end
options[:source] = dir
-processor = Spittle::Processor.new(options)
+processor = Spriter::Processor.new(options)
if options[:cleanup]
processor.cleanup
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', 'spittle' )
+require File.join( File.dirname( __FILE__ ), '..', 'lib', '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 spittle run:
+ Hello. See spriter run:
<div class="words_of">of</div>
<div class="words_latitude">latitude</div>
<div class="words_set">set</div>
View
18 lib/spittle.rb
@@ -1,18 +0,0 @@
-require 'zlib'
-
-$:.unshift( File.dirname( __FILE__ ))
-
-require 'spittle/png/file_header'
-require 'spittle/png/parser'
-require 'spittle/png/filters'
-require 'spittle/png/chunk'
-require 'spittle/png/ihdr'
-require 'spittle/png/idat'
-require 'spittle/png/iend'
-require 'spittle/png/image'
-require 'spittle/sprite'
-require 'spittle/directory_processor'
-require 'spittle/stylesheet_builder'
-require 'spittle/processor'
-require 'spittle/mtime_tracker'
-require 'spittle/image_data'
View
18 lib/spriter.rb
@@ -0,0 +1,18 @@
+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
0  lib/spittle/directory_processor.rb → lib/spriter/directory_processor.rb
File renamed without changes
View
2  lib/spittle/image_data.rb → lib/spriter/image_data.rb
@@ -1,6 +1,6 @@
require 'enumerator'
-module Spittle
+module Spriter
class ImageData
RGB_WIDTH = 3
RGBA_WIDTH = 4
View
0  lib/spittle/mtime_tracker.rb → lib/spriter/mtime_tracker.rb
File renamed without changes
View
0  lib/spittle/png/chunk.rb → lib/spriter/png/chunk.rb
File renamed without changes
View
0  lib/spittle/png/file_header.rb → lib/spriter/png/file_header.rb
File renamed without changes
View
0  lib/spittle/png/filters.rb → lib/spriter/png/filters.rb
File renamed without changes
View
0  lib/spittle/png/idat.rb → lib/spriter/png/idat.rb
File renamed without changes
View
0  lib/spittle/png/iend.rb → lib/spriter/png/iend.rb
File renamed without changes
View
6 lib/spittle/png/ihdr.rb → lib/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, spittle only supports non-interlaced images" unless interlace == 0
- raise "for now, spittle only supports images with a bit depth of 8" unless depth == 8
+ 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
unless SUPPORTED_COLOR_TYPES.include? color_type
- raise "for now, spittle only supports color types #{SUPPORTED_COLOR_TYPES.JOIN(',')} color type was #{color_type}"
+ raise "for now, 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/spittle/png/image.rb → lib/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 = Spittle::ImageData.new(:scanline_width => scanline_width - 1,
+ n_out = Spriter::ImageData.new(:scanline_width => scanline_width - 1,
:pixel_width => pixel_width,
:name => self.name,
:data => Array.new(height))
View
0  lib/spittle/png/parser.rb → lib/spriter/png/parser.rb
File renamed without changes
View
2  lib/spittle/processor.rb → lib/spriter/processor.rb
@@ -1,4 +1,4 @@
-module Spittle
+module Spriter
class Processor
def initialize(opts)
@options = opts
View
0  lib/spittle/sprite.rb → lib/spriter/sprite.rb
File renamed without changes
View
0  lib/spittle/stylesheet_builder.rb → lib/spriter/stylesheet_builder.rb
File renamed without changes
View
8 spec/image_data_spec.rb
@@ -1,10 +1,10 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe Spittle::ImageData do
+describe Spriter::ImageData do
before do
data = [[1,2,3],
[4,5,6]]
- @id = Spittle::ImageData.new(:scanline_width => 3, :pixel_width => 3, :data => data)
+ @id = Spriter::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 = Spittle::ImageData.new
+ id = Spriter::ImageData.new
id.empty?.should be_true
end
it "should return nil when asked for an index that doesn't exist" do
- id = Spittle::ImageData.new
+ id = Spriter::ImageData.new
id[0].should be_nil
end
View
8 spec/integration_spec.rb
@@ -114,12 +114,12 @@
before :all do
@dir = File.dirname(__FILE__) + "/sprite_dirs"
@css_file = @dir + "/sprite.css"
- @spittle = Spittle::Processor.new(:path_prefix => "/images", :source => @dir, :css_file => @css_file)
- @spittle.write
+ @spriter = Spriter::Processor.new(:path_prefix => "/images", :source => @dir, :css_file => @css_file)
+ @spriter.write
end
after :all do
- @spittle.cleanup
+ @spriter.cleanup
#making sure it cleans things up - shitty place for these
File.exists?(@css_file).should be_false
File.exists?(@dir + "/words/sprite.png").should be_false
@@ -131,7 +131,7 @@
end
it "can find all the sprite directories" do
- dirs = @spittle.directories.map{|d| d.split('/').last}
+ dirs = @spriter.directories.map{|d| d.split('/').last}
dirs.should include( "words" )
end
View
8 spec/spec_helper.rb
@@ -1,10 +1,10 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'rubygems'
-require 'spittle'
+# $LOAD_PATH.unshift(File.dirname(__FILE__))
+# $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'spec'
require 'spec/autorun'
+require 'spriter'
+
require 'builders/image_builder'
Spec::Runner.configure do |config|
View
18 tasks/spittle_tasks.rake
@@ -1,8 +1,8 @@
#TODO - make this a rake task instead of a function
-module Spittle
+module Spriter
def self.setup
require 'fileutils'
- require File.dirname(__FILE__) + "/../lib/spittle.rb"
+ require File.dirname(__FILE__) + "/../lib/spriter.rb"
FileUtils.cd(RAILS_ROOT + "/public/images")
opts = {:source => "sprites",
@@ -11,15 +11,15 @@ module Spittle
end
end
-namespace :sprite do
+namespace :sprite do
desc "Generates sprite images and stylesheets"
- task :generate do
- opts = Spittle.setup
- Spittle::Processor.new(opts).write
+ task :generate do
+ opts = Spriter.setup
+ Spriter::Processor.new(opts).write
end
desc "Removes generated sprite images and stylesheets"
- task :cleanup do
- opts = Spittle.setup
- Spittle::Processor.new(opts).cleanup
+ task :cleanup do
+ opts = Spriter.setup
+ Spriter::Processor.new(opts).cleanup
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.