diff --git a/CHANGELOG b/CHANGELOG index 519da063..d093c887 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ + * instiki-ar + SQL-based backend (ActiveRecord) + Upgrade to RedCloth 3.0.4 + Replaced internal link generator with routing + Fixed --daemon option + * 0.10.2: Upgraded to Rails 0.13.1 Fixed HTML export diff --git a/instiki.gemspec b/instiki.gemspec index c65ac414..caeee714 100755 --- a/instiki.gemspec +++ b/instiki.gemspec @@ -24,7 +24,7 @@ spec = Gem::Specification.new do |s| s.has_rdoc = false - s.add_dependency('RedCloth', '= 3.0.3') + s.add_dependency('RedCloth', '= 3.0.4') s.add_dependency('rubyzip', '= 0.5.8') s.add_dependency('rails', '= 0.13.1') s.add_dependency('sqlite3-ruby', '= 1.1.0') diff --git a/script/import_storage b/script/import_storage index 3e4ef512..0f6d6b21 100755 --- a/script/import_storage +++ b/script/import_storage @@ -84,7 +84,7 @@ ADDITIONAL_LOAD_PATHS = %w( app/models lib vendor/madeleine-0.7.1/lib - vendor/RedCloth-3.0.3/lib + vendor/RedCloth-3.0.4/lib vendor/rubyzip-0.5.8/lib ).map { |dir| "#{File.expand_path(File.join(INSTIKI_ROOT, dir))}" }.delete_if { |dir| not File.exist?(dir) } diff --git a/vendor/RedCloth-3.0.3/RedCloth.gemspec b/vendor/RedCloth-3.0.3/RedCloth.gemspec deleted file mode 100644 index ca64b780..00000000 --- a/vendor/RedCloth-3.0.3/RedCloth.gemspec +++ /dev/null @@ -1,52 +0,0 @@ -require 'rubygems' -spec = Gem::Specification.new do |s| - - ## Basic Information - - s.name = 'RedCloth' - s.version = "3.0.3" - s.platform = Gem::Platform::RUBY - s.summary = <<-TXT - RedCloth is a module for using Textile and Markdown in Ruby. Textile and Markdown are text formats. - A very simple text format. Another stab at making readable text that can be converted to HTML. - TXT - s.description = <<-TXT - No need to use verbose HTML to build your docs, your blogs, your pages. Textile gives you readable text while you're writing and beautiful text for your readers. And if you need to break out into HTML, Textile will allow you to do so. - - Textile also handles some subtleties of formatting which will enhance your document's readability: - - * Single- and double-quotes around words or phrases are converted to curly quotations, much easier on - the eye. "Observe!" - - * Double hyphens are replaced with an em-dash. Observe -- very nice! - - * Single hyphens are replaced with en-dashes. Observe - so cute! - - * Triplets of periods become an ellipsis. Observe... - - * The letter 'x' becomes a dimension sign when used alone. Observe: 2 x 2. - - * Conversion of ==(TM)== to (TM), ==(R)== to (R), ==(C)== to (C). - - For more on Textile's language, hop over to "A Textile Reference":http://hobix.com/textile/. For more - on Markdown, see "Daring Fireball's page":http://daringfireball.net/projects/markdown/. - TXT - - ## Include tests, libs, docs - - s.files = ['bin/**/*', 'tests/**/*', 'lib/**/*', 'docs/**/*', 'run-tests.rb'].collect do |dirglob| - Dir.glob(dirglob) - end.flatten.delete_if {|item| item.include?("CVS")} - - ## Load-time details - - s.require_path = 'lib' - s.autorequire = 'redcloth' - - ## Author and project details - - s.author = "Why the Lucky Stiff" - s.email = "why@ruby-lang.org" - s.rubyforge_project = "redcloth" - s.homepage = "http://www.whytheluckystiff.net/ruby/redcloth/" -end diff --git a/vendor/RedCloth-3.0.3/install.rb b/vendor/RedCloth-3.0.3/install.rb deleted file mode 100644 index 2313f9e9..00000000 --- a/vendor/RedCloth-3.0.3/install.rb +++ /dev/null @@ -1,1032 +0,0 @@ -#!/usr/local/bin/ruby -# -# This file is automatically generated. DO NOT MODIFY! -# -# install.rb -# -# Copyright (c) 2000-2002 Minero Aoki -# -# This program is free software. -# You can distribute/modify this program under the terms of -# the GNU Lesser General Public License version 2. -# - -### begin compat.rb - -unless Enumerable.instance_methods.include? 'inject' then -module Enumerable - def inject( result ) - each do |i| - result = yield(result, i) - end - result - end -end -end - -def File.read_all( fname ) - File.open(fname, 'rb') {|f| return f.read } -end - -def File.write( fname, str ) - File.open(fname, 'wb') {|f| f.write str } -end - -### end compat.rb -### begin config.rb - -if i = ARGV.index(/\A--rbconfig=/) then - file = $' - ARGV.delete_at(i) - require file -else - require 'rbconfig' -end - - -class ConfigTable - - c = ::Config::CONFIG - - rubypath = c['bindir'] + '/' + c['ruby_install_name'] - - major = c['MAJOR'].to_i - minor = c['MINOR'].to_i - teeny = c['TEENY'].to_i - version = "#{major}.#{minor}" - - # ruby ver. >= 1.4.4? - newpath_p = ((major >= 2) or - ((major == 1) and - ((minor >= 5) or - ((minor == 4) and (teeny >= 4))))) - - re = Regexp.new('\A' + Regexp.quote(c['prefix'])) - subprefix = lambda {|path| - re === path and path.sub(re, '$prefix') - } - - if c['rubylibdir'] then - # 1.6.3 < V - stdruby = subprefix.call(c['rubylibdir']) - siteruby = subprefix.call(c['sitedir']) - versite = subprefix.call(c['sitelibdir']) - sodir = subprefix.call(c['sitearchdir']) - elsif newpath_p then - # 1.4.4 <= V <= 1.6.3 - stdruby = "$prefix/lib/ruby/#{version}" - siteruby = subprefix.call(c['sitedir']) - versite = siteruby + '/' + version - sodir = "$site-ruby/#{c['arch']}" - else - # V < 1.4.4 - stdruby = "$prefix/lib/ruby/#{version}" - siteruby = "$prefix/lib/ruby/#{version}/site_ruby" - versite = siteruby - sodir = "$site-ruby/#{c['arch']}" - end - - DESCRIPTER = [ - [ 'prefix', [ c['prefix'], - 'path', - 'path prefix of target environment' ] ], - [ 'std-ruby', [ stdruby, - 'path', - 'the directory for standard ruby libraries' ] ], - [ 'site-ruby-common', [ siteruby, - 'path', - 'the directory for version-independent non-standard ruby libraries' ] ], - [ 'site-ruby', [ versite, - 'path', - 'the directory for non-standard ruby libraries' ] ], - [ 'bin-dir', [ '$prefix/bin', - 'path', - 'the directory for commands' ] ], - [ 'rb-dir', [ '$site-ruby', - 'path', - 'the directory for ruby scripts' ] ], - [ 'so-dir', [ sodir, - 'path', - 'the directory for ruby extentions' ] ], - [ 'data-dir', [ '$prefix/share', - 'path', - 'the directory for shared data' ] ], - [ 'ruby-path', [ rubypath, - 'path', - 'path to set to #! line' ] ], - [ 'ruby-prog', [ rubypath, - 'name', - 'the ruby program using for installation' ] ], - [ 'make-prog', [ 'make', - 'name', - 'the make program to compile ruby extentions' ] ], - [ 'without-ext', [ 'no', - 'yes/no', - 'does not compile/install ruby extentions' ] ] - ] - - SAVE_FILE = 'config.save' - - def ConfigTable.each_name( &block ) - keys().each( &block ) - end - - def ConfigTable.keys - DESCRIPTER.collect {|k,*dummy| k } - end - - def ConfigTable.each_definition( &block ) - DESCRIPTER.each( &block ) - end - - def ConfigTable.get_entry( name ) - name, ent = DESCRIPTER.assoc(name) - ent - end - - def ConfigTable.get_entry!( name ) - get_entry(name) or raise ArgumentError, "no such config: #{name}" - end - - def ConfigTable.add_entry( name, vals ) - ConfigTable::DESCRIPTER.push [name,vals] - end - - def ConfigTable.remove_entry( name ) - get_entry name or raise ArgumentError, "no such config: #{name}" - DESCRIPTER.delete_if {|n,arr| n == name } - end - - def ConfigTable.config_key?( name ) - get_entry(name) ? true : false - end - - def ConfigTable.bool_config?( name ) - ent = get_entry(name) or return false - ent[1] == 'yes/no' - end - - def ConfigTable.value_config?( name ) - ent = get_entry(name) or return false - ent[1] != 'yes/no' - end - - def ConfigTable.path_config?( name ) - ent = get_entry(name) or return false - ent[1] == 'path' - end - - - class << self - - alias newobj new - - def new - c = newobj() - c.__send__ :init - c - end - - def load - c = newobj() - File.file? SAVE_FILE or - raise InstallError, "#{File.basename $0} config first" - File.foreach( SAVE_FILE ) do |line| - k, v = line.split( '=', 2 ) - c.instance_eval { - @table[k] = v.strip - } - end - c - end - - end - - def initialize - @table = {} - end - - def init - DESCRIPTER.each do |k, (default, vname, desc, default2)| - @table[k] = default - end - end - private :init - - def save - File.open( SAVE_FILE, 'w' ) {|f| - @table.each do |k, v| - f.printf "%s=%s\n", k, v if v - end - } - end - - def []=( k, v ) - ConfigTable.config_key? k or raise InstallError, "unknown config option #{k}" - if ConfigTable.path_config? k then - @table[k] = (v[0,1] != '$') ? File.expand_path(v) : v - else - @table[k] = v - end - end - - def []( key ) - @table[key] or return nil - @table[key].gsub( %r<\$([^/]+)> ) { self[$1] } - end - - def set_raw( key, val ) - @table[key] = val - end - - def get_raw( key ) - @table[key] - end - -end - - -class MetaConfigEnvironment - - def self.eval_file( file ) - return unless File.file? file - new.instance_eval File.read_all(file), file, 1 - end - - private - - def config_names - ConfigTable.keys - end - - def config?( name ) - ConfigTable.config_key? name - end - - def bool_config?( name ) - ConfigTable.bool_config? name - end - - def value_config?( name ) - ConfigTable.value_config? name - end - - def path_config?( name ) - ConfigTable.path_config? name - end - - def add_config( name, argname, default, desc ) - ConfigTable.add_entry name,[default,argname,desc] - end - - def add_path_config( name, default, desc ) - add_config name, 'path', default, desc - end - - def add_bool_config( name, default, desc ) - add_config name, 'yes/no', default ? 'yes' : 'no', desc - end - - def set_config_default( name, default ) - if bool_config? name then - ConfigTable.get_entry!(name)[0] = default ? 'yes' : 'no' - else - ConfigTable.get_entry!(name)[0] = default - end - end - - def remove_config( name ) - ent = ConfigTable.get_entry(name) - ConfigTable.remove_entry name - ent - end - -end - -### end config.rb -### begin fileop.rb - -module FileOperations - - def mkdir_p( dname, prefix = nil ) - dname = prefix + dname if prefix - $stderr.puts "mkdir -p #{dname}" if verbose? - return if no_harm? - - # does not check '/'... it's too abnormal case - dirs = dname.split(%r_(?=/)_) - if /\A[a-z]:\z/i === dirs[0] then - disk = dirs.shift - dirs[0] = disk + dirs[0] - end - dirs.each_index do |idx| - path = dirs[0..idx].join('') - Dir.mkdir path unless dir? path - end - end - - def rm_f( fname ) - $stderr.puts "rm -f #{fname}" if verbose? - return if no_harm? - - if File.exist? fname or File.symlink? fname then - File.chmod 0777, fname - File.unlink fname - end - end - - def rm_rf( dn ) - $stderr.puts "rm -rf #{dn}" if verbose? - return if no_harm? - - Dir.chdir dn - Dir.foreach('.') do |fn| - next if fn == '.' - next if fn == '..' - if dir? fn then - verbose_off { - rm_rf fn - } - else - verbose_off { - rm_f fn - } - end - end - Dir.chdir '..' - Dir.rmdir dn - end - - def mv( src, dest ) - rm_f dest - begin - File.link src, dest - rescue - File.write dest, File.read_all(src) - File.chmod File.stat(src).mode, dest - end - rm_f src - end - - def install( from, dest, mode, prefix = nil ) - $stderr.puts "install #{from} #{dest}" if verbose? - return if no_harm? - - realdest = prefix + dest if prefix - if dir? realdest then - realdest += '/' + File.basename(from) - end - str = File.read_all(from) - if diff? str, realdest then - verbose_off { - rm_f realdest if File.exist? realdest - } - File.write realdest, str - File.chmod mode, realdest - - File.open( objdir + '/InstalledFiles', 'a' ) {|f| f.puts realdest } - end - end - - def diff?( orig, targ ) - return true unless File.exist? targ - orig != File.read_all(targ) - end - - def command( str ) - $stderr.puts str if verbose? - system str or raise RuntimeError, "'system #{str}' failed" - end - - def ruby( str ) - command config('ruby-prog') + ' ' + str - end - - def dir?( dname ) - # for corrupted windows stat() - File.directory?( (dname[-1,1] == '/') ? dname : dname + '/' ) - end - - def all_files( dname ) - Dir.open( dname ) {|d| - return d.find_all {|n| File.file? "#{dname}/#{n}" } - } - end - - def all_dirs( dname ) - Dir.open( dname ) {|d| - return d.find_all {|n| dir? "#{dname}/#{n}" } - %w(. ..) - } - end - -end - -### end fileop.rb -### begin base.rb - -class InstallError < StandardError; end - - -class Installer - - Version = '3.1.2' - Copyright = 'Copyright (c) 2000-2002 Minero Aoki' - - - @toplevel = nil - - def self.declear_toplevel_installer( inst ) - @toplevel and - raise ArgumentError, 'more than one toplevel installer decleared' - @toplevel = inst - end - - def self.toplevel_installer - @toplevel - end - - - FILETYPES = %w( bin lib ext data ) - - include FileOperations - - def initialize( config, opt, srcroot, objroot ) - @config = config - @options = opt - @srcdir = File.expand_path(srcroot) - @objdir = File.expand_path(objroot) - @currdir = '.' - end - - def inspect - "#<#{type} #{__id__}>" - end - - # - # configs/options - # - - def get_config( key ) - @config[key] - end - - alias config get_config - - def set_config( key, val ) - @config[key] = val - end - - def no_harm? - @options['no-harm'] - end - - def verbose? - @options['verbose'] - end - - def verbose_off - save, @options['verbose'] = @options['verbose'], false - yield - @options['verbose'] = save - end - - # - # srcdir/objdir - # - - attr_reader :srcdir - alias srcdir_root srcdir - alias package_root srcdir - - def curr_srcdir - "#{@srcdir}/#{@currdir}" - end - - attr_reader :objdir - alias objdir_root objdir - - def curr_objdir - "#{@objdir}/#{@currdir}" - end - - def srcfile( path ) - curr_srcdir + '/' + path - end - - def srcexist?( path ) - File.exist? srcfile(path) - end - - def srcdirectory?( path ) - dir? srcfile(path) - end - - def srcfile?( path ) - File.file? srcfile(path) - end - - def srcentries( path = '.' ) - Dir.open( curr_srcdir + '/' + path ) {|d| - return d.to_a - %w(. ..) - hookfilenames - } - end - - def srcfiles( path = '.' ) - srcentries(path).find_all {|fname| - File.file? File.join(curr_srcdir, path, fname) - } - end - - def srcdirectories( path = '.' ) - srcentries(path).find_all {|fname| - dir? File.join(curr_srcdir, path, fname) - } - end - - def dive_into( rel ) - return unless dir? "#{@srcdir}/#{rel}" - - dir = File.basename(rel) - Dir.mkdir dir unless dir? dir - save = Dir.pwd - Dir.chdir dir - $stderr.puts '---> ' + rel if verbose? - @currdir = rel - yield - Dir.chdir save - $stderr.puts '<--- ' + rel if verbose? - @currdir = File.dirname(rel) - end - - # - # config - # - - def exec_config - exec_task_traverse 'config' - end - - def config_dir_bin( rel ) - end - - def config_dir_lib( rel ) - end - - def config_dir_ext( rel ) - extconf if extdir? curr_srcdir - end - - def extconf - opt = @options['config-opt'].join(' ') - command "#{config('ruby-prog')} #{curr_srcdir}/extconf.rb #{opt}" - end - - def config_dir_data( rel ) - end - - # - # setup - # - - def exec_setup - exec_task_traverse 'setup' - end - - def setup_dir_bin( relpath ) - all_files( curr_srcdir ).each do |fname| - add_rubypath "#{curr_srcdir}/#{fname}" - end - end - - SHEBANG_RE = /\A\#!\s*\S*ruby\S*/ - - def add_rubypath( path ) - $stderr.puts %Q if verbose? - return if no_harm? - - tmpfile = File.basename(path) + '.tmp' - begin - File.open( path ) {|r| - File.open( tmpfile, 'w' ) {|w| - first = r.gets - return unless SHEBANG_RE === first # reject '/usr/bin/env ruby' - - w.print first.sub( SHEBANG_RE, '#!' + config('ruby-path') ) - w.write r.read - } } - mv tmpfile, File.basename(path) - ensure - rm_f tmpfile if File.exist? tmpfile - end - end - - def setup_dir_lib( relpath ) - end - - def setup_dir_ext( relpath ) - if extdir? curr_srcdir then - make - end - end - - def make - command config('make-prog') - end - - def setup_dir_data( relpath ) - end - - # - # install - # - - def exec_install - exec_task_traverse 'install' - end - - def install_dir_bin( rel ) - install_files targfiles, config('bin-dir') + '/' + rel, 0755 - end - - def install_dir_lib( rel ) - install_files targfiles, config('rb-dir') + '/' + rel, 0644 - begin - require 'rdoc/rdoc' - ri_site = true - if RDOC_VERSION =~ /^0\./ - require 'rdoc/options' - unless Options::OptionList::OPTION_LIST.assoc('--ri-site') - ri_site = false - end - end - if ri_site - r = RDoc::RDoc.new - r.document(%w{--ri-site}) - end - rescue - puts "** Unable to install Ri documentation for RedCloth **" - end - end - - def install_dir_ext( rel ) - if extdir? curr_srcdir then - install_dir_ext_main File.dirname(rel) - end - end - - def install_dir_ext_main( rel ) - install_files allext('.'), config('so-dir') + '/' + rel, 0555 - end - - def install_dir_data( rel ) - install_files targfiles, config('data-dir') + '/' + rel, 0644 - end - - def install_files( list, dest, mode ) - mkdir_p dest, @options['install-prefix'] - list.each do |fname| - install fname, dest, mode, @options['install-prefix'] - end - end - - def targfiles - (targfilenames() - hookfilenames()).collect {|fname| - File.exist?(fname) ? fname : File.join(curr_srcdir(), fname) - } - end - - def targfilenames - [ curr_srcdir(), '.' ].inject([]) {|ret, dir| - ret | all_files(dir) - } - end - - def hookfilenames - %w( pre-%s post-%s pre-%s.rb post-%s.rb ).collect {|fmt| - %w( config setup install clean ).collect {|t| sprintf fmt, t } - }.flatten - end - - def allext( dir ) - _allext(dir) or raise InstallError, - "no extention exists: Have you done 'ruby #{$0} setup' ?" - end - - DLEXT = /\.#{ ::Config::CONFIG['DLEXT'] }\z/ - - def _allext( dir ) - Dir.open( dir ) {|d| - return d.find_all {|fname| DLEXT === fname } - } - end - - # - # clean - # - - def exec_clean - exec_task_traverse 'clean' - rm_f 'config.save' - rm_f 'InstalledFiles' - end - - def clean_dir_bin( rel ) - end - - def clean_dir_lib( rel ) - end - - def clean_dir_ext( rel ) - clean - end - - def clean - command config('make-prog') + ' clean' if File.file? 'Makefile' - end - - def clean_dir_data( rel ) - end - - # - # lib - # - - def exec_task_traverse( task ) - run_hook 'pre-' + task - FILETYPES.each do |type| - if config('without-ext') == 'yes' and type == 'ext' then - $stderr.puts 'skipping ext/* by user option' if verbose? - next - end - traverse task, type, task + '_dir_' + type - end - run_hook 'post-' + task - end - - def traverse( task, rel, mid ) - dive_into( rel ) { - run_hook 'pre-' + task - __send__ mid, rel.sub( %r_\A.*?(?:/|\z)_, '' ) - all_dirs( curr_srcdir ).each do |d| - traverse task, rel + '/' + d, mid - end - run_hook 'post-' + task - } - end - - def run_hook( name ) - try_run_hook curr_srcdir + '/' + name or - try_run_hook curr_srcdir + '/' + name + '.rb' - end - - def try_run_hook( fname ) - return false unless File.file? fname - - env = self.dup - begin - env.instance_eval File.read_all(fname), fname, 1 - rescue - raise InstallError, "hook #{fname} failed:\n" + $!.message - end - true - end - - def extdir?( dir ) - File.exist? dir + '/MANIFEST' - end - -end - -### end base.rb -### begin toplevel.rb - -class ToplevelInstaller < Installer - - TASKS = [ - [ 'config', 'saves your configurations' ], - [ 'show', 'shows current configuration' ], - [ 'setup', 'compiles extention or else' ], - [ 'install', 'installs files' ], - [ 'clean', "does `make clean' for each extention" ] - ] - - - def initialize( root ) - super nil, {'verbose' => true}, root, '.' - Installer.declear_toplevel_installer self - end - - - def execute - run_metaconfigs - - case task = parsearg_global() - when 'config' - @config = ConfigTable.new - else - @config = ConfigTable.load - end - parsearg_TASK task - - exectask task - end - - - def run_metaconfigs - MetaConfigEnvironment.eval_file "#{srcdir_root}/#{metaconfig}" - end - - def metaconfig - 'metaconfig' - end - - - def exectask( task ) - if task == 'show' then - exec_show - else - try task - end - end - - def try( task ) - $stderr.printf "#{File.basename $0}: entering %s phase...\n", task if verbose? - begin - __send__ 'exec_' + task - rescue - $stderr.printf "%s failed\n", task - raise - end - $stderr.printf "#{File.basename $0}: %s done.\n", task if verbose? - end - - # - # processing arguments - # - - def parsearg_global - task_re = /\A(?:#{TASKS.collect {|i| i[0] }.join '|'})\z/ - - while arg = ARGV.shift do - case arg - when /\A\w+\z/ - task_re === arg or raise InstallError, "wrong task: #{arg}" - return arg - - when '-q', '--quiet' - @options['verbose'] = false - - when '--verbose' - @options['verbose'] = true - - when '-h', '--help' - print_usage $stdout - exit 0 - - when '-v', '--version' - puts "#{File.basename $0} version #{Version}" - exit 0 - - when '--copyright' - puts Copyright - exit 0 - - else - raise InstallError, "unknown global option '#{arg}'" - end - end - - raise InstallError, 'no task or global option given' - end - - - def parsearg_TASK( task ) - mid = "parsearg_#{task}" - if respond_to? mid, true then - __send__ mid - else - ARGV.empty? or - raise InstallError, "#{task}: unknown options: #{ARGV.join ' '}" - end - end - - def parsearg_config - re = /\A--(#{ConfigTable.keys.join '|'})(?:=(.*))?\z/ - @options['config-opt'] = [] - - while i = ARGV.shift do - if /\A--?\z/ === i then - @options['config-opt'] = ARGV.dup - break - end - m = re.match(i) or raise InstallError, "config: unknown option #{i}" - name, value = m.to_a[1,2] - if value then - if ConfigTable.bool_config?(name) then - /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i === value or raise InstallError, "config: --#{name} allows only yes/no for argument" - value = (/\Ay(es)?|\At(rue)/i === value) ? 'yes' : 'no' - end - else - ConfigTable.bool_config?(name) or raise InstallError, "config: --#{name} requires argument" - value = 'yes' - end - @config[name] = value - end - end - - def parsearg_install - @options['no-harm'] = false - @options['install-prefix'] = '' - while a = ARGV.shift do - case a - when /\A--no-harm\z/ - @options['no-harm'] = true - when /\A--prefix=(.*)\z/ - path = $1 - path = File.expand_path(path) unless path[0,1] == '/' - @options['install-prefix'] = path - else - raise InstallError, "install: unknown option #{a}" - end - end - end - - - def print_usage( out ) - out.puts - out.puts 'Usage:' - out.puts " ruby #{File.basename $0} " - out.puts " ruby #{File.basename $0} [] []" - - fmt = " %-20s %s\n" - out.puts - out.puts 'Global options:' - out.printf fmt, '-q,--quiet', 'suppress message outputs' - out.printf fmt, ' --verbose', 'output messages verbosely' - out.printf fmt, '-h,--help', 'print this message' - out.printf fmt, '-v,--version', 'print version and quit' - out.printf fmt, '--copyright', 'print copyright and quit' - - out.puts - out.puts 'Tasks:' - TASKS.each do |name, desc| - out.printf " %-10s %s\n", name, desc - end - - out.puts - out.puts 'Options for config:' - ConfigTable.each_definition do |name, (default, arg, desc, default2)| - out.printf " %-20s %s [%s]\n", - '--'+ name + (ConfigTable.bool_config?(name) ? '' : '='+arg), - desc, - default2 || default - end - out.printf " %-20s %s [%s]\n", - '--rbconfig=path', 'your rbconfig.rb to load', "running ruby's" - - out.puts - out.puts 'Options for install:' - out.printf " %-20s %s [%s]\n", - '--no-harm', 'only display what to do if given', 'off' - - out.puts - end - - # - # config - # - - def exec_config - super - @config.save - end - - # - # show - # - - def exec_show - ConfigTable.each_name do |k| - v = @config.get_raw(k) - if not v or v.empty? then - v = '(not specified)' - end - printf "%-10s %s\n", k, v - end - end - -end - -### end toplevel.rb - -if $0 == __FILE__ then - begin - installer = ToplevelInstaller.new( Dir.pwd ) - installer.execute - rescue - raise if $DEBUG - $stderr.puts $!.message - $stderr.puts "try 'ruby #{$0} --help' for usage" - exit 1 - end -end diff --git a/vendor/RedCloth-3.0.3/bin/redcloth b/vendor/RedCloth-3.0.4/bin/redcloth similarity index 70% rename from vendor/RedCloth-3.0.3/bin/redcloth rename to vendor/RedCloth-3.0.4/bin/redcloth index 81abf7db..ae210b6a 100644 --- a/vendor/RedCloth-3.0.3/bin/redcloth +++ b/vendor/RedCloth-3.0.4/bin/redcloth @@ -1,3 +1,3 @@ -#!/usr/local/bin/ruby18 +#!/usr/bin/ruby18 require 'redcloth' puts RedCloth.new( ARGF.read ).to_html diff --git a/vendor/RedCloth-3.0.3/doc/CHANGELOG b/vendor/RedCloth-3.0.4/doc/CHANGELOG similarity index 92% rename from vendor/RedCloth-3.0.3/doc/CHANGELOG rename to vendor/RedCloth-3.0.4/doc/CHANGELOG index 7b5f9cf3..0581447c 100644 --- a/vendor/RedCloth-3.0.3/doc/CHANGELOG +++ b/vendor/RedCloth-3.0.4/doc/CHANGELOG @@ -1,4 +1,15 @@ --- %YAML:1.0 +- version: 3.0.4 + date: 2005-02-18 + changes: + - The caps class doesn't swallow spaces. + - Horizontal rules required to be on an empty line. + - Hard breaks don't screw with Markdown headers any longer. + - Fixed error triggered by complex lists. + - Inline markups need to be butted up against enclosing text, no spaces. + - Fixed problem with intermingled single and double quotes. + - Brought back lite_mode. + - version: 3.0.3 date: 2005-02-06 changes: diff --git a/vendor/RedCloth-3.0.3/doc/COPYING b/vendor/RedCloth-3.0.4/doc/COPYING similarity index 100% rename from vendor/RedCloth-3.0.3/doc/COPYING rename to vendor/RedCloth-3.0.4/doc/COPYING diff --git a/vendor/RedCloth-3.0.3/doc/README b/vendor/RedCloth-3.0.4/doc/README similarity index 91% rename from vendor/RedCloth-3.0.3/doc/README rename to vendor/RedCloth-3.0.4/doc/README index 1ae4560c..1c0b0f38 100644 --- a/vendor/RedCloth-3.0.3/doc/README +++ b/vendor/RedCloth-3.0.4/doc/README @@ -4,9 +4,7 @@ p=. !redcloth3-title.png! h4. Get RedCloth 3 -p(example1). *Stable version:* "2.0.11":http://rubyforge.org/frs/download.php/698/redcloth-2.0.11.tar.gz - -p(example1). *Unstable version:* "3.0.2":http://rubyforge.org/frs/download.php/2852/RedCloth-3.0.2.tar.gz +p(example1). *Stable version:* "3.0.3":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz Take a complete tour of Textile at "A Textile Reference":http://hobix.com/textile/. @@ -91,7 +89,7 @@ To install RedCloth via RubyGems: gem install RedCloth -Or "download RedCloth":http://rubyforge.org/frs/download.php/2852/RedCloth-3.0.2.tar.gz and simply run the install.rb like so: +Or "download RedCloth":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz and simply run the install.rb like so:
   ruby install.rb config
diff --git a/vendor/RedCloth-3.0.3/doc/REFERENCE b/vendor/RedCloth-3.0.4/doc/REFERENCE
similarity index 98%
rename from vendor/RedCloth-3.0.3/doc/REFERENCE
rename to vendor/RedCloth-3.0.4/doc/REFERENCE
index a3e5bec0..c7236e89 100644
--- a/vendor/RedCloth-3.0.3/doc/REFERENCE
+++ b/vendor/RedCloth-3.0.4/doc/REFERENCE
@@ -24,9 +24,9 @@
     if it's found in a @pre@ or @code@ block.
   - !!example "I am very serious.\n\n
\n  I am very serious.\n
" - h4. Line Breaks - - Line breaks are converted to HTML breaks. + - Line breaks are ignored. - !!example "I spoke.\nAnd none replied." - - Line breaks can be disabled in RedCloth by turning on @fold_lines@. + - Line breaks can be converted to HTML breaks by setting @hard_breaks@. - h4. Entities - Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye. - !!example '"Observe!"' @@ -78,9 +78,9 @@ - Pluses around a passage indicate its insertion. - !!example "You are a +pleasant+ child." - To superscript a phrase, surround with carets. - - !!example "a ^2^ + b ^2^ = c ^2^" + - !!example "a^2^ + b^2^ = c^2^" - To subscript, surround with tildes. - - !!example "log ~2~ x" + - !!example "log~2~x" - h4. HTML-Specific - Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span. diff --git a/vendor/RedCloth-3.0.3/doc/make.rb b/vendor/RedCloth-3.0.4/doc/make.rb similarity index 100% rename from vendor/RedCloth-3.0.3/doc/make.rb rename to vendor/RedCloth-3.0.4/doc/make.rb diff --git a/vendor/RedCloth-3.0.3/lib/redcloth.rb b/vendor/RedCloth-3.0.4/lib/redcloth.rb similarity index 94% rename from vendor/RedCloth-3.0.3/lib/redcloth.rb rename to vendor/RedCloth-3.0.4/lib/redcloth.rb index 03df12b3..1228af6e 100644 --- a/vendor/RedCloth-3.0.3/lib/redcloth.rb +++ b/vendor/RedCloth-3.0.4/lib/redcloth.rb @@ -166,7 +166,7 @@ class RedCloth < String - VERSION = '3.0.3' + VERSION = '3.0.4' DEFAULT_RULES = [:textile, :markdown] # @@ -193,6 +193,18 @@ class RedCloth < String # attr_accessor :hard_breaks + # Accessor for toggling lite mode. + # + # In lite mode, block-level rules are ignored. This means + # that tables, paragraphs, lists, and such aren't available. + # Only the inline markup for bold, italics, entities and so on. + # + # r = RedCloth.new( "And then? She *fell*!", [:lite_mode] ) + # r.to_html + # #=> "And then? She fell!" + # + attr_accessor :lite_mode + # # Accessor for toggling span caps. # @@ -219,7 +231,7 @@ class RedCloth < String # inline_textile_image:: Textile inline images # inline_textile_link:: Textile inline links # inline_textile_span:: Textile inline spans - # inline_textile_glyphs:: Textile entities (such as em-dashes and smart quotes) + # glyphs_textile:: Textile entities (such as em-dashes and smart quotes) # # == Markdown # @@ -260,7 +272,7 @@ class RedCloth < String @shelf = [] textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists, :block_textile_prefix, :inline_textile_image, :inline_textile_link, - :inline_textile_code, :inline_textile_glyphs, :inline_textile_span] + :inline_textile_code, :inline_textile_span, :glyphs_textile] markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule, :block_markdown_bq, :block_markdown_lists, :inline_markdown_reflink, :inline_markdown_link] @@ -278,14 +290,16 @@ class RedCloth < String # standard clean up incoming_entities text clean_white_space text - no_textile text # start processor @pre_list = [] rip_offtags text - hard_break text - refs text - blocks text + no_textile text + hard_break text + unless @lite_mode + refs text + blocks text + end inline text smooth_offtags text @@ -333,6 +347,8 @@ class RedCloth < String C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)" # PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' ) PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' ) + PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' ) + PUNCT_Q = Regexp::quote( '*-_+^~%' ) HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)' # Text markup tags, don't conflict with block tags @@ -342,41 +358,6 @@ class RedCloth < String 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo' ] - # Elements to handle - GLYPHS = [ - # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1’\2' ], # single closing - [ /([^\s\[{(>])\'/, '\1’' ], # single closing - [ /\'(?=\s|s\b|[#{PUNCT}])/, '’' ], # single closing - [ /\'/, '‘' ], # single opening - # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing - [ /([^\s\[{(>])"/, '\1”' ], # double closing - [ /"(?=\s|[#{PUNCT}])/, '”' ], # double closing - [ /"/, '“' ], # double opening - [ /\b( )?\.{3}/, '\1…' ], # ellipsis - [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '\1' ], # 3+ uppercase acronym - [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]{2,})([^\2\3', :no_span_caps ], # 3+ uppercase caps - [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash - [ /\s->\s/, ' → ' ], # right arrow - [ /\s-\s/, ' – ' ], # en dash - [ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign - [ /\b ?[(\[]TM[\])]/i, '™' ], # trademark - [ /\b ?[(\[]R[\])]/i, '®' ], # registered - [ /\b ?[(\[]C[\])]/i, '©' ] # copyright - ] - - H_ALGN_VALS = { - '<' => 'left', - '=' => 'center', - '>' => 'right', - '<>' => 'justify' - } - - V_ALGN_VALS = { - '^' => 'top', - '-' => 'middle', - '~' => 'bottom' - } - QTAGS = [ ['**', 'b'], ['*', 'strong'], @@ -398,19 +379,56 @@ class RedCloth < String (#{rcq}) (#{C}) (?::(\S+?))? - (.+?) + (\S.*?\S|\S) #{rcq} (?=\W)/x else /(#{rcq}) (#{C}) - (?::(\S+?))? - (.+?) + (?::(\S+))? + (\S.*?\S|\S) #{rcq}/xm end [rc, ht, re, rtype] end + # Elements to handle + GLYPHS = [ + # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1’\2' ], # single closing + [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing + [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing + [ /\'/, '‘' ], # single opening + [ //, '>' ], # greater-than + # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing + [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing + [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing + [ /"/, '“' ], # double opening + [ /\b( )?\.{3}/, '\1…' ], # ellipsis + [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '\1' ], # 3+ uppercase acronym + [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^\2\3', :no_span_caps ], # 3+ uppercase caps + [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash + [ /\s->\s/, ' → ' ], # right arrow + [ /\s-\s/, ' – ' ], # en dash + [ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign + [ /\b ?[(\[]TM[\])]/i, '™' ], # trademark + [ /\b ?[(\[]R[\])]/i, '®' ], # registered + [ /\b ?[(\[]C[\])]/i, '©' ] # copyright + ] + + H_ALGN_VALS = { + '<' => 'left', + '=' => 'center', + '>' => 'right', + '<>' => 'justify' + } + + V_ALGN_VALS = { + '^' => 'top', + '-' => 'middle', + '~' => 'bottom' + } + # # Flexible HTML escaping # @@ -530,7 +548,7 @@ class RedCloth < String depth.pop end end - if depth.last.length == tl.length + if depth.last and depth.last.length == tl.length lines[line_id - 1] << '' end end @@ -577,7 +595,7 @@ class RedCloth < String end def hard_break( text ) - text.gsub!( /(.)\n(?! *[#*\s|]|$)/, "\\1
" ) if hard_breaks + text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
" ) if hard_breaks end BLOCKS_GROUP_RE = /\n{2,}(?! )/m @@ -705,9 +723,9 @@ class RedCloth < String end end - MARKDOWN_RULE_RE = /^#{ + MARKDOWN_RULE_RE = /^(#{ ['*', '-', '_'].collect { |ch| '( ?' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' ) - }$/ + })$/ def block_markdown_rule( text ) text.gsub!( MARKDOWN_RULE_RE ) do |blk| @@ -719,9 +737,6 @@ class RedCloth < String def block_markdown_lists( text ) end - def inline_markdown_link( text ) - end - def inline_textile_span( text ) QTAGS.each do |qtag_rc, ht, qtag_re, rtype| text.gsub!( qtag_re ) do |m| @@ -903,12 +918,12 @@ class RedCloth < String def shelve( val ) @shelf << val - " <#{ @shelf.length }>" + " :redsh##{ @shelf.length }:" end def retrieve( text ) @shelf.each_with_index do |r, i| - text.gsub!( " <#{ i + 1 }>", r ) + text.gsub!( " :redsh##{ i + 1 }:", r ) end end @@ -965,7 +980,7 @@ class RedCloth < String HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m - def inline_textile_glyphs( text, level = 0 ) + def glyphs_textile( text, level = 0 ) if text !~ HASTAG_MATCH pgl text footnote_ref text @@ -981,11 +996,11 @@ class RedCloth < String codepre = 0 if codepre < 0 end elsif codepre.zero? - inline_textile_glyphs( line, level + 1 ) + glyphs_textile( line, level + 1 ) else htmlesc( line, :NoQuotes ) end - ## p [level, codepre, orig_line, line] + # p [level, codepre, line] line end @@ -1033,8 +1048,10 @@ class RedCloth < String end def inline( text ) - @rules.each do |rule_name| - method( rule_name ).call( text ) if rule_name.to_s.match /^inline_/ + [/^inline_/, /^glyphs_/].each do |meth_re| + @rules.each do |rule_name| + method( rule_name ).call( text ) if rule_name.to_s.match( meth_re ) + end end end @@ -1097,7 +1114,7 @@ class RedCloth < String q2 = ( q != '' ? q : '\s' ) if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i attrv = $1 - next if prop == 'src' and attrv !~ /^http/ + next if prop == 'src' and attrv =~ %r{^(?!http)\w+:} pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\"" break end diff --git a/vendor/RedCloth-3.0.3/run-tests.rb b/vendor/RedCloth-3.0.4/run-tests.rb similarity index 83% rename from vendor/RedCloth-3.0.3/run-tests.rb rename to vendor/RedCloth-3.0.4/run-tests.rb index 65b5c969..1f267b64 100644 --- a/vendor/RedCloth-3.0.3/run-tests.rb +++ b/vendor/RedCloth-3.0.4/run-tests.rb @@ -5,7 +5,9 @@ require 'yaml' Dir["tests/*.yml"].each do |testfile| YAML::load_documents( File.open( testfile ) ) do |doc| if doc['in'] and doc['out'] - red = RedCloth.new( doc['in'] ) + opts = [] + opts << :hard_breaks if testfile =~ /hard_breaks/ + red = RedCloth.new( doc['in'], opts ) html = if testfile =~ /markdown/ red.to_html( :markdown ) else diff --git a/vendor/RedCloth-3.0.4/setup.rb b/vendor/RedCloth-3.0.4/setup.rb new file mode 100644 index 00000000..462522b5 --- /dev/null +++ b/vendor/RedCloth-3.0.4/setup.rb @@ -0,0 +1,1376 @@ +# +# setup.rb +# +# Copyright (c) 2000-2004 Minero Aoki +# +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU LGPL, Lesser General Public License version 2.1. +# + +unless Enumerable.method_defined?(:map) # Ruby 1.4.6 + module Enumerable + alias map collect + end +end + +unless File.respond_to?(:read) # Ruby 1.6 + def File.read(fname) + open(fname) {|f| + return f.read + } + end +end + +def File.binread(fname) + open(fname, 'rb') {|f| + return f.read + } +end + +# for corrupted windows stat(2) +def File.dir?(path) + File.directory?((path[-1,1] == '/') ? path : path + '/') +end + + +class SetupError < StandardError; end + +def setup_rb_error(msg) + raise SetupError, msg +end + +# +# Config +# + +if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg } + ARGV.delete(arg) + require arg.split(/=/, 2)[1] + $".push 'rbconfig.rb' +else + require 'rbconfig' +end + +def multipackage_install? + FileTest.directory?(File.dirname($0) + '/packages') +end + + +class ConfigItem + def initialize(name, template, default, desc) + @name = name.freeze + @template = template + @value = default + @default = default.dup.freeze + @description = desc + end + + attr_reader :name + attr_reader :description + + attr_accessor :default + alias help_default default + + def help_opt + "--#{@name}=#{@template}" + end + + def value + @value + end + + def eval(table) + @value.gsub(%r<\$([^/]+)>) { table[$1] } + end + + def set(val) + @value = check(val) + end + + private + + def check(val) + setup_rb_error "config: --#{name} requires argument" unless val + val + end +end + +class BoolItem < ConfigItem + def config_type + 'bool' + end + + def help_opt + "--#{@name}" + end + + private + + def check(val) + return 'yes' unless val + unless /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i =~ val + setup_rb_error "config: --#{@name} accepts only yes/no for argument" + end + (/\Ay(es)?|\At(rue)/i =~ value) ? 'yes' : 'no' + end +end + +class PathItem < ConfigItem + def config_type + 'path' + end + + private + + def check(path) + setup_rb_error "config: --#{@name} requires argument" unless path + path[0,1] == '$' ? path : File.expand_path(path) + end +end + +class ProgramItem < ConfigItem + def config_type + 'program' + end +end + +class SelectItem < ConfigItem + def initialize(name, template, default, desc) + super + @ok = template.split('/') + end + + def config_type + 'select' + end + + private + + def check(val) + unless @ok.include?(val.strip) + setup_rb_error "config: use --#{@name}=#{@template} (#{val})" + end + val.strip + end +end + +class PackageSelectionItem < ConfigItem + def initialize(name, template, default, help_default, desc) + super name, template, default, desc + @help_default = help_default + end + + attr_reader :help_default + + def config_type + 'package' + end + + private + + def check(val) + unless File.dir?("packages/#{val}") + setup_rb_error "config: no such package: #{val}" + end + val + end +end + +class ConfigTable_class + + def initialize(items) + @items = items + @table = {} + items.each do |i| + @table[i.name] = i + end + ALIASES.each do |ali, name| + @table[ali] = @table[name] + end + end + + include Enumerable + + def each(&block) + @items.each(&block) + end + + def key?(name) + @table.key?(name) + end + + def lookup(name) + @table[name] or raise ArgumentError, "no such config item: #{name}" + end + + def add(item) + @items.push item + @table[item.name] = item + end + + def remove(name) + item = lookup(name) + @items.delete_if {|i| i.name == name } + @table.delete_if {|name, i| i.name == name } + item + end + + def new + dup() + end + + def savefile + '.config' + end + + def load + begin + t = dup() + File.foreach(savefile()) do |line| + k, v = *line.split(/=/, 2) + t[k] = v.strip + end + t + rescue Errno::ENOENT + setup_rb_error $!.message + "#{File.basename($0)} config first" + end + end + + def save + @items.each {|i| i.value } + File.open(savefile(), 'w') {|f| + @items.each do |i| + f.printf "%s=%s\n", i.name, i.value if i.value + end + } + end + + def [](key) + lookup(key).eval(self) + end + + def []=(key, val) + lookup(key).set val + end + +end + +c = ::Config::CONFIG + +rubypath = c['bindir'] + '/' + c['ruby_install_name'] + +major = c['MAJOR'].to_i +minor = c['MINOR'].to_i +teeny = c['TEENY'].to_i +version = "#{major}.#{minor}" + +# ruby ver. >= 1.4.4? +newpath_p = ((major >= 2) or + ((major == 1) and + ((minor >= 5) or + ((minor == 4) and (teeny >= 4))))) + +if c['rubylibdir'] + # V < 1.6.3 + _stdruby = c['rubylibdir'] + _siteruby = c['sitedir'] + _siterubyver = c['sitelibdir'] + _siterubyverarch = c['sitearchdir'] +elsif newpath_p + # 1.4.4 <= V <= 1.6.3 + _stdruby = "$prefix/lib/ruby/#{version}" + _siteruby = c['sitedir'] + _siterubyver = "$siteruby/#{version}" + _siterubyverarch = "$siterubyver/#{c['arch']}" +else + # V < 1.4.4 + _stdruby = "$prefix/lib/ruby/#{version}" + _siteruby = "$prefix/lib/ruby/#{version}/site_ruby" + _siterubyver = _siteruby + _siterubyverarch = "$siterubyver/#{c['arch']}" +end +libdir = '-* dummy libdir *-' +stdruby = '-* dummy rubylibdir *-' +siteruby = '-* dummy site_ruby *-' +siterubyver = '-* dummy site_ruby version *-' +parameterize = lambda {|path| + path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')\ + .sub(/\A#{Regexp.quote(libdir)}/, '$libdir')\ + .sub(/\A#{Regexp.quote(stdruby)}/, '$stdruby')\ + .sub(/\A#{Regexp.quote(siteruby)}/, '$siteruby')\ + .sub(/\A#{Regexp.quote(siterubyver)}/, '$siterubyver') +} +libdir = parameterize.call(c['libdir']) +stdruby = parameterize.call(_stdruby) +siteruby = parameterize.call(_siteruby) +siterubyver = parameterize.call(_siterubyver) +siterubyverarch = parameterize.call(_siterubyverarch) + +if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg } + makeprog = arg.sub(/'/, '').split(/=/, 2)[1] +else + makeprog = 'make' +end + +common_conf = [ + PathItem.new('prefix', 'path', c['prefix'], + 'path prefix of target environment'), + PathItem.new('bindir', 'path', parameterize.call(c['bindir']), + 'the directory for commands'), + PathItem.new('libdir', 'path', libdir, + 'the directory for libraries'), + PathItem.new('datadir', 'path', parameterize.call(c['datadir']), + 'the directory for shared data'), + PathItem.new('mandir', 'path', parameterize.call(c['mandir']), + 'the directory for man pages'), + PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']), + 'the directory for man pages'), + PathItem.new('stdruby', 'path', stdruby, + 'the directory for standard ruby libraries'), + PathItem.new('siteruby', 'path', siteruby, + 'the directory for version-independent aux ruby libraries'), + PathItem.new('siterubyver', 'path', siterubyver, + 'the directory for aux ruby libraries'), + PathItem.new('siterubyverarch', 'path', siterubyverarch, + 'the directory for aux ruby binaries'), + PathItem.new('rbdir', 'path', '$siterubyver', + 'the directory for ruby scripts'), + PathItem.new('sodir', 'path', '$siterubyverarch', + 'the directory for ruby extentions'), + PathItem.new('rubypath', 'path', rubypath, + 'the path to set to #! line'), + ProgramItem.new('rubyprog', 'name', rubypath, + 'the ruby program using for installation'), + ProgramItem.new('makeprog', 'name', makeprog, + 'the make program to compile ruby extentions'), + SelectItem.new('shebang', 'all/ruby/never', 'ruby', + 'shebang line (#!) editing mode'), + BoolItem.new('without-ext', 'yes/no', 'no', + 'does not compile/install ruby extentions') +] +class ConfigTable_class # open again + ALIASES = { + 'std-ruby' => 'stdruby', + 'site-ruby-common' => 'siteruby', # For backward compatibility + 'site-ruby' => 'siterubyver', # For backward compatibility + 'bin-dir' => 'bindir', + 'bin-dir' => 'bindir', + 'rb-dir' => 'rbdir', + 'so-dir' => 'sodir', + 'data-dir' => 'datadir', + 'ruby-path' => 'rubypath', + 'ruby-prog' => 'rubyprog', + 'ruby' => 'rubyprog', + 'make-prog' => 'makeprog', + 'make' => 'makeprog' + } +end +multipackage_conf = [ + PackageSelectionItem.new('with', 'name,name...', '', 'ALL', + 'package names that you want to install'), + PackageSelectionItem.new('without', 'name,name...', '', 'NONE', + 'package names that you do not want to install') +] +if multipackage_install? + ConfigTable = ConfigTable_class.new(common_conf + multipackage_conf) +else + ConfigTable = ConfigTable_class.new(common_conf) +end + + +module MetaConfigAPI + + def eval_file_ifexist(fname) + instance_eval File.read(fname), fname, 1 if File.file?(fname) + end + + def config_names + ConfigTable.map {|i| i.name } + end + + def config?(name) + ConfigTable.key?(name) + end + + def bool_config?(name) + ConfigTable.lookup(name).config_type == 'bool' + end + + def path_config?(name) + ConfigTable.lookup(name).config_type == 'path' + end + + def value_config?(name) + case ConfigTable.lookup(name).config_type + when 'bool', 'path' + true + else + false + end + end + + def add_config(item) + ConfigTable.add item + end + + def add_bool_config(name, default, desc) + ConfigTable.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc) + end + + def add_path_config(name, default, desc) + ConfigTable.add PathItem.new(name, 'path', default, desc) + end + + def set_config_default(name, default) + ConfigTable.lookup(name).default = default + end + + def remove_config(name) + ConfigTable.remove(name) + end + +end + + +# +# File Operations +# + +module FileOperations + + def mkdir_p(dirname, prefix = nil) + dirname = prefix + File.expand_path(dirname) if prefix + $stderr.puts "mkdir -p #{dirname}" if verbose? + return if no_harm? + + # does not check '/'... it's too abnormal case + dirs = File.expand_path(dirname).split(%r<(?=/)>) + if /\A[a-z]:\z/i =~ dirs[0] + disk = dirs.shift + dirs[0] = disk + dirs[0] + end + dirs.each_index do |idx| + path = dirs[0..idx].join('') + Dir.mkdir path unless File.dir?(path) + end + end + + def rm_f(fname) + $stderr.puts "rm -f #{fname}" if verbose? + return if no_harm? + + if File.exist?(fname) or File.symlink?(fname) + File.chmod 0777, fname + File.unlink fname + end + end + + def rm_rf(dn) + $stderr.puts "rm -rf #{dn}" if verbose? + return if no_harm? + + Dir.chdir dn + Dir.foreach('.') do |fn| + next if fn == '.' + next if fn == '..' + if File.dir?(fn) + verbose_off { + rm_rf fn + } + else + verbose_off { + rm_f fn + } + end + end + Dir.chdir '..' + Dir.rmdir dn + end + + def move_file(src, dest) + File.unlink dest if File.exist?(dest) + begin + File.rename src, dest + rescue + File.open(dest, 'wb') {|f| f.write File.binread(src) } + File.chmod File.stat(src).mode, dest + File.unlink src + end + end + + def install(from, dest, mode, prefix = nil) + $stderr.puts "install #{from} #{dest}" if verbose? + return if no_harm? + + realdest = prefix ? prefix + File.expand_path(dest) : dest + realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest) + str = File.binread(from) + if diff?(str, realdest) + verbose_off { + rm_f realdest if File.exist?(realdest) + } + File.open(realdest, 'wb') {|f| + f.write str + } + File.chmod mode, realdest + + File.open("#{objdir_root()}/InstalledFiles", 'a') {|f| + if prefix + f.puts realdest.sub(prefix, '') + else + f.puts realdest + end + } + end + end + + def diff?(new_content, path) + return true unless File.exist?(path) + new_content != File.binread(path) + end + + def command(str) + $stderr.puts str if verbose? + system str or raise RuntimeError, "'system #{str}' failed" + end + + def ruby(str) + command config('rubyprog') + ' ' + str + end + + def make(task = '') + command config('makeprog') + ' ' + task + end + + def extdir?(dir) + File.exist?(dir + '/MANIFEST') + end + + def all_files_in(dirname) + Dir.open(dirname) {|d| + return d.select {|ent| File.file?("#{dirname}/#{ent}") } + } + end + + REJECT_DIRS = %w( + CVS SCCS RCS CVS.adm .svn + ) + + def all_dirs_in(dirname) + Dir.open(dirname) {|d| + return d.select {|n| File.dir?("#{dirname}/#{n}") } - %w(. ..) - REJECT_DIRS + } + end + +end + + +# +# Main Installer +# + +module HookUtils + + def run_hook(name) + try_run_hook "#{curr_srcdir()}/#{name}" or + try_run_hook "#{curr_srcdir()}/#{name}.rb" + end + + def try_run_hook(fname) + return false unless File.file?(fname) + begin + instance_eval File.read(fname), fname, 1 + rescue + setup_rb_error "hook #{fname} failed:\n" + $!.message + end + true + end + +end + + +module HookScriptAPI + + def get_config(key) + @config[key] + end + + alias config get_config + + def set_config(key, val) + @config[key] = val + end + + # + # srcdir/objdir (works only in the package directory) + # + + #abstract srcdir_root + #abstract objdir_root + #abstract relpath + + def curr_srcdir + "#{srcdir_root()}/#{relpath()}" + end + + def curr_objdir + "#{objdir_root()}/#{relpath()}" + end + + def srcfile(path) + "#{curr_srcdir()}/#{path}" + end + + def srcexist?(path) + File.exist?(srcfile(path)) + end + + def srcdirectory?(path) + File.dir?(srcfile(path)) + end + + def srcfile?(path) + File.file? srcfile(path) + end + + def srcentries(path = '.') + Dir.open("#{curr_srcdir()}/#{path}") {|d| + return d.to_a - %w(. ..) + } + end + + def srcfiles(path = '.') + srcentries(path).select {|fname| + File.file?(File.join(curr_srcdir(), path, fname)) + } + end + + def srcdirectories(path = '.') + srcentries(path).select {|fname| + File.dir?(File.join(curr_srcdir(), path, fname)) + } + end + +end + + +class ToplevelInstaller + + Version = '3.3.1' + Copyright = 'Copyright (c) 2000-2004 Minero Aoki' + + TASKS = [ + [ 'all', 'do config, setup, then install' ], + [ 'config', 'saves your configurations' ], + [ 'show', 'shows current configuration' ], + [ 'setup', 'compiles ruby extentions and others' ], + [ 'install', 'installs files' ], + [ 'clean', "does `make clean' for each extention" ], + [ 'distclean',"does `make distclean' for each extention" ] + ] + + def ToplevelInstaller.invoke + instance().invoke + end + + @singleton = nil + + def ToplevelInstaller.instance + @singleton ||= new(File.dirname($0)) + @singleton + end + + include MetaConfigAPI + + def initialize(ardir_root) + @config = nil + @options = { 'verbose' => true } + @ardir = File.expand_path(ardir_root) + end + + def inspect + "#<#{self.class} #{__id__()}>" + end + + def invoke + run_metaconfigs + case task = parsearg_global() + when nil, 'all' + @config = load_config('config') + parsearg_config + init_installers + exec_config + exec_setup + exec_install + else + @config = load_config(task) + __send__ "parsearg_#{task}" + init_installers + __send__ "exec_#{task}" + end + end + + def run_metaconfigs + eval_file_ifexist "#{@ardir}/metaconfig" + end + + def load_config(task) + case task + when 'config' + ConfigTable.new + when 'clean', 'distclean' + if File.exist?(ConfigTable.savefile) + then ConfigTable.load + else ConfigTable.new + end + else + ConfigTable.load + end + end + + def init_installers + @installer = Installer.new(@config, @options, @ardir, File.expand_path('.')) + end + + # + # Hook Script API bases + # + + def srcdir_root + @ardir + end + + def objdir_root + '.' + end + + def relpath + '.' + end + + # + # Option Parsing + # + + def parsearg_global + valid_task = /\A(?:#{TASKS.map {|task,desc| task }.join '|'})\z/ + + while arg = ARGV.shift + case arg + when /\A\w+\z/ + setup_rb_error "invalid task: #{arg}" unless valid_task =~ arg + return arg + + when '-q', '--quiet' + @options['verbose'] = false + + when '--verbose' + @options['verbose'] = true + + when '-h', '--help' + print_usage $stdout + exit 0 + + when '-v', '--version' + puts "#{File.basename($0)} version #{Version}" + exit 0 + + when '--copyright' + puts Copyright + exit 0 + + else + setup_rb_error "unknown global option '#{arg}'" + end + end + + nil + end + + + def parsearg_no_options + unless ARGV.empty? + setup_rb_error "#{task}: unknown options: #{ARGV.join ' '}" + end + end + + alias parsearg_show parsearg_no_options + alias parsearg_setup parsearg_no_options + alias parsearg_clean parsearg_no_options + alias parsearg_distclean parsearg_no_options + + def parsearg_config + re = /\A--(#{ConfigTable.map {|i| i.name }.join('|')})(?:=(.*))?\z/ + @options['config-opt'] = [] + + while i = ARGV.shift + if /\A--?\z/ =~ i + @options['config-opt'] = ARGV.dup + break + end + m = re.match(i) or setup_rb_error "config: unknown option #{i}" + name, value = *m.to_a[1,2] + @config[name] = value + end + end + + def parsearg_install + @options['no-harm'] = false + @options['install-prefix'] = '' + while a = ARGV.shift + case a + when /\A--no-harm\z/ + @options['no-harm'] = true + when /\A--prefix=(.*)\z/ + path = $1 + path = File.expand_path(path) unless path[0,1] == '/' + @options['install-prefix'] = path + else + setup_rb_error "install: unknown option #{a}" + end + end + end + + def print_usage(out) + out.puts 'Typical Installation Procedure:' + out.puts " $ ruby #{File.basename $0} config" + out.puts " $ ruby #{File.basename $0} setup" + out.puts " # ruby #{File.basename $0} install (may require root privilege)" + out.puts + out.puts 'Detailed Usage:' + out.puts " ruby #{File.basename $0} " + out.puts " ruby #{File.basename $0} [] []" + + fmt = " %-24s %s\n" + out.puts + out.puts 'Global options:' + out.printf fmt, '-q,--quiet', 'suppress message outputs' + out.printf fmt, ' --verbose', 'output messages verbosely' + out.printf fmt, '-h,--help', 'print this message' + out.printf fmt, '-v,--version', 'print version and quit' + out.printf fmt, ' --copyright', 'print copyright and quit' + out.puts + out.puts 'Tasks:' + TASKS.each do |name, desc| + out.printf fmt, name, desc + end + + fmt = " %-24s %s [%s]\n" + out.puts + out.puts 'Options for CONFIG or ALL:' + ConfigTable.each do |item| + out.printf fmt, item.help_opt, item.description, item.help_default + end + out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's" + out.puts + out.puts 'Options for INSTALL:' + out.printf fmt, '--no-harm', 'only display what to do if given', 'off' + out.printf fmt, '--prefix=path', 'install path prefix', '$prefix' + out.puts + end + + # + # Task Handlers + # + + def exec_config + @installer.exec_config + @config.save # must be final + end + + def exec_setup + @installer.exec_setup + end + + def exec_install + @installer.exec_install + end + + def exec_show + ConfigTable.each do |i| + printf "%-20s %s\n", i.name, i.value + end + end + + def exec_clean + @installer.exec_clean + end + + def exec_distclean + @installer.exec_distclean + end + +end + + +class ToplevelInstallerMulti < ToplevelInstaller + + include HookUtils + include HookScriptAPI + include FileOperations + + def initialize(ardir) + super + @packages = all_dirs_in("#{@ardir}/packages") + raise 'no package exists' if @packages.empty? + end + + def run_metaconfigs + eval_file_ifexist "#{@ardir}/metaconfig" + @packages.each do |name| + eval_file_ifexist "#{@ardir}/packages/#{name}/metaconfig" + end + end + + def init_installers + @installers = {} + @packages.each do |pack| + @installers[pack] = Installer.new(@config, @options, + "#{@ardir}/packages/#{pack}", + "packages/#{pack}") + end + + with = extract_selection(config('with')) + without = extract_selection(config('without')) + @selected = @installers.keys.select {|name| + (with.empty? or with.include?(name)) \ + and not without.include?(name) + } + end + + def extract_selection(list) + a = list.split(/,/) + a.each do |name| + setup_rb_error "no such package: #{name}" unless @installers.key?(name) + end + a + end + + def print_usage(f) + super + f.puts 'Inluded packages:' + f.puts ' ' + @packages.sort.join(' ') + f.puts + end + + # + # multi-package metaconfig API + # + + attr_reader :packages + + def declare_packages(list) + raise 'package list is empty' if list.empty? + list.each do |name| + raise "directory packages/#{name} does not exist"\ + unless File.dir?("#{@ardir}/packages/#{name}") + end + @packages = list + end + + # + # Task Handlers + # + + def exec_config + run_hook 'pre-config' + each_selected_installers {|inst| inst.exec_config } + run_hook 'post-config' + @config.save # must be final + end + + def exec_setup + run_hook 'pre-setup' + each_selected_installers {|inst| inst.exec_setup } + run_hook 'post-setup' + end + + def exec_install + run_hook 'pre-install' + each_selected_installers {|inst| inst.exec_install } + run_hook 'post-install' + end + + def exec_clean + rm_f ConfigTable.savefile + run_hook 'pre-clean' + each_selected_installers {|inst| inst.exec_clean } + run_hook 'post-clean' + end + + def exec_distclean + rm_f ConfigTable.savefile + run_hook 'pre-distclean' + each_selected_installers {|inst| inst.exec_distclean } + run_hook 'post-distclean' + end + + # + # lib + # + + def each_selected_installers + Dir.mkdir 'packages' unless File.dir?('packages') + @selected.each do |pack| + $stderr.puts "Processing the package `#{pack}' ..." if @options['verbose'] + Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}") + Dir.chdir "packages/#{pack}" + yield @installers[pack] + Dir.chdir '../..' + end + end + + def verbose? + @options['verbose'] + end + + def no_harm? + @options['no-harm'] + end + +end + + +class Installer + + FILETYPES = %w( bin lib ext share ) + + include HookScriptAPI + include HookUtils + include FileOperations + + def initialize(config, opt, srcroot, objroot) + @config = config + @options = opt + @srcdir = File.expand_path(srcroot) + @objdir = File.expand_path(objroot) + @currdir = '.' + end + + def inspect + "#<#{self.class} #{File.basename(@srcdir)}>" + end + + # + # Hook Script API base methods + # + + def srcdir_root + @srcdir + end + + def objdir_root + @objdir + end + + def relpath + @currdir + end + + # + # configs/options + # + + def no_harm? + @options['no-harm'] + end + + def verbose? + @options['verbose'] + end + + def verbose_off + begin + save, @options['verbose'] = @options['verbose'], false + yield + ensure + @options['verbose'] = save + end + end + + # + # TASK config + # + + def exec_config + exec_task_traverse 'config' + end + + def config_dir_bin(rel) + end + + def config_dir_lib(rel) + end + + def config_dir_ext(rel) + extconf if extdir?(curr_srcdir()) + end + + def extconf + opt = @options['config-opt'].join(' ') + command "#{config('rubyprog')} #{curr_srcdir()}/extconf.rb #{opt}" + end + + def config_dir_share(rel) + end + + # + # TASK setup + # + + def exec_setup + exec_task_traverse 'setup' + end + + def setup_dir_bin(rel) + all_files_in(curr_srcdir()).each do |fname| + adjust_shebang "#{curr_srcdir()}/#{fname}" + end + end + + def adjust_shebang(path) + return if no_harm? + tmpfile = File.basename(path) + '.tmp' + begin + File.open(path, 'rb') {|r| + first = r.gets + return unless File.basename(config('rubypath')) == 'ruby' + return unless File.basename(first.sub(/\A\#!/, '').split[0]) == 'ruby' + $stderr.puts "adjusting shebang: #{File.basename(path)}" if verbose? + File.open(tmpfile, 'wb') {|w| + w.print first.sub(/\A\#!\s*\S+/, '#! ' + config('rubypath')) + w.write r.read + } + move_file tmpfile, File.basename(path) + } + ensure + File.unlink tmpfile if File.exist?(tmpfile) + end + end + + def setup_dir_lib(rel) + end + + def setup_dir_ext(rel) + make if extdir?(curr_srcdir()) + end + + def setup_dir_share(rel) + end + + # + # TASK install + # + + def exec_install + rm_f 'InstalledFiles' + exec_task_traverse 'install' + end + + def install_dir_bin(rel) + install_files collect_filenames_auto(), "#{config('bindir')}/#{rel}", 0755 + end + + def install_dir_lib(rel) + install_files ruby_scripts(), "#{config('rbdir')}/#{rel}", 0644 + return unless rel.empty? + begin + require 'rdoc/rdoc' + ri_site = true + if RDOC_VERSION =~ /^0\./ + require 'rdoc/options' + unless Options::OptionList::OPTION_LIST.assoc('--ri-site') + ri_site = false + end + end rescue nil + if ri_site + r = RDoc::RDoc.new + r.document(%w{--ri-site}) + end + rescue + puts "** Unable to install Ri documentation for RedCloth **" + end + end + + def install_dir_ext(rel) + return unless extdir?(curr_srcdir()) + install_files ruby_extentions('.'), + "#{config('sodir')}/#{File.dirname(rel)}", + 0555 + end + + def install_dir_share(rel) + end + + def install_files(list, dest, mode) + mkdir_p dest, @options['install-prefix'] + list.each do |fname| + install fname, dest, mode, @options['install-prefix'] + end + end + + def ruby_scripts + collect_filenames_auto().select {|n| /\.rb\z/ =~ n } + end + + # picked up many entries from cvs-1.11.1/src/ignore.c + reject_patterns = %w( + core RCSLOG tags TAGS .make.state + .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb + *~ *.old *.bak *.BAK *.orig *.rej _$* *$ + + *.org *.in .* + ) + mapping = { + '.' => '\.', + '$' => '\$', + '#' => '\#', + '*' => '.*' + } + REJECT_PATTERNS = Regexp.new('\A(?:' + + reject_patterns.map {|pat| + pat.gsub(/[\.\$\#\*]/) {|ch| mapping[ch] } + }.join('|') + + ')\z') + + def collect_filenames_auto + mapdir((existfiles() - hookfiles()).reject {|fname| + REJECT_PATTERNS =~ fname + }) + end + + def existfiles + all_files_in(curr_srcdir()) | all_files_in('.') + end + + def hookfiles + %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt| + %w( config setup install clean ).map {|t| sprintf(fmt, t) } + }.flatten + end + + def mapdir(filelist) + filelist.map {|fname| + if File.exist?(fname) # objdir + fname + else # srcdir + File.join(curr_srcdir(), fname) + end + } + end + + def ruby_extentions(dir) + Dir.open(dir) {|d| + ents = d.select {|fname| /\.#{::Config::CONFIG['DLEXT']}\z/ =~ fname } + if ents.empty? + setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first" + end + return ents + } + end + + # + # TASK clean + # + + def exec_clean + exec_task_traverse 'clean' + rm_f ConfigTable.savefile + rm_f 'InstalledFiles' + end + + def clean_dir_bin(rel) + end + + def clean_dir_lib(rel) + end + + def clean_dir_ext(rel) + return unless extdir?(curr_srcdir()) + make 'clean' if File.file?('Makefile') + end + + def clean_dir_share(rel) + end + + # + # TASK distclean + # + + def exec_distclean + exec_task_traverse 'distclean' + rm_f ConfigTable.savefile + rm_f 'InstalledFiles' + end + + def distclean_dir_bin(rel) + end + + def distclean_dir_lib(rel) + end + + def distclean_dir_ext(rel) + return unless extdir?(curr_srcdir()) + make 'distclean' if File.file?('Makefile') + end + + # + # lib + # + + def exec_task_traverse(task) + run_hook "pre-#{task}" + FILETYPES.each do |type| + if config('without-ext') == 'yes' and type == 'ext' + $stderr.puts 'skipping ext/* by user option' if verbose? + next + end + traverse task, type, "#{task}_dir_#{type}" + end + run_hook "post-#{task}" + end + + def traverse(task, rel, mid) + dive_into(rel) { + run_hook "pre-#{task}" + __send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '') + all_dirs_in(curr_srcdir()).each do |d| + traverse task, "#{rel}/#{d}", mid + end + run_hook "post-#{task}" + } + end + + def dive_into(rel) + return unless File.dir?("#{@srcdir}/#{rel}") + + dir = File.basename(rel) + Dir.mkdir dir unless File.dir?(dir) + prevdir = Dir.pwd + Dir.chdir dir + $stderr.puts '---> ' + rel if verbose? + @currdir = rel + yield + Dir.chdir prevdir + $stderr.puts '<--- ' + rel if verbose? + @currdir = File.dirname(rel) + end + +end + + +if $0 == __FILE__ + begin + if multipackage_install? + ToplevelInstallerMulti.invoke + else + ToplevelInstaller.invoke + end + rescue SetupError + raise if $DEBUG + $stderr.puts $!.message + $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." + exit 1 + end +end diff --git a/vendor/RedCloth-3.0.3/tests/code.yml b/vendor/RedCloth-3.0.4/tests/code.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/code.yml rename to vendor/RedCloth-3.0.4/tests/code.yml diff --git a/vendor/RedCloth-3.0.4/tests/hard_breaks.yml b/vendor/RedCloth-3.0.4/tests/hard_breaks.yml new file mode 100644 index 00000000..0b1fc099 --- /dev/null +++ b/vendor/RedCloth-3.0.4/tests/hard_breaks.yml @@ -0,0 +1,26 @@ +--- +in: | + |This|is|a|row| + {background:#ddd}. |This|is|grey|row| + |This|is|another|row| +out: |- + + + + + + + + + + + + + + + + + + + +
Thisisarow
Thisisgreyrow
Thisisanotherrow
diff --git a/vendor/RedCloth-3.0.3/tests/images.yml b/vendor/RedCloth-3.0.4/tests/images.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/images.yml rename to vendor/RedCloth-3.0.4/tests/images.yml diff --git a/vendor/RedCloth-3.0.3/tests/instiki.yml b/vendor/RedCloth-3.0.4/tests/instiki.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/instiki.yml rename to vendor/RedCloth-3.0.4/tests/instiki.yml diff --git a/vendor/RedCloth-3.0.3/tests/links.yml b/vendor/RedCloth-3.0.4/tests/links.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/links.yml rename to vendor/RedCloth-3.0.4/tests/links.yml diff --git a/vendor/RedCloth-3.0.3/tests/lists.yml b/vendor/RedCloth-3.0.4/tests/lists.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/lists.yml rename to vendor/RedCloth-3.0.4/tests/lists.yml diff --git a/vendor/RedCloth-3.0.3/tests/markdown.yml b/vendor/RedCloth-3.0.4/tests/markdown.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/markdown.yml rename to vendor/RedCloth-3.0.4/tests/markdown.yml diff --git a/vendor/RedCloth-3.0.3/tests/poignant.yml b/vendor/RedCloth-3.0.4/tests/poignant.yml similarity index 100% rename from vendor/RedCloth-3.0.3/tests/poignant.yml rename to vendor/RedCloth-3.0.4/tests/poignant.yml diff --git a/vendor/RedCloth-3.0.3/tests/table.yml b/vendor/RedCloth-3.0.4/tests/table.yml similarity index 95% rename from vendor/RedCloth-3.0.3/tests/table.yml rename to vendor/RedCloth-3.0.4/tests/table.yml index bf5059e1..3ce974dd 100644 --- a/vendor/RedCloth-3.0.3/tests/table.yml +++ b/vendor/RedCloth-3.0.4/tests/table.yml @@ -39,28 +39,28 @@ out: |- 11/18/04 11/18/04 070 - XML spec complete + XML spec complete 11/29/04 11/29/04 011 - XML spec complete (KH is on schedule) + XML spec complete (KH is on schedule) 11/29/04 11/29/04 051 - XML spec complete (KH is on schedule) + XML spec complete (KH is on schedule) 11/29/04 11/29/04 081 - XML spec complete (KH is on schedule) + XML spec complete (KH is on schedule) diff --git a/vendor/RedCloth-3.0.3/tests/textism.yml b/vendor/RedCloth-3.0.4/tests/textism.yml similarity index 97% rename from vendor/RedCloth-3.0.3/tests/textism.yml rename to vendor/RedCloth-3.0.4/tests/textism.yml index 5489c04d..1e6f8d6b 100644 --- a/vendor/RedCloth-3.0.3/tests/textism.yml +++ b/vendor/RedCloth-3.0.4/tests/textism.yml @@ -71,6 +71,12 @@ out:

a phrase

in: '**a phrase**' out:

a phrase

--- +in: '*(a)* a' +out:

(a) a

+--- +in: '*(a)* *' +out:

(a) *

+--- in: Nabokov's ??Pnin?? out:

Nabokov’s Pnin

--- @@ -395,3 +401,6 @@ out: |-
  • We must act
  • +--- +in: '"test":http://foo.com/b---ar' +out:

    test