newgem 0.11.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +42 -0
- data/Manifest.txt +84 -17
- data/README.txt +3 -2
- data/Rakefile +4 -106
- data/Todo.txt +1 -1
- data/app_generators/newgem/newgem_generator.rb +172 -0
- data/{templates → app_generators/newgem/templates}/History.txt +1 -1
- data/{templates → app_generators/newgem/templates}/License.txt +1 -1
- data/app_generators/newgem/templates/README.txt +1 -0
- data/app_generators/newgem/templates/Rakefile +4 -0
- data/{templates → app_generators/newgem/templates}/app.rb +3 -3
- data/app_generators/newgem/templates/config/hoe.rb +73 -0
- data/app_generators/newgem/templates/config/requirements.rb +17 -0
- data/app_generators/newgem/templates/empty.log +0 -0
- data/app_generators/newgem/templates/module.rb +5 -0
- data/app_generators/newgem/templates/script/destroy +14 -0
- data/app_generators/newgem/templates/script/generate +14 -0
- data/{templates → app_generators/newgem/templates}/setup.rb +0 -0
- data/{templates → app_generators/newgem/templates}/spec.opts +0 -0
- data/{templates → app_generators/newgem/templates}/spec.rb +0 -0
- data/app_generators/newgem/templates/tasks/deployment.rake +27 -0
- data/app_generators/newgem/templates/tasks/environment.rake +7 -0
- data/app_generators/newgem/templates/tasks/website.rake +9 -0
- data/{templates → app_generators/newgem/templates}/test.rb +1 -1
- data/app_generators/newgem/templates/test_helper.rb +2 -0
- data/app_generators/newgem/templates/version.rb +9 -0
- data/bin/newgem +9 -272
- data/bundles/RubyGem.tmbundle/Snippets/History header trunk.tmSnippet +18 -0
- data/bundles/RubyGem.tmbundle/Snippets/History header.tmSnippet +18 -0
- data/bundles/RubyGem.tmbundle/Syntaxes/Rdoc.tmLanguage +70 -0
- data/bundles/RubyGem.tmbundle/info.plist +16 -0
- data/config/hoe.rb +48 -0
- data/config/svn_branch.rb +15 -0
- data/lib/newgem.rb +2 -3
- data/lib/newgem/quick_template.rb +28 -0
- data/lib/newgem/tasks.rb +1 -0
- data/lib/newgem/version.rb +1 -1
- data/newgem_generators/install_website/USAGE +5 -0
- data/newgem_generators/install_website/install_website_generator.rb +76 -0
- data/{templates/scripts → newgem_generators/install_website/templates/script}/txt2html +15 -8
- data/newgem_generators/install_website/templates/tasks/website.rake +17 -0
- data/{templates → newgem_generators/install_website/templates}/website/index.html +2 -2
- data/newgem_generators/install_website/templates/website/index.txt +39 -0
- data/newgem_theme_generators/plain/USAGE +5 -0
- data/newgem_theme_generators/plain/plain_generator.rb +54 -0
- data/{templates → newgem_theme_generators/plain/templates}/website/javascripts/rounded_corners_lite.inc.js +0 -0
- data/{templates → newgem_theme_generators/plain/templates}/website/stylesheets/screen.css +0 -0
- data/{templates → newgem_theme_generators/plain/templates}/website/template.rhtml +6 -6
- data/rubygems_generators/application_generator/USAGE +28 -0
- data/rubygems_generators/application_generator/application_generator_generator.rb +58 -0
- data/rubygems_generators/application_generator/templates/bin +12 -0
- data/rubygems_generators/application_generator/templates/generator.rb +51 -0
- data/rubygems_generators/application_generator/templates/readme +24 -0
- data/rubygems_generators/application_generator/templates/test.rb +43 -0
- data/rubygems_generators/application_generator/templates/test_generator_helper.rb +19 -0
- data/rubygems_generators/application_generator/templates/usage +5 -0
- data/rubygems_generators/component_generator/USAGE +29 -0
- data/rubygems_generators/component_generator/component_generator_generator.rb +52 -0
- data/rubygems_generators/component_generator/templates/generator.rb +51 -0
- data/rubygems_generators/component_generator/templates/readme +28 -0
- data/rubygems_generators/component_generator/templates/test.rb +43 -0
- data/rubygems_generators/component_generator/templates/test_generator_helper.rb +19 -0
- data/rubygems_generators/component_generator/templates/usage +5 -0
- data/rubygems_generators/executable/executable_generator.rb +53 -0
- data/rubygems_generators/executable/templates/app.rb +44 -0
- data/rubygems_generators/install_jruby/USAGE +5 -0
- data/rubygems_generators/install_jruby/install_jruby_generator.rb +48 -0
- data/rubygems_generators/install_jruby/templates/tasks/jruby.rake +7 -0
- data/rubygems_generators/install_rspec/USAGE +5 -0
- data/rubygems_generators/install_rspec/install_rspec_generator.rb +55 -0
- data/rubygems_generators/install_rspec/templates/spec.rb +11 -0
- data/rubygems_generators/install_rspec/templates/spec/spec.opts +1 -0
- data/rubygems_generators/install_rspec/templates/spec/spec_helper.rb +7 -0
- data/rubygems_generators/install_rspec/templates/tasks/rspec.rake +21 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/{scripts → script}/txt2html +3 -3
- data/{scripts → script}/txt2js +0 -0
- data/tasks/bundles.rake +12 -0
- data/tasks/deployment.rake +27 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +19 -0
- data/test/test_application_generator_generator.rb +60 -0
- data/test/test_executable_generator.rb +28 -0
- data/test/test_generate_component_generator.rb +67 -0
- data/test/test_generator_helper.rb +19 -0
- data/test/test_install_jruby_generator.rb +29 -0
- data/test/test_install_rspec_generator.rb +33 -0
- data/test/test_install_website_generator.rb +50 -0
- data/test/test_newgem_generator.rb +120 -0
- data/test/test_plain_generator.rb +37 -0
- data/website/images/beginning-ruby.jpg +0 -0
- data/website/index.html +8 -6
- data/website/index.txt +4 -2
- data/website/rubyforge.html +3 -3
- data/website/version-raw.js +1 -1
- data/website/version.js +1 -1
- metadata +111 -27
- data/templates/Manifest.txt +0 -15
- data/templates/Rakefile +0 -123
- data/templates/website/index.txt +0 -38
- data/test/test_svn.rb +0 -13
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>content</key>
|
6
|
+
<string>== ${1:TRUNK} ${4:`date +%Y`}-${5:`date +%m`}-${6:`date +%d`}
|
7
|
+
|
8
|
+
* $0</string>
|
9
|
+
<key>name</key>
|
10
|
+
<string>History header trunk</string>
|
11
|
+
<key>scope</key>
|
12
|
+
<string>text.rdoc</string>
|
13
|
+
<key>tabTrigger</key>
|
14
|
+
<string>==t</string>
|
15
|
+
<key>uuid</key>
|
16
|
+
<string>30A49315-D6C1-4F70-8323-5C3BC80F1DAB</string>
|
17
|
+
</dict>
|
18
|
+
</plist>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>content</key>
|
6
|
+
<string>== ${1:0}.${2:0}.${3:0} ${4:`date +%Y`}-${5:`date +%m`}-${6:`date +%d`}
|
7
|
+
|
8
|
+
* $0</string>
|
9
|
+
<key>name</key>
|
10
|
+
<string>History header</string>
|
11
|
+
<key>scope</key>
|
12
|
+
<string>text.rdoc</string>
|
13
|
+
<key>tabTrigger</key>
|
14
|
+
<string>==</string>
|
15
|
+
<key>uuid</key>
|
16
|
+
<string>732C2F2F-3BA9-45B5-B803-FB03BC7C066B</string>
|
17
|
+
</dict>
|
18
|
+
</plist>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>fileTypes</key>
|
6
|
+
<array>
|
7
|
+
<string>txt</string>
|
8
|
+
</array>
|
9
|
+
<key>firstLineMatch</key>
|
10
|
+
<string>==</string>
|
11
|
+
<key>keyEquivalent</key>
|
12
|
+
<string>^~R</string>
|
13
|
+
<key>name</key>
|
14
|
+
<string>Rdoc</string>
|
15
|
+
<key>patterns</key>
|
16
|
+
<array>
|
17
|
+
<dict>
|
18
|
+
<key>begin</key>
|
19
|
+
<string>^(?=\S)(?![=-]{3,}(?=$))</string>
|
20
|
+
<key>end</key>
|
21
|
+
<string>^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n</string>
|
22
|
+
<key>name</key>
|
23
|
+
<string>markup.heading.rdoc</string>
|
24
|
+
<key>patterns</key>
|
25
|
+
<array>
|
26
|
+
<dict>
|
27
|
+
<key>include</key>
|
28
|
+
<string>#inline</string>
|
29
|
+
</dict>
|
30
|
+
<dict>
|
31
|
+
<key>include</key>
|
32
|
+
<string>text.html.basic</string>
|
33
|
+
</dict>
|
34
|
+
<dict>
|
35
|
+
<key>captures</key>
|
36
|
+
<dict>
|
37
|
+
<key>1</key>
|
38
|
+
<dict>
|
39
|
+
<key>name</key>
|
40
|
+
<string>punctuation.definition.heading.markdown</string>
|
41
|
+
</dict>
|
42
|
+
</dict>
|
43
|
+
<key>match</key>
|
44
|
+
<string>^(={3,})(?=[ \t]*$)</string>
|
45
|
+
<key>name</key>
|
46
|
+
<string>markup.heading.1.markdown</string>
|
47
|
+
</dict>
|
48
|
+
<dict>
|
49
|
+
<key>captures</key>
|
50
|
+
<dict>
|
51
|
+
<key>1</key>
|
52
|
+
<dict>
|
53
|
+
<key>name</key>
|
54
|
+
<string>punctuation.definition.heading.markdown</string>
|
55
|
+
</dict>
|
56
|
+
</dict>
|
57
|
+
<key>match</key>
|
58
|
+
<string>^(-{3,})(?=[ \t]*$)</string>
|
59
|
+
<key>name</key>
|
60
|
+
<string>markup.heading.2.markdown</string>
|
61
|
+
</dict>
|
62
|
+
</array>
|
63
|
+
</dict>
|
64
|
+
</array>
|
65
|
+
<key>scopeName</key>
|
66
|
+
<string>text.rdoc</string>
|
67
|
+
<key>uuid</key>
|
68
|
+
<string>4923E00C-3A77-452C-8AD7-7B2E2989029F</string>
|
69
|
+
</dict>
|
70
|
+
</plist>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>name</key>
|
6
|
+
<string>RubyGem</string>
|
7
|
+
<key>ordering</key>
|
8
|
+
<array>
|
9
|
+
<string>732C2F2F-3BA9-45B5-B803-FB03BC7C066B</string>
|
10
|
+
<string>30A49315-D6C1-4F70-8323-5C3BC80F1DAB</string>
|
11
|
+
<string>4923E00C-3A77-452C-8AD7-7B2E2989029F</string>
|
12
|
+
</array>
|
13
|
+
<key>uuid</key>
|
14
|
+
<string>5298EAB5-5E10-4285-B6B7-FC152EA37D45</string>
|
15
|
+
</dict>
|
16
|
+
</plist>
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
require 'newgem/version'
|
3
|
+
|
4
|
+
AUTHOR = "Dr Nic Williams"
|
5
|
+
EMAIL = "drnicwilliams@gmail.com"
|
6
|
+
DESCRIPTION = "Make your own gems at home"
|
7
|
+
GEM_NAME = "newgem" # what ppl will type to install your gem
|
8
|
+
RUBYFORGE_PROJECT = "newgem"
|
9
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
10
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
11
|
+
RUBYFORGE_USERNAME = "unknown"
|
12
|
+
if File.exists?(rubyforge_config_file = File.expand_path("~/.rubyforge/user-config.yml"))
|
13
|
+
config = YAML.load(File.read(rubyforge_config_file))
|
14
|
+
RUBYFORGE_USERNAME.replace config["username"]
|
15
|
+
end
|
16
|
+
|
17
|
+
REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
|
18
|
+
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
19
|
+
VERS = Newgem::VERSION::STRING + (REV ? ".#{REV}" : "")
|
20
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
|
21
|
+
|
22
|
+
# Generate all the Rake tasks
|
23
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
24
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
25
|
+
p.author = AUTHOR
|
26
|
+
p.description = DESCRIPTION
|
27
|
+
p.email = EMAIL
|
28
|
+
p.summary = DESCRIPTION
|
29
|
+
p.url = HOMEPATH
|
30
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
31
|
+
p.test_globs = ["test/**/test*.rb"]
|
32
|
+
p.clean_globs |= CLEAN #An array of file patterns to delete on clean.
|
33
|
+
|
34
|
+
# == Optional
|
35
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
36
|
+
p.extra_deps = [
|
37
|
+
['hoe', '>=1.3.0'],
|
38
|
+
['RedCloth','>=3.0.4'],
|
39
|
+
['syntax','>=1.0.0'],
|
40
|
+
['activesupport','>=1.4.2'],
|
41
|
+
['rubigen','>=1.0.0']
|
42
|
+
]
|
43
|
+
#p.spec_extras - A hash of extra values to set in the gemspec.
|
44
|
+
end
|
45
|
+
|
46
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
|
47
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
|
48
|
+
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Use svn_branch gem for branch/merge support
|
2
|
+
begin
|
3
|
+
Gem.manage_gems
|
4
|
+
gem = Gem.cache.search('svn_branch').sort_by { |g| g.version }.last
|
5
|
+
if gem.nil?
|
6
|
+
puts <<-EOS
|
7
|
+
You can install RubyGem 'svn_branch' to get helper tasks for svn branch management
|
8
|
+
gem install svn_branch
|
9
|
+
EOS
|
10
|
+
else
|
11
|
+
path = gem.full_gem_path
|
12
|
+
Dir[File.join(path, "/**/tasks/**/*.rake")].sort.each { |ext| load ext }
|
13
|
+
end
|
14
|
+
rescue LoadError
|
15
|
+
end
|
data/lib/newgem.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "erb"
|
2
|
+
|
3
|
+
module Newgem
|
4
|
+
class QuickTemplate
|
5
|
+
attr_reader :args, :text, :file
|
6
|
+
def initialize(file)
|
7
|
+
@file = file
|
8
|
+
@text = File.read(file)
|
9
|
+
end
|
10
|
+
def exec(b)
|
11
|
+
begin
|
12
|
+
# b = binding
|
13
|
+
template = ERB.new(@text, 0, "%<>")
|
14
|
+
result = template.result(b)
|
15
|
+
# Chomp the trailing newline
|
16
|
+
result.gsub(/\n$/,'')
|
17
|
+
rescue NameError
|
18
|
+
puts "Error found for #{file}"
|
19
|
+
raise $!
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def erb(file, b)
|
25
|
+
QuickTemplate.new(file).exec(b)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
data/lib/newgem/tasks.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Dir[File.join(File.dirname(__FILE__), %w[.. .. tasks], '**/*.rake')].each { |rake| load rake }
|
data/lib/newgem/version.rb
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
|
3
|
+
class InstallWebsiteGenerator < RubiGen::Base
|
4
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
5
|
+
Config::CONFIG['ruby_install_name'])
|
6
|
+
|
7
|
+
default_options :shebang => DEFAULT_SHEBANG,
|
8
|
+
:author => "TODO",
|
9
|
+
:email => nil
|
10
|
+
|
11
|
+
attr_reader :gem_name, :module_name
|
12
|
+
attr_reader :author, :email
|
13
|
+
|
14
|
+
def initialize(runtime_args, runtime_options = {})
|
15
|
+
super
|
16
|
+
@gem_name = File.basename(File.expand_path(destination_root))
|
17
|
+
@module_name = @gem_name.camelcase
|
18
|
+
extract_options
|
19
|
+
end
|
20
|
+
|
21
|
+
def manifest
|
22
|
+
script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
|
23
|
+
windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
|
24
|
+
|
25
|
+
record do |m|
|
26
|
+
# Ensure appropriate folder(s) exists
|
27
|
+
m.directory 'website/javascripts'
|
28
|
+
m.directory 'website/stylesheets'
|
29
|
+
m.directory 'script'
|
30
|
+
m.directory 'tasks'
|
31
|
+
|
32
|
+
# Website
|
33
|
+
m.template_copy_each %w( index.txt index.html ), "website"
|
34
|
+
|
35
|
+
%w( txt2html ).each do |file|
|
36
|
+
m.template "script/#{file}", "script/#{file}", script_options
|
37
|
+
m.template "script/win_script.cmd", "script/#{file}.cmd",
|
38
|
+
:assigns => { :filename => file } if windows
|
39
|
+
end
|
40
|
+
|
41
|
+
m.file_copy_each %w[ website.rake ], "tasks"
|
42
|
+
|
43
|
+
m.dependency "plain", [], :destination => destination_root
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
def banner
|
49
|
+
<<-EOS
|
50
|
+
Adds a website to a RubyGem (or any other project I guess.)
|
51
|
+
|
52
|
+
USAGE: #{$0} [options]"
|
53
|
+
EOS
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_options!(opts)
|
57
|
+
opts.separator ''
|
58
|
+
opts.separator 'Options:'
|
59
|
+
# For each option below, place the default
|
60
|
+
# at the top of the file next to "default_options"
|
61
|
+
opts.on("-a", "--author=\"Your Name\"", String,
|
62
|
+
"You. The author of this RubyGem. You name goes in in the website.",
|
63
|
+
"Default: 'TODO'") { |options[:author]| }
|
64
|
+
opts.on("-e", "--email=your@email.com", String,
|
65
|
+
"Your email for people to contact you.",
|
66
|
+
"Default: nil") { |options[:author]| }
|
67
|
+
end
|
68
|
+
|
69
|
+
def extract_options
|
70
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
71
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
72
|
+
# raw instance variable value.
|
73
|
+
@author = options[:author]
|
74
|
+
@email = options[:email]
|
75
|
+
end
|
76
|
+
end
|
@@ -1,13 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
+
begin
|
5
|
+
require 'newgem'
|
6
|
+
rescue LoadError
|
7
|
+
puts "\n\nGenerating the website requires the newgem RubyGem"
|
8
|
+
puts "Install: gem install newgem\n\n"
|
9
|
+
exit(1)
|
10
|
+
end
|
4
11
|
require 'redcloth'
|
5
12
|
require 'syntax/convertors/html'
|
6
13
|
require 'erb'
|
7
|
-
require File.dirname(__FILE__) + '/../lib
|
14
|
+
require File.dirname(__FILE__) + '/../lib/<%= gem_name %>/version.rb'
|
8
15
|
|
9
|
-
version =
|
10
|
-
download = 'http://rubyforge.org/projects
|
16
|
+
version = <%= module_name %>::VERSION::STRING
|
17
|
+
download = 'http://rubyforge.org/projects/<%= gem_name %>'
|
11
18
|
|
12
19
|
class Fixnum
|
13
20
|
def ordinal
|
@@ -25,7 +32,7 @@ end
|
|
25
32
|
|
26
33
|
class Time
|
27
34
|
def pretty
|
28
|
-
return "
|
35
|
+
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
|
29
36
|
end
|
30
37
|
end
|
31
38
|
|
@@ -35,10 +42,10 @@ end
|
|
35
42
|
|
36
43
|
if ARGV.length >= 1
|
37
44
|
src, template = ARGV
|
38
|
-
template ||= File.dirname(__FILE__)
|
45
|
+
template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
|
39
46
|
|
40
47
|
else
|
41
|
-
puts("Usage:
|
48
|
+
puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
|
42
49
|
exit!
|
43
50
|
end
|
44
51
|
|
@@ -53,8 +60,8 @@ File.open(src) do |fsrc|
|
|
53
60
|
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
|
54
61
|
ident = syntax_items.length
|
55
62
|
element, syntax, source = $1, $2, $3
|
56
|
-
syntax_items << "
|
57
|
-
"syntax-temp
|
63
|
+
syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
|
64
|
+
"syntax-temp-#{ident}"
|
58
65
|
}
|
59
66
|
title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
|
60
67
|
body = RedCloth.new(body_text).to_html
|
@@ -0,0 +1,17 @@
|
|
1
|
+
desc 'Generate website files'
|
2
|
+
task :website_generate => :ruby_env do
|
3
|
+
(Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
|
4
|
+
sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'Upload website files to rubyforge'
|
9
|
+
task :website_upload do
|
10
|
+
host = "#{RUBYFORGE_USERNAME}@rubyforge.org"
|
11
|
+
remote_dir = "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/"
|
12
|
+
local_dir = 'website'
|
13
|
+
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Generate and upload website files'
|
17
|
+
task :website => [:website_generate, :website_upload, :publish_docs]
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
3
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
4
|
-
<title
|
4
|
+
<title><%= gem_name %></title>
|
5
5
|
|
6
6
|
</head>
|
7
7
|
<body id="body">
|
8
|
-
<p>This page has not yet been created for RubyGem <code
|
8
|
+
<p>This page has not yet been created for RubyGem <code><%= gem_name %></code></p>
|
9
9
|
<p>To the developer: To generate it, update website/index.txt and run the rake task <code>website</code> to generate this <code>index.html</code> file.</p>
|
10
10
|
</body>
|
11
11
|
</html>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
h1. <%= gem_name.gsub(/\W+/,' ') %>
|
2
|
+
|
3
|
+
h1. → '<%= gem_name %>'
|
4
|
+
|
5
|
+
|
6
|
+
h2. What
|
7
|
+
|
8
|
+
|
9
|
+
h2. Installing
|
10
|
+
|
11
|
+
<pre syntax="ruby">sudo gem install <%= gem_name %></pre>
|
12
|
+
|
13
|
+
h2. The basics
|
14
|
+
|
15
|
+
|
16
|
+
h2. Demonstration of usage
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
h2. Forum
|
21
|
+
|
22
|
+
"http://groups.google.com/group/<%= gem_name %>":http://groups.google.com/group/<%= gem_name %>
|
23
|
+
|
24
|
+
TODO - create Google Group - <%= gem_name %>
|
25
|
+
|
26
|
+
h2. How to submit patches
|
27
|
+
|
28
|
+
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
29
|
+
|
30
|
+
The trunk repository is <code>svn://rubyforge.org/var/svn/<%= gem_name %>/trunk</code> for anonymous access.
|
31
|
+
|
32
|
+
h2. License
|
33
|
+
|
34
|
+
This code is free to use under the terms of the MIT license.
|
35
|
+
|
36
|
+
h2. Contact
|
37
|
+
|
38
|
+
Comments are welcome. Send an email to "<%= author %>":mailto:<%= email %> via the "forum":http://groups.google.com/group/<%= gem_name %>
|
39
|
+
|