ruboss4ruby 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. data/History.txt +2 -2
  2. data/Manifest.txt +86 -79
  3. data/README.rdoc +53 -0
  4. data/Rakefile +42 -5
  5. data/app_generators/ruboss_app/USAGE +22 -0
  6. data/app_generators/ruboss_app/ruboss_app_generator.rb +94 -0
  7. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/actionscript.properties +1 -1
  8. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/actionscriptair.properties +0 -0
  9. data/app_generators/ruboss_app/templates/app.yaml.erb +12 -0
  10. data/app_generators/ruboss_app/templates/default_tasks.rake +51 -0
  11. data/app_generators/ruboss_app/templates/empty.txt +0 -0
  12. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/expressInstall.swf +0 -0
  13. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/flex.properties +0 -0
  14. data/app_generators/ruboss_app/templates/generate.rb +17 -0
  15. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/AC_OETags.js +0 -0
  16. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.css +0 -0
  17. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.js +0 -0
  18. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/historyFrame.html +0 -0
  19. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/index.template.html +0 -0
  20. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/playerProductInstall.swf +0 -0
  21. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/index.html.erb +2 -2
  22. data/app_generators/ruboss_app/templates/index.yaml +11 -0
  23. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/mainair-app.xml +3 -3
  24. data/app_generators/ruboss_app/templates/mainapp-config.xml +21 -0
  25. data/{merb_generators/templates/ruboss_flex_app → app_generators/ruboss_app/templates}/mainapp.mxml +6 -9
  26. data/app_generators/ruboss_app/templates/project-textmate.erb +52 -0
  27. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/project.properties +0 -0
  28. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/projectair.properties +0 -0
  29. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/swfobject.js +0 -0
  30. data/bin/ruboss-gen +31 -0
  31. data/generators/ruboss_config/USAGE +5 -0
  32. data/generators/ruboss_config/ruboss_config_generator.rb +19 -0
  33. data/generators/ruboss_controller/USAGE +10 -0
  34. data/generators/ruboss_controller/ruboss_controller_generator.rb +38 -0
  35. data/generators/ruboss_controller/templates/assist.py +65 -0
  36. data/{merb_generators/templates/ruboss_controller → generators/ruboss_controller/templates}/controller.as.erb +7 -6
  37. data/generators/ruboss_controller/templates/restful.py +136 -0
  38. data/generators/ruboss_main_app/USAGE +8 -0
  39. data/generators/ruboss_main_app/ruboss_main_app_generator.rb +60 -0
  40. data/generators/ruboss_main_app/templates/main.py.erb +29 -0
  41. data/generators/ruboss_main_app/templates/mainapp.mxml +35 -0
  42. data/generators/ruboss_scaffold/USAGE +29 -0
  43. data/generators/ruboss_scaffold/ruboss_scaffold_generator.rb +148 -0
  44. data/generators/ruboss_scaffold/templates/component.mxml.erb +149 -0
  45. data/generators/ruboss_scaffold/templates/controller.py.erb +27 -0
  46. data/generators/ruboss_scaffold/templates/model.as.erb +42 -0
  47. data/generators/ruboss_scaffold/templates/model.py.erb +14 -0
  48. data/generators/ruboss_yaml_scaffold/USAGE +45 -0
  49. data/generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +47 -0
  50. data/lib/ruboss4ruby/active_foo.rb +109 -86
  51. data/lib/ruboss4ruby/active_record_default_methods.rb +66 -0
  52. data/lib/ruboss4ruby/active_record_tasks.rb +10 -4
  53. data/lib/ruboss4ruby/configuration.rb +48 -34
  54. data/lib/ruboss4ruby/datamapper_foo.rb +31 -0
  55. data/lib/ruboss4ruby/{recipes.rb → rails/recipes.rb} +7 -9
  56. data/lib/ruboss4ruby/{ruboss_helper.rb → rails/swf_helper.rb} +14 -8
  57. data/lib/ruboss4ruby/tasks.rb +9 -4
  58. data/lib/ruboss4ruby.rb +72 -27
  59. data/rails_generators/ruboss_config/ruboss_config_generator.rb +3 -15
  60. data/rails_generators/ruboss_config/templates/mainair-app.xml +2 -2
  61. data/rails_generators/ruboss_config/templates/mainapp-config.xml +1 -1
  62. data/rails_generators/ruboss_config/templates/ruboss.yml +2 -4
  63. data/rails_generators/ruboss_config/templates/ruboss_tasks.rake +5 -15
  64. data/rails_generators/ruboss_controller/USAGE +1 -2
  65. data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +3 -14
  66. data/rails_generators/ruboss_controller/templates/controller.as.erb +11 -6
  67. data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +67 -76
  68. data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +69 -69
  69. data/rails_generators/ruboss_scaffold/templates/model.as.erb +2 -2
  70. data/rails_generators/ruboss_yaml_scaffold/USAGE +38 -1
  71. data/rcl-1.0.txt +0 -0
  72. data/rdoc/generators/template/html/jamis.rb +588 -0
  73. data/ruboss4ruby.gemspec +43 -0
  74. data/spec/ruboss4ruby_spec.rb +7 -0
  75. data/spec/spec_helper.rb +16 -0
  76. data/tasks/ann.rake +80 -0
  77. data/tasks/bones.rake +20 -0
  78. data/tasks/gem.rake +201 -0
  79. data/tasks/git.rake +40 -0
  80. data/tasks/manifest.rake +48 -0
  81. data/tasks/notes.rake +27 -0
  82. data/tasks/post_load.rake +39 -0
  83. data/tasks/rdoc.rake +50 -0
  84. data/tasks/rubyforge.rake +55 -0
  85. data/tasks/setup.rb +279 -0
  86. data/tasks/spec.rake +54 -0
  87. data/tasks/svn.rake +47 -0
  88. data/tasks/test.rake +40 -0
  89. data/test/{controllers → rails/controllers}/application.rb +0 -0
  90. data/test/{controllers → rails/controllers}/locations_controller.rb +0 -0
  91. data/test/{controllers → rails/controllers}/notes_controller.rb +0 -0
  92. data/test/{controllers → rails/controllers}/projects_controller.rb +0 -0
  93. data/test/{controllers → rails/controllers}/tasks_controller.rb +0 -0
  94. data/test/{controllers → rails/controllers}/users_controller.rb +0 -0
  95. data/test/{database.yml → rails/database.yml} +0 -0
  96. data/test/{fixtures → rails/fixtures}/locations.yml +0 -0
  97. data/test/{fixtures → rails/fixtures}/notes.yml +0 -0
  98. data/test/{fixtures → rails/fixtures}/projects.yml +0 -0
  99. data/test/rails/fixtures/simple_properties.yml +19 -0
  100. data/test/{fixtures → rails/fixtures}/tasks.yml +0 -0
  101. data/test/{fixtures → rails/fixtures}/users.yml +0 -0
  102. data/test/{helpers → rails/helpers}/functional_test_helper.rb +0 -11
  103. data/test/rails/helpers/test_helper.rb +61 -0
  104. data/test/rails/helpers/unit_test_helper.rb +30 -0
  105. data/test/{model.yml → rails/model.yml} +0 -0
  106. data/test/{models → rails/models}/location.rb +0 -0
  107. data/test/{models → rails/models}/note.rb +0 -0
  108. data/test/{models → rails/models}/project.rb +1 -3
  109. data/test/rails/models/simple_property.rb +2 -0
  110. data/test/{models → rails/models}/task.rb +1 -1
  111. data/test/{models → rails/models}/user.rb +1 -2
  112. data/test/{playing_around_in_a_console.txt → rails/playing_around_in_a_console.txt} +0 -0
  113. data/test/{schema.rb → rails/schema.rb} +14 -0
  114. data/test/{test.swf → rails/test.swf} +0 -0
  115. data/test/rails/test_active_foo.rb +81 -0
  116. data/test/{test_ruboss_rails_integration_functional.rb → rails/test_ruboss_rails_integration_functional.rb} +4 -9
  117. data/test/{to_fxml_test.rb → rails/test_to_fxml.rb} +35 -37
  118. data/test/rails/test_to_json.rb +23 -0
  119. data/test/{views → rails/views}/notes/empty_params_action.html.erb +0 -0
  120. data/test/{views → rails/views}/notes/index.html.erb +0 -0
  121. metadata +138 -103
  122. data/Generators +0 -5
  123. data/README.txt +0 -37
  124. data/config/hoe.rb +0 -72
  125. data/config/requirements.rb +0 -15
  126. data/lib/ruboss4ruby/generated_attribute.rb +0 -61
  127. data/lib/ruboss4ruby/ruboss_test_helpers.rb +0 -31
  128. data/lib/ruboss4ruby/version.rb +0 -11
  129. data/merb_generators/ruboss_config.rb +0 -105
  130. data/merb_generators/ruboss_controller.rb +0 -61
  131. data/merb_generators/ruboss_flex_app.rb +0 -69
  132. data/merb_generators/ruboss_resource_controller.rb +0 -4
  133. data/merb_generators/ruboss_scaffold.rb +0 -158
  134. data/merb_generators/templates/ruboss_config/ruboss.yml +0 -16
  135. data/merb_generators/templates/ruboss_resource_controller/controller.rb.erb +0 -49
  136. data/script/console +0 -10
  137. data/script/destroy +0 -14
  138. data/script/generate +0 -14
  139. data/script/txt2html +0 -82
  140. data/setup.rb +0 -1585
  141. data/tasks/deployment.rake +0 -34
  142. data/tasks/environment.rake +0 -7
  143. data/tasks/website.rake +0 -17
  144. data/test/helpers/controllers.log +0 -8
  145. data/test/helpers/models.log +0 -170
  146. data/test/helpers/test_helper.rb +0 -25
  147. data/test/helpers/unit_test_helper.rb +0 -23
  148. data/test/test.sqlite3 +0 -0
  149. data/test/test_active_foo.rb +0 -79
  150. data/test/test_swfobject_helper.rb +0 -63
  151. data/website/index.html +0 -63
  152. data/website/index.txt +0 -34
  153. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  154. data/website/stylesheets/screen.css +0 -138
  155. data/website/template.html.erb +0 -47
@@ -1,106 +1,106 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" label="<%= class_name %>"
3
3
  xmlns:rcomponents="org.ruboss.components.*">
4
- <mx:Script><![CDATA[
5
- import org.ruboss.Ruboss;
6
- import org.ruboss.utils.RubossUtils;
7
- import <%= base_package %>.models.<%= class_name %>;
4
+ <mx:Script><![CDATA[
5
+ import org.ruboss.Ruboss;
6
+ import org.ruboss.utils.RubossUtils;
7
+ import <%= base_package %>.models.<%= class_name %>;
8
8
  <% for model in belongs_tos -%>
9
- import <%= base_package %>.models.<%= model.camelcase %>;
9
+ import <%= base_package %>.models.<%= model.camelcase %>;
10
10
  <% end -%>
11
11
 
12
- [Bindable]
13
- private var _<%= class_name.downcase_first_letter %>:<%= class_name %> = new <%= class_name %>();
12
+ [Bindable]
13
+ private var _<%= class_name.dcfirst %>:<%= class_name %> = new <%= class_name %>();
14
14
 
15
- private function new<%= class_name %>():void {
16
- _<%= class_name.downcase_first_letter %> = new <%= class_name %>();
17
- <%= class_name.downcase_first_letter.pluralize %>List.selectedIndex = -1;
18
- }
15
+ private function new<%= class_name %>():void {
16
+ _<%= class_name.dcfirst %> = new <%= class_name %>();
17
+ <%= class_name.dcfirst.pluralize %>List.selectedIndex = -1;
18
+ }
19
19
 
20
- private function save<%= class_name %>():void {
21
- if (_<%= class_name.downcase_first_letter %>.id) {
22
- update<%= class_name %>();
23
- } else {
24
- create<%= class_name %>();
20
+ private function save<%= class_name %>():void {
21
+ if (_<%= class_name.dcfirst %>.id) {
22
+ update<%= class_name %>();
23
+ } else {
24
+ create<%= class_name %>();
25
+ }
25
26
  }
26
- }
27
27
 
28
- private function create<%= class_name %>():void {
29
- var <%= class_name.downcase_first_letter %>:<%= class_name %> = new <%= class_name %>();
28
+ private function create<%= class_name %>():void {
29
+ var <%= class_name.dcfirst %>:<%= class_name %> = new <%= class_name %>();
30
30
  <% for attribute in attributes -%>
31
31
  <% if attribute.type == :boolean -%>
32
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
32
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
33
33
  <% elsif attribute.type == :string -%>
34
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextInput.text;
34
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextInput.text;
35
35
  <% elsif attribute.type == :text -%>
36
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextArea.text;
36
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextArea.text;
37
37
  <% elsif attribute.type == :datetime || attribute.type == :time -%>
38
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateTimeTextInput.date;
38
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateTimeTextInput.date;
39
39
  <% elsif attribute.type == :date -%>
40
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateField.selectedDate;
40
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateField.selectedDate;
41
41
  <% else -%>
42
- <%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_type %>(<%= attribute.flex_name %>TextInput.text);
42
+ <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_type %>(<%= attribute.flex_name %>TextInput.text);
43
43
  <% end -%>
44
44
  <% end -%>
45
45
 
46
46
  <% for model in belongs_tos -%>
47
- <%= class_name.downcase_first_letter %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
47
+ <%= class_name.dcfirst %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
48
48
  <% end -%>
49
- <%= class_name.downcase_first_letter %>.create({afterCallback: on<%= class_name %>Create});
50
- }
49
+ <%= class_name.dcfirst %>.create({onSuccess: on<%= class_name %>Create});
50
+ }
51
51
 
52
- private function update<%= class_name %>():void {
52
+ private function update<%= class_name %>():void {
53
53
  <% for attribute in attributes -%>
54
54
  <% if attribute.type == :boolean -%>
55
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
55
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
56
56
  <% elsif attribute.type == :string -%>
57
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextInput.text;
57
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextInput.text;
58
58
  <% elsif attribute.type == :text -%>
59
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextArea.text;
59
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextArea.text;
60
60
  <% elsif attribute.type == :datetime || attribute.type == :time -%>
61
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateTimeTextInput.date;
61
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateTimeTextInput.date;
62
62
  <% elsif attribute.type == :date -%>
63
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateField.selectedDate;
63
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateField.selectedDate;
64
64
  <% else -%>
65
- _<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %> = <%= attribute.flex_type %>(<%= attribute.flex_name %>TextInput.text);
65
+ _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_type %>(<%= attribute.flex_name %>TextInput.text);
66
66
  <% end -%>
67
67
  <% end -%>
68
68
 
69
69
  <% for model in belongs_tos -%>
70
- _<%= class_name.downcase_first_letter %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
70
+ _<%= class_name.dcfirst %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
71
71
  <% end -%>
72
- _<%= class_name.downcase_first_letter %>.update({afterCallback: on<%= class_name %>Update});
73
- }
72
+ _<%= class_name.dcfirst %>.update({onSuccess: on<%= class_name %>Update});
73
+ }
74
74
 
75
- private function destroy<%= class_name %>():void {
76
- _<%= class_name.downcase_first_letter %>.destroy({afterCallback: on<%= class_name %>Destroy});
77
- }
75
+ private function destroy<%= class_name %>():void {
76
+ _<%= class_name.dcfirst %>.destroy({onSuccess: on<%= class_name %>Destroy});
77
+ }
78
78
 
79
- private function on<%= class_name %>Select():void {
80
- _<%= class_name.downcase_first_letter %> = RubossUtils.clone(<%= class_name.downcase_first_letter.pluralize %>List.selectedItem) as <%= class_name %>;
81
- }
79
+ private function on<%= class_name %>Select():void {
80
+ _<%= class_name.dcfirst %> = RubossUtils.clone(<%= class_name.dcfirst.pluralize %>List.selectedItem) as <%= class_name %>;
81
+ }
82
82
 
83
- private function on<%= class_name %>Create(<%= class_name.downcase_first_letter %>:<%= class_name %>):void {
84
- _<%= class_name.downcase_first_letter %> = new <%= class_name %>;
85
- }
83
+ private function on<%= class_name %>Create(<%= class_name.dcfirst %>:<%= class_name %>):void {
84
+ _<%= class_name.dcfirst %> = new <%= class_name %>;
85
+ }
86
86
 
87
- private function on<%= class_name %>Update(<%= class_name.downcase_first_letter %>:<%= class_name %>):void {
88
- <%= class_name.downcase_first_letter.pluralize %>List.selectedItem = <%= class_name.downcase_first_letter %>;
89
- _<%= class_name.downcase_first_letter %> = RubossUtils.clone(<%= class_name.downcase_first_letter %>) as <%= class_name %>;
90
- }
87
+ private function on<%= class_name %>Update(<%= class_name.dcfirst %>:<%= class_name %>):void {
88
+ <%= class_name.dcfirst.pluralize %>List.selectedItem = <%= class_name.dcfirst %>;
89
+ _<%= class_name.dcfirst %> = RubossUtils.clone(<%= class_name.dcfirst %>) as <%= class_name %>;
90
+ }
91
91
 
92
- private function on<%= class_name %>Destroy(<%= class_name.downcase_first_letter %>:<%= class_name %>):void {
93
- on<%= class_name %>Create(<%= class_name.downcase_first_letter %>);
94
- }
92
+ private function on<%= class_name %>Destroy(<%= class_name.dcfirst %>:<%= class_name %>):void {
93
+ on<%= class_name %>Create(<%= class_name.dcfirst %>);
94
+ }
95
95
 
96
- private function canDelete<%= class_name %>(<%= class_name.downcase_first_letter %>:<%= class_name %>):Boolean {
97
- return <%= class_name.downcase_first_letter %> != null && <%= class_name.downcase_first_letter %>.id != 0;
98
- }
99
- ]]></mx:Script>
100
- <mx:Panel id="<%= class_name.downcase_first_letter.pluralize %>Panel"
96
+ private function canDelete<%= class_name %>(<%= class_name.dcfirst %>:<%= class_name %>):Boolean {
97
+ return <%= class_name.dcfirst %> != null && !RubossUtils.isEmpty(<%= class_name.dcfirst %>.id);
98
+ }
99
+ ]]></mx:Script>
100
+ <mx:Panel id="<%= class_name.dcfirst.pluralize %>Panel"
101
101
  title="<%= class_name.pluralize %>" cornerRadius="0" dropShadowEnabled="false" borderStyle="solid"
102
102
  borderThickness="1" backgroundColor="#EEEEEE" width="25%" height="100%">
103
- <mx:List id="<%= class_name.downcase_first_letter.pluralize %>List"
103
+ <mx:List id="<%= class_name.dcfirst.pluralize %>List"
104
104
  width="100%" height="100%"
105
105
  dataProvider="{Ruboss.models.index(<%= class_name %>)}"
106
106
  change="on<%= class_name %>Select()"/>
@@ -113,19 +113,19 @@
113
113
  borderThickness="1" backgroundColor="#EEEEEE" width="75%" height="100%">
114
114
  <mx:Form width="100%" height="100%">
115
115
  <% for attribute in attributes -%>
116
- <mx:FormItem label="<%= attribute.flex_name.capitalize_without_downcasing %>" width="100%">
116
+ <mx:FormItem label="<%= attribute.flex_name.ucfirst %>" width="100%">
117
117
  <% if attribute.type == :boolean -%>
118
- <mx:CheckBox id="<%= attribute.flex_name %>CheckBox" selected="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
118
+ <mx:CheckBox id="<%= attribute.flex_name %>CheckBox" selected="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
119
119
  <% elsif attribute.type == :string -%>
120
- <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
120
+ <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
121
121
  <% elsif attribute.type == :text -%>
122
- <mx:TextArea id="<%= attribute.flex_name %>TextArea" width="100%" height="200" text="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
122
+ <mx:TextArea id="<%= attribute.flex_name %>TextArea" width="100%" height="200" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
123
123
  <% elsif attribute.type == :datetime || attribute.type == :time -%>
124
- <rcomponents:DateTimeTextInput id="<%= attribute.flex_name %>DateTimeTextInput" width="200" date="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
124
+ <rcomponents:DateTimeTextInput id="<%= attribute.flex_name %>DateTimeTextInput" width="200" date="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
125
125
  <% elsif attribute.type == :date -%>
126
- <mx:DateField id="<%= attribute.flex_name %>DateField" selectedDate="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
126
+ <mx:DateField id="<%= attribute.flex_name %>DateField" selectedDate="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
127
127
  <% else -%>
128
- <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.downcase_first_letter %>.<%= attribute.flex_name %>}"/>
128
+ <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
129
129
  <% end -%>
130
130
  </mx:FormItem>
131
131
  <% end -%>
@@ -134,7 +134,7 @@
134
134
  <mx:ComboBox id="<%= model.camelcase(:lower) %>ComboBox" width="200"
135
135
  labelField="{<%= model.camelcase %>.LABEL}"
136
136
  dataProvider="{Ruboss.models.index(<%= model.camelcase %>)}" prompt="<%= model.camelcase %> ..."
137
- selectedItem="{_<%= class_name.downcase_first_letter %>.<%= model.camelcase(:lower) %>}" />
137
+ selectedItem="{_<%= class_name.dcfirst %>.<%= model.camelcase(:lower) %>}" />
138
138
  </mx:FormItem>
139
139
  <% end -%>
140
140
  </mx:Form>
@@ -142,7 +142,7 @@
142
142
  <mx:Button label="Save <%= class_name %>" width="50%" height="30"
143
143
  click="save<%= class_name %>()"/>
144
144
  <mx:Button label="Delete <%= class_name %>" width="50%" height="30"
145
- enabled="{canDelete<%= class_name %>(_<%= class_name.downcase_first_letter %>)}"
145
+ enabled="{canDelete<%= class_name %>(_<%= class_name.dcfirst %>)}"
146
146
  click="destroy<%= class_name %>()"/>
147
147
  </mx:ControlBar>
148
148
  </mx:Panel>
@@ -1,6 +1,6 @@
1
1
  package <%= base_package %>.models {
2
2
  <% if has_manies.length > 0 -%>
3
- import org.ruboss.models.ModelsCollection;
3
+ import org.ruboss.collections.ModelsCollection;
4
4
  <% end -%>
5
5
  import org.ruboss.models.RubossModel;
6
6
 
@@ -17,7 +17,7 @@ package <%= base_package %>.models {
17
17
  <% if attribute.type == :datetime || attribute.type == :time -%>
18
18
  [DateTime]
19
19
  <% end -%>
20
- public var <%= attribute.flex_name %>:<%= attribute.flex_type %>;
20
+ public var <%= attribute.flex_name %>:<%= attribute.flex_type %> = <%= attribute.flex_default %>;
21
21
 
22
22
  <% end -%>
23
23
  <% for model in belongs_tos -%>
@@ -11,4 +11,41 @@ Description:
11
11
  editing.
12
12
 
13
13
  Examples:
14
- `./script/generate ruboss_yaml_scaffold`
14
+ `./script/generate ruboss_yaml_scaffold`
15
+
16
+ Sample Model File:
17
+ project:
18
+ - name: string
19
+ - notes: text
20
+ - start_date: date
21
+ - end_date: date
22
+ - completed: boolean
23
+ - belongs_to: [user]
24
+ - has_many: [tasks]
25
+
26
+ location:
27
+ - name: string
28
+ - notes: text
29
+ - belongs_to: [user]
30
+ - has_many: [tasks]
31
+
32
+ task:
33
+ - name: string
34
+ - notes: text
35
+ - start_time: datetime
36
+ - end_time: datetime
37
+ - completed: boolean
38
+ - next_action: boolean
39
+ - belongs_to: [project, location, user]
40
+
41
+ note:
42
+ - content: text
43
+ - belongs_to: [user]
44
+
45
+ user:
46
+ - login: string
47
+ - first_name: string
48
+ - last_name: string
49
+ - email: string
50
+ - has_many: [tasks, projects, locations]
51
+ - has_one: [note]
data/rcl-1.0.txt CHANGED
Binary file