ruboss4ruby 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/History.txt +3 -0
  2. data/Manifest.txt +102 -0
  3. data/README.txt +37 -0
  4. data/Rakefile +4 -0
  5. data/config/hoe.rb +72 -0
  6. data/config/requirements.rb +15 -0
  7. data/gpl-3.0.txt +674 -0
  8. data/lib/ruboss4ruby/active_foo.rb +127 -0
  9. data/lib/ruboss4ruby/active_record_tasks.rb +75 -0
  10. data/lib/ruboss4ruby/configuration.rb +38 -0
  11. data/lib/ruboss4ruby/tasks.rb +81 -0
  12. data/lib/ruboss4ruby/version.rb +11 -0
  13. data/lib/ruboss4ruby.rb +61 -0
  14. data/merb_generators/ruboss_config/USAGE +18 -0
  15. data/merb_generators/ruboss_config/ruboss_config_generator.rb +135 -0
  16. data/merb_generators/ruboss_config/templates/actionscript.properties +16 -0
  17. data/merb_generators/ruboss_config/templates/actionscriptair.properties +16 -0
  18. data/merb_generators/ruboss_config/templates/expressInstall.swf +0 -0
  19. data/merb_generators/ruboss_config/templates/flex.properties +2 -0
  20. data/merb_generators/ruboss_config/templates/html-template/AC_OETags.js +276 -0
  21. data/merb_generators/ruboss_config/templates/html-template/history/history.css +6 -0
  22. data/merb_generators/ruboss_config/templates/html-template/history/history.js +645 -0
  23. data/merb_generators/ruboss_config/templates/html-template/history/historyFrame.html +29 -0
  24. data/merb_generators/ruboss_config/templates/html-template/index.template.html +121 -0
  25. data/merb_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
  26. data/merb_generators/ruboss_config/templates/index.html.erb +19 -0
  27. data/merb_generators/ruboss_config/templates/mainair-app.xml +134 -0
  28. data/merb_generators/ruboss_config/templates/mainapp.mxml +34 -0
  29. data/merb_generators/ruboss_config/templates/project.properties +18 -0
  30. data/merb_generators/ruboss_config/templates/projectair.properties +24 -0
  31. data/merb_generators/ruboss_config/templates/swfobject.js +5 -0
  32. data/merb_generators/ruboss_controller/USAGE +11 -0
  33. data/merb_generators/ruboss_controller/ruboss_controller_generator.rb +32 -0
  34. data/merb_generators/ruboss_controller/templates/controller.as.erb +35 -0
  35. data/merb_generators/ruboss_resource_controller/USAGE +5 -0
  36. data/merb_generators/ruboss_resource_controller/ruboss_resource_controller_generator.rb +70 -0
  37. data/merb_generators/ruboss_resource_controller/templates/app/controllers/%controller_file_name%.rb +55 -0
  38. data/merb_generators/ruboss_resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +16 -0
  39. data/merb_generators/ruboss_scaffold/USAGE +5 -0
  40. data/merb_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +189 -0
  41. data/merb_generators/ruboss_scaffold/templates/component.mxml.erb +148 -0
  42. data/merb_generators/ruboss_scaffold/templates/fixtures.yml.erb +35 -0
  43. data/merb_generators/ruboss_scaffold/templates/migration.rb.erb +19 -0
  44. data/merb_generators/ruboss_scaffold/templates/model.as.erb +42 -0
  45. data/merb_generators/ruboss_scaffold/templates/model.rb.erb +11 -0
  46. data/merb_generators/ruboss_yaml_scaffold/USAGE +5 -0
  47. data/merb_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +53 -0
  48. data/rails_generators/ruboss_config/USAGE +18 -0
  49. data/rails_generators/ruboss_config/ruboss_config_generator.rb +127 -0
  50. data/rails_generators/ruboss_config/templates/actionscript.properties +16 -0
  51. data/rails_generators/ruboss_config/templates/actionscriptair.properties +16 -0
  52. data/rails_generators/ruboss_config/templates/expressInstall.swf +0 -0
  53. data/rails_generators/ruboss_config/templates/flex.properties +2 -0
  54. data/rails_generators/ruboss_config/templates/html-template/AC_OETags.js +276 -0
  55. data/rails_generators/ruboss_config/templates/html-template/history/history.css +6 -0
  56. data/rails_generators/ruboss_config/templates/html-template/history/history.js +645 -0
  57. data/rails_generators/ruboss_config/templates/html-template/history/historyFrame.html +29 -0
  58. data/rails_generators/ruboss_config/templates/html-template/index.template.html +121 -0
  59. data/rails_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
  60. data/rails_generators/ruboss_config/templates/index.html.erb +19 -0
  61. data/rails_generators/ruboss_config/templates/mainair-app.xml +134 -0
  62. data/rails_generators/ruboss_config/templates/mainapp.mxml +34 -0
  63. data/rails_generators/ruboss_config/templates/project.properties +18 -0
  64. data/rails_generators/ruboss_config/templates/projectair.properties +24 -0
  65. data/rails_generators/ruboss_config/templates/ruboss.yml +16 -0
  66. data/rails_generators/ruboss_config/templates/ruboss_tasks.rake +15 -0
  67. data/rails_generators/ruboss_config/templates/swfobject.js +5 -0
  68. data/rails_generators/ruboss_controller/USAGE +11 -0
  69. data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +46 -0
  70. data/rails_generators/ruboss_controller/templates/controller.as.erb +35 -0
  71. data/rails_generators/ruboss_scaffold/USAGE +35 -0
  72. data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +192 -0
  73. data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +148 -0
  74. data/rails_generators/ruboss_scaffold/templates/controller.rb.erb +97 -0
  75. data/rails_generators/ruboss_scaffold/templates/fixtures.yml.erb +35 -0
  76. data/rails_generators/ruboss_scaffold/templates/migration.rb.erb +19 -0
  77. data/rails_generators/ruboss_scaffold/templates/model.as.erb +42 -0
  78. data/rails_generators/ruboss_scaffold/templates/model.rb.erb +11 -0
  79. data/rails_generators/ruboss_yaml_scaffold/USAGE +14 -0
  80. data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +45 -0
  81. data/rcl-1.0.txt +0 -0
  82. data/script/console +10 -0
  83. data/script/destroy +14 -0
  84. data/script/generate +14 -0
  85. data/script/txt2html +82 -0
  86. data/setup.rb +1585 -0
  87. data/tasks/deployment.rake +34 -0
  88. data/tasks/environment.rake +7 -0
  89. data/tasks/website.rake +17 -0
  90. data/test/active_foo_test.rb +16 -0
  91. data/test/test_generator_helper.rb +29 -0
  92. data/test/test_helper.rb +2 -0
  93. data/test/test_ruboss_config_generator.rb +45 -0
  94. data/test/test_ruboss_controller_generator.rb +45 -0
  95. data/test/test_ruboss_on_ruby.rb +11 -0
  96. data/test/test_ruboss_scaffold_generator.rb +45 -0
  97. data/test/test_ruboss_yaml_scaffold_generator.rb +46 -0
  98. data/website/index.html +63 -0
  99. data/website/index.txt +34 -0
  100. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  101. data/website/stylesheets/screen.css +138 -0
  102. data/website/template.html.erb +47 -0
  103. 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)