Skip to content
This repository
Browse code

lets rename it to something that's not already taken

  • Loading branch information...
commit 9776ec1954c1ed126a7703502220dc4e9849ba94 1 parent 8954464
colin harris authored

Showing 26 changed files with 49 additions and 49 deletions. Show diff stats Hide diff stats

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

0 comments on commit 9776ec1

Please sign in to comment.
Something went wrong with that request. Please try again.