diff options
| author | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-24 10:50:35 -0400 |
|---|---|---|
| committer | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-24 10:50:35 -0400 |
| commit | 3f4e31f648eb7f744cf385cfc5e333eaa3378738 (patch) | |
| tree | fc6b95dce2193c390f712accd4f20fd9c4d15c53 /cloudmasterd/script | |
| parent | 4ec70ff34acf9ef7733cf6dc606a147a9c3ca9bd (diff) | |
| download | tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.tar.gz tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.tar.xz tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.zip | |
Cloud master cleanup
Diffstat (limited to 'cloudmasterd/script')
| -rwxr-xr-x | cloudmasterd/script/console | 10 | ||||
| -rwxr-xr-x | cloudmasterd/script/destroy | 2 | ||||
| -rwxr-xr-x | cloudmasterd/script/generate | 2 | ||||
| -rwxr-xr-x | cloudmasterd/script/txt2html | 74 |
4 files changed, 2 insertions, 86 deletions
diff --git a/cloudmasterd/script/console b/cloudmasterd/script/console deleted file mode 100755 index cc9f73f..0000000 --- a/cloudmasterd/script/console +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby -# File: script/console -irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' - -libs = " -r irb/completion" -# Perhaps use a console_lib to store any extra methods I may want available in the cosole -# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}" -libs << " -r #{File.dirname(__FILE__) + '/../lib/cloudmasterd.rb'}" -puts "Loading cloudmasterd gem" -exec "#{irb} #{libs} --simple-prompt" diff --git a/cloudmasterd/script/destroy b/cloudmasterd/script/destroy index e48464d..40901a8 100755 --- a/cloudmasterd/script/destroy +++ b/cloudmasterd/script/destroy @@ -10,5 +10,5 @@ end require 'rubigen/scripts/destroy' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] +RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit] RubiGen::Scripts::Destroy.new.run(ARGV) diff --git a/cloudmasterd/script/generate b/cloudmasterd/script/generate index c27f655..5c8ed01 100755 --- a/cloudmasterd/script/generate +++ b/cloudmasterd/script/generate @@ -10,5 +10,5 @@ end require 'rubigen/scripts/generate' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] +RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit] RubiGen::Scripts::Generate.new.run(ARGV) diff --git a/cloudmasterd/script/txt2html b/cloudmasterd/script/txt2html deleted file mode 100755 index b936c8b..0000000 --- a/cloudmasterd/script/txt2html +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env ruby - -require 'rubygems' -begin - require 'newgem' -rescue LoadError - puts "\n\nGenerating the website requires the newgem RubyGem" - puts "Install: gem install newgem\n\n" - exit(1) -end -require 'redcloth' -require 'syntax/convertors/html' -require 'erb' -require File.dirname(__FILE__) + '/../lib/cloudmasterd/version.rb' - -version = Cloudmasterd::VERSION::STRING -download = 'http://rubyforge.org/projects/cloudmasterd' - -class Fixnum - def ordinal - # teens - return 'th' if (10..19).include?(self % 100) - # others - case self % 10 - when 1: return 'st' - when 2: return 'nd' - when 3: return 'rd' - else return 'th' - end - end -end - -class Time - def pretty - return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}" - end -end - -def convert_syntax(syntax, source) - return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'') -end - -if ARGV.length >= 1 - src, template = ARGV - template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb') - -else - puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html") - exit! -end - -template = ERB.new(File.open(template).read) - -title = nil -body = nil -File.open(src) do |fsrc| - title_text = fsrc.readline - body_text = fsrc.read - syntax_items = [] - body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){ - ident = syntax_items.length - element, syntax, source = $1, $2, $3 - syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>" - "syntax-temp-#{ident}" - } - title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip - body = RedCloth.new(body_text).to_html - body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] } -end -stat = File.stat(src) -created = stat.ctime -modified = stat.mtime - -$stdout << template.result(binding) |
