ruboss4ruby 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +102 -0
- data/README.txt +37 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +72 -0
- data/config/requirements.rb +15 -0
- data/gpl-3.0.txt +674 -0
- data/lib/ruboss4ruby/active_foo.rb +127 -0
- data/lib/ruboss4ruby/active_record_tasks.rb +75 -0
- data/lib/ruboss4ruby/configuration.rb +38 -0
- data/lib/ruboss4ruby/tasks.rb +81 -0
- data/lib/ruboss4ruby/version.rb +11 -0
- data/lib/ruboss4ruby.rb +61 -0
- data/merb_generators/ruboss_config/USAGE +18 -0
- data/merb_generators/ruboss_config/ruboss_config_generator.rb +135 -0
- data/merb_generators/ruboss_config/templates/actionscript.properties +16 -0
- data/merb_generators/ruboss_config/templates/actionscriptair.properties +16 -0
- data/merb_generators/ruboss_config/templates/expressInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/flex.properties +2 -0
- data/merb_generators/ruboss_config/templates/html-template/AC_OETags.js +276 -0
- data/merb_generators/ruboss_config/templates/html-template/history/history.css +6 -0
- data/merb_generators/ruboss_config/templates/html-template/history/history.js +645 -0
- data/merb_generators/ruboss_config/templates/html-template/history/historyFrame.html +29 -0
- data/merb_generators/ruboss_config/templates/html-template/index.template.html +121 -0
- data/merb_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/index.html.erb +19 -0
- data/merb_generators/ruboss_config/templates/mainair-app.xml +134 -0
- data/merb_generators/ruboss_config/templates/mainapp.mxml +34 -0
- data/merb_generators/ruboss_config/templates/project.properties +18 -0
- data/merb_generators/ruboss_config/templates/projectair.properties +24 -0
- data/merb_generators/ruboss_config/templates/swfobject.js +5 -0
- data/merb_generators/ruboss_controller/USAGE +11 -0
- data/merb_generators/ruboss_controller/ruboss_controller_generator.rb +32 -0
- data/merb_generators/ruboss_controller/templates/controller.as.erb +35 -0
- data/merb_generators/ruboss_resource_controller/USAGE +5 -0
- data/merb_generators/ruboss_resource_controller/ruboss_resource_controller_generator.rb +70 -0
- data/merb_generators/ruboss_resource_controller/templates/app/controllers/%controller_file_name%.rb +55 -0
- data/merb_generators/ruboss_resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +16 -0
- data/merb_generators/ruboss_scaffold/USAGE +5 -0
- data/merb_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +189 -0
- data/merb_generators/ruboss_scaffold/templates/component.mxml.erb +148 -0
- data/merb_generators/ruboss_scaffold/templates/fixtures.yml.erb +35 -0
- data/merb_generators/ruboss_scaffold/templates/migration.rb.erb +19 -0
- data/merb_generators/ruboss_scaffold/templates/model.as.erb +42 -0
- data/merb_generators/ruboss_scaffold/templates/model.rb.erb +11 -0
- data/merb_generators/ruboss_yaml_scaffold/USAGE +5 -0
- data/merb_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +53 -0
- data/rails_generators/ruboss_config/USAGE +18 -0
- data/rails_generators/ruboss_config/ruboss_config_generator.rb +127 -0
- data/rails_generators/ruboss_config/templates/actionscript.properties +16 -0
- data/rails_generators/ruboss_config/templates/actionscriptair.properties +16 -0
- data/rails_generators/ruboss_config/templates/expressInstall.swf +0 -0
- data/rails_generators/ruboss_config/templates/flex.properties +2 -0
- data/rails_generators/ruboss_config/templates/html-template/AC_OETags.js +276 -0
- data/rails_generators/ruboss_config/templates/html-template/history/history.css +6 -0
- data/rails_generators/ruboss_config/templates/html-template/history/history.js +645 -0
- data/rails_generators/ruboss_config/templates/html-template/history/historyFrame.html +29 -0
- data/rails_generators/ruboss_config/templates/html-template/index.template.html +121 -0
- data/rails_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
- data/rails_generators/ruboss_config/templates/index.html.erb +19 -0
- data/rails_generators/ruboss_config/templates/mainair-app.xml +134 -0
- data/rails_generators/ruboss_config/templates/mainapp.mxml +34 -0
- data/rails_generators/ruboss_config/templates/project.properties +18 -0
- data/rails_generators/ruboss_config/templates/projectair.properties +24 -0
- data/rails_generators/ruboss_config/templates/ruboss.yml +16 -0
- data/rails_generators/ruboss_config/templates/ruboss_tasks.rake +15 -0
- data/rails_generators/ruboss_config/templates/swfobject.js +5 -0
- data/rails_generators/ruboss_controller/USAGE +11 -0
- data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +46 -0
- data/rails_generators/ruboss_controller/templates/controller.as.erb +35 -0
- data/rails_generators/ruboss_scaffold/USAGE +35 -0
- data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +192 -0
- data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +148 -0
- data/rails_generators/ruboss_scaffold/templates/controller.rb.erb +97 -0
- data/rails_generators/ruboss_scaffold/templates/fixtures.yml.erb +35 -0
- data/rails_generators/ruboss_scaffold/templates/migration.rb.erb +19 -0
- data/rails_generators/ruboss_scaffold/templates/model.as.erb +42 -0
- data/rails_generators/ruboss_scaffold/templates/model.rb.erb +11 -0
- data/rails_generators/ruboss_yaml_scaffold/USAGE +14 -0
- data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +45 -0
- data/rcl-1.0.txt +0 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +82 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/active_foo_test.rb +16 -0
- data/test/test_generator_helper.rb +29 -0
- data/test/test_helper.rb +2 -0
- data/test/test_ruboss_config_generator.rb +45 -0
- data/test/test_ruboss_controller_generator.rb +45 -0
- data/test/test_ruboss_on_ruby.rb +11 -0
- data/test/test_ruboss_scaffold_generator.rb +45 -0
- data/test/test_ruboss_yaml_scaffold_generator.rb +46 -0
- data/website/index.html +63 -0
- data/website/index.txt +34 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.html.erb +47 -0
- metadata +167 -0
data/script/txt2html
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
GEM_NAME = 'ruboss4ruby' # what ppl will type to install your gem
|
4
|
+
RUBYFORGE_PROJECT = 'ruboss4ruby'
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
begin
|
8
|
+
require 'newgem'
|
9
|
+
require 'rubyforge'
|
10
|
+
rescue LoadError
|
11
|
+
puts "\n\nGenerating the website requires the newgem RubyGem"
|
12
|
+
puts "Install: gem install newgem\n\n"
|
13
|
+
exit(1)
|
14
|
+
end
|
15
|
+
require 'redcloth'
|
16
|
+
require 'syntax/convertors/html'
|
17
|
+
require 'erb'
|
18
|
+
require File.dirname(__FILE__) + "/../lib/#{GEM_NAME}/version.rb"
|
19
|
+
|
20
|
+
version = Ruboss::VERSION::STRING
|
21
|
+
download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
22
|
+
|
23
|
+
def rubyforge_project_id
|
24
|
+
RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
|
25
|
+
end
|
26
|
+
|
27
|
+
class Fixnum
|
28
|
+
def ordinal
|
29
|
+
# teens
|
30
|
+
return 'th' if (10..19).include?(self % 100)
|
31
|
+
# others
|
32
|
+
case self % 10
|
33
|
+
when 1: return 'st'
|
34
|
+
when 2: return 'nd'
|
35
|
+
when 3: return 'rd'
|
36
|
+
else return 'th'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Time
|
42
|
+
def pretty
|
43
|
+
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def convert_syntax(syntax, source)
|
48
|
+
return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
|
49
|
+
end
|
50
|
+
|
51
|
+
if ARGV.length >= 1
|
52
|
+
src, template = ARGV
|
53
|
+
template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
|
54
|
+
else
|
55
|
+
puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
|
56
|
+
exit!
|
57
|
+
end
|
58
|
+
|
59
|
+
template = ERB.new(File.open(template).read)
|
60
|
+
|
61
|
+
title = nil
|
62
|
+
body = nil
|
63
|
+
File.open(src) do |fsrc|
|
64
|
+
title_text = fsrc.readline
|
65
|
+
body_text_template = fsrc.read
|
66
|
+
body_text = ERB.new(body_text_template).result(binding)
|
67
|
+
syntax_items = []
|
68
|
+
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
|
69
|
+
ident = syntax_items.length
|
70
|
+
element, syntax, source = $1, $2, $3
|
71
|
+
syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
|
72
|
+
"syntax-temp-#{ident}"
|
73
|
+
}
|
74
|
+
title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
|
75
|
+
body = RedCloth.new(body_text).to_html
|
76
|
+
body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
|
77
|
+
end
|
78
|
+
stat = File.stat(src)
|
79
|
+
created = stat.ctime
|
80
|
+
modified = stat.mtime
|
81
|
+
|
82
|
+
$stdout << template.result(binding)
|