dima-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 (106) hide show
  1. data/History.txt +2 -3
  2. data/Manifest.txt +46 -37
  3. data/README.rdoc +12 -10
  4. data/Rakefile +37 -0
  5. data/app_generators/ruboss_app/USAGE +13 -0
  6. data/app_generators/ruboss_app/ruboss_app_generator.rb +88 -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/default_tasks.rake +51 -0
  10. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/expressInstall.swf +0 -0
  11. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/flex.properties +0 -0
  12. data/app_generators/ruboss_app/templates/generate.rb +21 -0
  13. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/AC_OETags.js +0 -0
  14. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.css +0 -0
  15. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.js +0 -0
  16. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/historyFrame.html +0 -0
  17. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/index.template.html +0 -0
  18. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/playerProductInstall.swf +0 -0
  19. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/index.html.erb +2 -2
  20. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/mainair-app.xml +3 -3
  21. data/app_generators/ruboss_app/templates/mainapp-config.xml +21 -0
  22. data/{merb_generators/templates/ruboss_flex_app → app_generators/ruboss_app/templates}/mainapp.mxml +6 -9
  23. data/app_generators/ruboss_app/templates/project-textmate.erb +52 -0
  24. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/project.properties +0 -0
  25. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/projectair.properties +0 -0
  26. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/swfobject.js +0 -0
  27. data/bin/ruboss-gen +17 -0
  28. data/generators/ruboss_config/USAGE +5 -0
  29. data/generators/ruboss_config/ruboss_config_generator.rb +24 -0
  30. data/generators/ruboss_controller/USAGE +10 -0
  31. data/generators/ruboss_controller/ruboss_controller_generator.rb +34 -0
  32. data/{merb_generators/templates/ruboss_controller → generators/ruboss_controller/templates}/controller.as.erb +0 -4
  33. data/generators/ruboss_main_app/USAGE +8 -0
  34. data/generators/ruboss_main_app/ruboss_main_app_generator.rb +46 -0
  35. data/generators/ruboss_main_app/templates/mainapp.mxml +31 -0
  36. data/generators/ruboss_scaffold/USAGE +29 -0
  37. data/generators/ruboss_scaffold/ruboss_scaffold_generator.rb +117 -0
  38. data/generators/ruboss_scaffold/templates/component.mxml.erb +149 -0
  39. data/generators/ruboss_scaffold/templates/model.as.erb +42 -0
  40. data/generators/ruboss_yaml_scaffold/USAGE +7 -0
  41. data/generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +43 -0
  42. data/lib/ruboss4ruby/active_foo.rb +0 -64
  43. data/lib/ruboss4ruby/active_record_default_methods.rb +54 -0
  44. data/lib/ruboss4ruby/configuration.rb +13 -28
  45. data/lib/ruboss4ruby/datamapper_foo.rb +1 -1
  46. data/lib/ruboss4ruby/rails/recipes.rb +58 -0
  47. data/lib/ruboss4ruby/rails/swf_helper.rb +59 -0
  48. data/lib/ruboss4ruby/tasks.rb +1 -1
  49. data/lib/ruboss4ruby.rb +35 -15
  50. data/rails_generators/ruboss_config/ruboss_config_generator.rb +2 -2
  51. data/rails_generators/ruboss_config/templates/mainair-app.xml +2 -2
  52. data/rails_generators/ruboss_controller/USAGE +1 -2
  53. data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +1 -1
  54. data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +1 -1
  55. data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +69 -69
  56. data/rails_generators/ruboss_scaffold/templates/model.as.erb +1 -1
  57. data/ruboss4ruby.gemspec +43 -0
  58. data/spec/ruboss4ruby_spec.rb +7 -0
  59. data/spec/spec_helper.rb +16 -0
  60. data/test/rails/controllers/application.rb +15 -0
  61. data/test/rails/controllers/locations_controller.rb +93 -0
  62. data/test/rails/controllers/notes_controller.rb +96 -0
  63. data/test/rails/controllers/projects_controller.rb +93 -0
  64. data/test/rails/controllers/tasks_controller.rb +93 -0
  65. data/test/rails/controllers/users_controller.rb +93 -0
  66. data/test/rails/database.yml +4 -0
  67. data/test/rails/fixtures/locations.yml +8 -0
  68. data/test/rails/fixtures/notes.yml +17 -0
  69. data/test/rails/fixtures/projects.yml +25 -0
  70. data/test/rails/fixtures/simple_properties.yml +19 -0
  71. data/test/rails/fixtures/tasks.yml +46 -0
  72. data/test/rails/fixtures/users.yml +13 -0
  73. data/test/rails/helpers/functional_test_helper.rb +21 -0
  74. data/test/rails/helpers/test_helper.rb +61 -0
  75. data/test/rails/helpers/unit_test_helper.rb +30 -0
  76. data/test/rails/model.yml +35 -0
  77. data/test/rails/models/location.rb +4 -0
  78. data/test/rails/models/note.rb +3 -0
  79. data/test/rails/models/project.rb +4 -0
  80. data/test/rails/models/simple_property.rb +2 -0
  81. data/test/rails/models/task.rb +20 -0
  82. data/test/rails/models/user.rb +22 -0
  83. data/test/rails/playing_around_in_a_console.txt +71 -0
  84. data/test/rails/schema.rb +77 -0
  85. data/test/rails/test.swf +1 -0
  86. data/test/rails/test_active_foo.rb +81 -0
  87. data/test/rails/test_ruboss_rails_integration_functional.rb +22 -0
  88. data/test/rails/test_to_fxml.rb +77 -0
  89. data/test/rails/test_to_json.rb +23 -0
  90. data/test/rails/views/notes/empty_params_action.html.erb +1 -0
  91. data/test/rails/views/notes/index.html.erb +1 -0
  92. metadata +121 -92
  93. data/Generators +0 -7
  94. data/lib/ruboss4ruby/generated_attribute.rb +0 -61
  95. data/merb_generators/ruboss_config.rb +0 -103
  96. data/merb_generators/ruboss_controller.rb +0 -59
  97. data/merb_generators/ruboss_flex_app.rb +0 -67
  98. data/merb_generators/ruboss_resource.rb +0 -37
  99. data/merb_generators/ruboss_resource_controller.rb +0 -80
  100. data/merb_generators/ruboss_scaffold.rb +0 -157
  101. data/merb_generators/templates/ruboss_config/ruboss.yml +0 -16
  102. data/merb_generators/templates/ruboss_resource_controller/controller_ar.rb.erb +0 -49
  103. data/merb_generators/templates/ruboss_resource_controller/controller_dm.rb.erb +0 -46
  104. data/merb_generators/templates/ruboss_resource_controller/spec/controllers/%file_name%_spec.rb +0 -7
  105. data/merb_generators/templates/ruboss_resource_controller/spec/requests/%file_name%_spec.rb +0 -1
  106. data/merb_generators/templates/ruboss_resource_controller/test/controllers/%file_name%_test.rb +0 -17
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dima-ruboss4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Berastau
@@ -9,87 +9,101 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-26 00:00:00 -08:00
13
- default_executable:
12
+ date: 2008-12-26 00:00:00 -08:00
13
+ default_executable: ruboss-gen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: newgem
16
+ name: rubigen
17
17
  version_requirement:
18
18
  version_requirements: !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.1.0
22
+ version: 1.4.0
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
- name: hoe
25
+ name: activesupport
26
26
  version_requirement:
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 1.8.0
31
+ version: 2.2.2
32
32
  version:
33
- description: Ruboss Framework Rails 2.1+ and Merb 0.9.8+ Integration Support
34
- email:
35
- - dima@ruboss.com
36
- executables: []
37
-
33
+ - !ruby/object:Gem::Dependency
34
+ name: bones
35
+ version_requirement:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.1.1
41
+ version:
42
+ description: Ruboss Framework Code Generation Engine / Rails 2.1+ and Merb 1.0 Integration Support
43
+ email: dima@ruboss.com
44
+ executables:
45
+ - ruboss-gen
38
46
  extensions: []
39
47
 
40
48
  extra_rdoc_files:
41
49
  - History.txt
42
- - Manifest.txt
43
50
  - README.rdoc
51
+ - bin/ruboss-gen
44
52
  - gpl-3.0.txt
45
53
  - rcl-1.0.txt
46
- - test/playing_around_in_a_console.txt
54
+ - test/rails/playing_around_in_a_console.txt
47
55
  files:
48
- - Generators
49
56
  - History.txt
50
57
  - Manifest.txt
51
58
  - README.rdoc
59
+ - Rakefile
60
+ - app_generators/ruboss_app/USAGE
61
+ - app_generators/ruboss_app/ruboss_app_generator.rb
62
+ - app_generators/ruboss_app/templates/actionscript.properties
63
+ - app_generators/ruboss_app/templates/actionscriptair.properties
64
+ - app_generators/ruboss_app/templates/default_tasks.rake
65
+ - app_generators/ruboss_app/templates/expressInstall.swf
66
+ - app_generators/ruboss_app/templates/flex.properties
67
+ - app_generators/ruboss_app/templates/generate.rb
68
+ - app_generators/ruboss_app/templates/html-template/AC_OETags.js
69
+ - app_generators/ruboss_app/templates/html-template/history/history.css
70
+ - app_generators/ruboss_app/templates/html-template/history/history.js
71
+ - app_generators/ruboss_app/templates/html-template/history/historyFrame.html
72
+ - app_generators/ruboss_app/templates/html-template/index.template.html
73
+ - app_generators/ruboss_app/templates/html-template/playerProductInstall.swf
74
+ - app_generators/ruboss_app/templates/index.html.erb
75
+ - app_generators/ruboss_app/templates/mainair-app.xml
76
+ - app_generators/ruboss_app/templates/mainapp-config.xml
77
+ - app_generators/ruboss_app/templates/mainapp.mxml
78
+ - app_generators/ruboss_app/templates/project-textmate.erb
79
+ - app_generators/ruboss_app/templates/project.properties
80
+ - app_generators/ruboss_app/templates/projectair.properties
81
+ - app_generators/ruboss_app/templates/swfobject.js
82
+ - bin/ruboss-gen
83
+ - generators/ruboss_config/USAGE
84
+ - generators/ruboss_config/ruboss_config_generator.rb
85
+ - generators/ruboss_controller/USAGE
86
+ - generators/ruboss_controller/ruboss_controller_generator.rb
87
+ - generators/ruboss_controller/templates/controller.as.erb
88
+ - generators/ruboss_main_app/USAGE
89
+ - generators/ruboss_main_app/ruboss_main_app_generator.rb
90
+ - generators/ruboss_main_app/templates/mainapp.mxml
91
+ - generators/ruboss_scaffold/USAGE
92
+ - generators/ruboss_scaffold/ruboss_scaffold_generator.rb
93
+ - generators/ruboss_scaffold/templates/component.mxml.erb
94
+ - generators/ruboss_scaffold/templates/model.as.erb
95
+ - generators/ruboss_yaml_scaffold/USAGE
96
+ - generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb
52
97
  - gpl-3.0.txt
53
98
  - lib/ruboss4ruby.rb
54
99
  - lib/ruboss4ruby/active_foo.rb
100
+ - lib/ruboss4ruby/active_record_default_methods.rb
55
101
  - lib/ruboss4ruby/active_record_tasks.rb
56
102
  - lib/ruboss4ruby/configuration.rb
57
103
  - lib/ruboss4ruby/datamapper_foo.rb
58
- - lib/ruboss4ruby/generated_attribute.rb
59
- - lib/ruboss4ruby/recipes.rb
60
- - lib/ruboss4ruby/ruboss_helper.rb
61
- - lib/ruboss4ruby/ruboss_test_helpers.rb
104
+ - lib/ruboss4ruby/rails/recipes.rb
105
+ - lib/ruboss4ruby/rails/swf_helper.rb
62
106
  - lib/ruboss4ruby/tasks.rb
63
- - lib/ruboss4ruby/version.rb
64
- - merb_generators/ruboss_config.rb
65
- - merb_generators/ruboss_controller.rb
66
- - merb_generators/ruboss_flex_app.rb
67
- - merb_generators/ruboss_resource.rb
68
- - merb_generators/ruboss_resource_controller.rb
69
- - merb_generators/ruboss_scaffold.rb
70
- - merb_generators/templates/ruboss_config/actionscript.properties
71
- - merb_generators/templates/ruboss_config/actionscriptair.properties
72
- - merb_generators/templates/ruboss_config/expressInstall.swf
73
- - merb_generators/templates/ruboss_config/flex.properties
74
- - merb_generators/templates/ruboss_config/html-template/AC_OETags.js
75
- - merb_generators/templates/ruboss_config/html-template/history/history.css
76
- - merb_generators/templates/ruboss_config/html-template/history/history.js
77
- - merb_generators/templates/ruboss_config/html-template/history/historyFrame.html
78
- - merb_generators/templates/ruboss_config/html-template/index.template.html
79
- - merb_generators/templates/ruboss_config/html-template/playerProductInstall.swf
80
- - merb_generators/templates/ruboss_config/index.html.erb
81
- - merb_generators/templates/ruboss_config/mainair-app.xml
82
- - merb_generators/templates/ruboss_config/project.properties
83
- - merb_generators/templates/ruboss_config/projectair.properties
84
- - merb_generators/templates/ruboss_config/ruboss.yml
85
- - merb_generators/templates/ruboss_config/swfobject.js
86
- - merb_generators/templates/ruboss_controller/controller.as.erb
87
- - merb_generators/templates/ruboss_flex_app/mainapp.mxml
88
- - merb_generators/templates/ruboss_resource_controller/controller_ar.rb.erb
89
- - merb_generators/templates/ruboss_resource_controller/controller_dm.rb.erb
90
- - merb_generators/templates/ruboss_resource_controller/spec/controllers/%file_name%_spec.rb
91
- - merb_generators/templates/ruboss_resource_controller/spec/requests/%file_name%_spec.rb
92
- - merb_generators/templates/ruboss_resource_controller/test/controllers/%file_name%_test.rb
93
107
  - rails_generators/ruboss_config/USAGE
94
108
  - rails_generators/ruboss_config/ruboss_config_generator.rb
95
109
  - rails_generators/ruboss_config/templates/actionscript.properties
@@ -126,43 +140,59 @@ files:
126
140
  - rails_generators/ruboss_yaml_scaffold/USAGE
127
141
  - rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb
128
142
  - rcl-1.0.txt
129
- - test/controllers/application.rb
130
- - test/controllers/locations_controller.rb
131
- - test/controllers/notes_controller.rb
132
- - test/controllers/projects_controller.rb
133
- - test/controllers/tasks_controller.rb
134
- - test/controllers/users_controller.rb
135
- - test/database.yml
136
- - test/fixtures/locations.yml
137
- - test/fixtures/notes.yml
138
- - test/fixtures/projects.yml
139
- - test/fixtures/tasks.yml
140
- - test/fixtures/users.yml
141
- - test/helpers/controllers.log
142
- - test/helpers/functional_test_helper.rb
143
- - test/helpers/models.log
144
- - test/helpers/test_helper.rb
145
- - test/helpers/unit_test_helper.rb
146
- - test/model.yml
147
- - test/models/location.rb
148
- - test/models/note.rb
149
- - test/models/project.rb
150
- - test/models/task.rb
151
- - test/models/user.rb
152
- - test/playing_around_in_a_console.txt
153
- - test/schema.rb
154
- - test/test.sqlite3
155
- - test/test.swf
156
- - test/test_active_foo.rb
157
- - test/test_helper.rb
158
- - test/test_ruboss4ruby.rb
159
- - test/test_ruboss_rails_integration_functional.rb
160
- - test/test_swfobject_helper.rb
161
- - test/to_fxml_test.rb
162
- - test/views/notes/empty_params_action.html.erb
163
- - test/views/notes/index.html.erb
143
+ - ruboss4ruby.gemspec
144
+ - spec/ruboss4ruby_spec.rb
145
+ - spec/spec_helper.rb
146
+ - tasks/ann.rake
147
+ - tasks/bones.rake
148
+ - tasks/gem.rake
149
+ - tasks/git.rake
150
+ - tasks/manifest.rake
151
+ - tasks/notes.rake
152
+ - tasks/post_load.rake
153
+ - tasks/rdoc.rake
154
+ - tasks/rubyforge.rake
155
+ - tasks/setup.rb
156
+ - tasks/spec.rake
157
+ - tasks/svn.rake
158
+ - tasks/test.rake
159
+ - test/rails/controllers/application.rb
160
+ - test/rails/controllers/locations_controller.rb
161
+ - test/rails/controllers/notes_controller.rb
162
+ - test/rails/controllers/projects_controller.rb
163
+ - test/rails/controllers/tasks_controller.rb
164
+ - test/rails/controllers/users_controller.rb
165
+ - test/rails/database.yml
166
+ - test/rails/fixtures/locations.yml
167
+ - test/rails/fixtures/notes.yml
168
+ - test/rails/fixtures/projects.yml
169
+ - test/rails/fixtures/simple_properties.yml
170
+ - test/rails/fixtures/tasks.yml
171
+ - test/rails/fixtures/users.yml
172
+ - test/rails/helpers/controllers.log
173
+ - test/rails/helpers/functional_test_helper.rb
174
+ - test/rails/helpers/models.log
175
+ - test/rails/helpers/test_helper.rb
176
+ - test/rails/helpers/unit_test_helper.rb
177
+ - test/rails/model.yml
178
+ - test/rails/models/location.rb
179
+ - test/rails/models/note.rb
180
+ - test/rails/models/project.rb
181
+ - test/rails/models/simple_property.rb
182
+ - test/rails/models/task.rb
183
+ - test/rails/models/user.rb
184
+ - test/rails/playing_around_in_a_console.txt
185
+ - test/rails/schema.rb
186
+ - test/rails/test.sqlite3
187
+ - test/rails/test.swf
188
+ - test/rails/test_active_foo.rb
189
+ - test/rails/test_ruboss_rails_integration_functional.rb
190
+ - test/rails/test_to_fxml.rb
191
+ - test/rails/test_to_json.rb
192
+ - test/rails/views/notes/empty_params_action.html.erb
193
+ - test/rails/views/notes/index.html.erb
164
194
  has_rdoc: true
165
- homepage: http://www.ruboss.com/framework
195
+ homepage: http://github.com/dima/ruboss4ruby/wikis
166
196
  post_install_message:
167
197
  rdoc_options:
168
198
  - --main
@@ -187,11 +217,10 @@ rubyforge_project: ruboss4ruby
187
217
  rubygems_version: 1.2.0
188
218
  signing_key:
189
219
  specification_version: 2
190
- summary: Ruboss Framework Rails 2.1+ and Merb 0.9.8+ Integration Support
220
+ summary: Ruboss Framework Code Generation Engine / Rails 2.1+ and Merb 1.0 Integration Support
191
221
  test_files:
192
- - test/helpers/test_helper.rb
193
- - test/test_active_foo.rb
194
- - test/test_helper.rb
195
- - test/test_ruboss4ruby.rb
196
- - test/test_ruboss_rails_integration_functional.rb
197
- - test/test_swfobject_helper.rb
222
+ - test/rails/helpers/test_helper.rb
223
+ - test/rails/test_active_foo.rb
224
+ - test/rails/test_ruboss_rails_integration_functional.rb
225
+ - test/rails/test_to_fxml.rb
226
+ - test/rails/test_to_json.rb
data/Generators DELETED
@@ -1,7 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'lib', 'ruboss4ruby', 'configuration.rb')
2
-
3
- scope 'merb-gen' do
4
- dir = File.join(File.dirname(__FILE__), 'merb_generators/')
5
- Merb.add_generators dir + 'ruboss_config', dir + 'ruboss_flex_app', dir + 'ruboss_controller',
6
- dir + 'ruboss_resource_controller', dir + 'ruboss_resource'
7
- end
@@ -1,61 +0,0 @@
1
- module Ruboss
2
- module Generator
3
- class GeneratedAttribute
4
- attr_accessor :name, :type, :flex_name
5
-
6
- def initialize(name, type)
7
- @name, @type = name, type.to_sym
8
- @flex_name = name.camelcase(:lower)
9
- end
10
-
11
- def field_type
12
- @field_type ||= case type
13
- when :integer, :float, :decimal then :text_field
14
- when :datetime, :timestamp, :time then :datetime_select
15
- when :date then :date_select
16
- when :string then :text_field
17
- when :text then :text_area
18
- when :boolean then :check_box
19
- else
20
- :text_field
21
- end
22
- end
23
-
24
- def default(prefix = '')
25
- @default = case type
26
- when :integer then 1
27
- when :float then 1.5
28
- when :decimal then "9.99"
29
- when :datetime, :timestamp, :time then Time.now.to_s(:db)
30
- when :date then Date.today.to_s(:db)
31
- when :string then prefix + name.camelize + "String"
32
- when :text then prefix + name.camelize + "Text"
33
- when :boolean then false
34
- else
35
- ""
36
- end
37
- end
38
-
39
- def flex_type
40
- @flex_type = case type
41
- when :integer then 'int'
42
- when :date, :datetime, :time then 'Date'
43
- when :boolean then 'Boolean'
44
- when :float, :decimal then 'Number'
45
- else
46
- 'String'
47
- end
48
- end
49
-
50
- def flex_default(prefix = '')
51
- @flex_default = case type
52
- when :integer, :float, :decimal then '0'
53
- when :string, :text then '""'
54
- when :boolean then 'false'
55
- else
56
- 'null'
57
- end
58
- end
59
- end
60
- end
61
- end
@@ -1,103 +0,0 @@
1
- require 'open-uri'
2
- require 'fileutils'
3
-
4
- module Merb::Generators
5
- class RubossConfigGenerator < Generator
6
- include Ruboss::Configuration
7
-
8
- option :air, :as => :boolean, :default => false, :desc => 'Configure AIR project instead of Flex. Flex is default.'
9
- option :skip_framework, :as => :boolean, :default => false, :desc => "Don't fetch the latest framework binary. You'll have to link/build the framework yourself."
10
-
11
- def initialize(*args)
12
- super
13
- @project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
14
-
15
- framework_release = Ruboss::RUBOSS_FRAMEWORK_VERSION
16
- framework_distribution_url = "http://ruboss.com/releases/ruboss-#{framework_release}.swc"
17
- framework_destination_file = "lib/ruboss-#{framework_release}.swc"
18
-
19
- if !get_option(:skip_framework) && !File.exist?(framework_destination_file)
20
- FileUtils.mkdir('lib') unless File.directory?('lib')
21
- puts "fetching #{framework_release} framework binary from: #{framework_distribution_url} ..."
22
- open(framework_destination_file, "wb").write(open(framework_distribution_url).read)
23
- puts "done. saved to #{framework_destination_file}"
24
- end
25
- end
26
-
27
- def extract_config(config_file)
28
- if get_option(:air)
29
- config_file << 'air'
30
- end
31
- config_file
32
- end
33
-
34
- def project_name
35
- @project_name
36
- end
37
-
38
- def flex_project_name
39
- @flex_project_name
40
- end
41
-
42
- def base_folder
43
- @base_folder
44
- end
45
-
46
- def self.source_root
47
- File.join(File.dirname(__FILE__), 'templates', 'ruboss_config')
48
- end
49
-
50
- empty_directory :bin, File.join('public', 'bin')
51
- empty_directory :javascripts, File.join('public', 'javascripts')
52
- empty_directory :schema, 'schema'
53
-
54
- file :flex_properties, 'flex.properties', '.flexProperties'
55
-
56
- template :actionscript_properties do |t|
57
- t.source = "#{extract_config('actionscript')}.properties"
58
- t.destination = '.actionScriptProperties'
59
- end
60
-
61
- template :project_properties do |t|
62
- t.source = "#{extract_config('project')}.properties"
63
- t.destination = '.project'
64
- end
65
-
66
- %w(components controllers commands models events).each do |dir|
67
- empty_directory dir.to_sym do |t|
68
- t.destination = File.join('app', 'flex', base_folder, dir)
69
- end
70
- end
71
-
72
- empty_directory :generated do |t|
73
- t.destination = File.join('app', 'flex', base_folder, 'components', 'generated')
74
- end
75
-
76
- glob!('html-template')
77
-
78
- file :swfoject, 'swfobject.js', File.join('public', 'javascripts', 'swfobject.js')
79
-
80
- file :express_install, 'expressInstall.swf', File.join('public', 'expressInstall.swf')
81
-
82
- file :ruboss_yml, 'ruboss.yml', File.join('config', 'ruboss.yml')
83
-
84
- template :index, 'index.html.erb', File.join('app', 'views', 'layout', 'application.html.erb')
85
-
86
- invoke :ruboss_flex_app
87
-
88
- template :air_descriptor, :air => true do |t|
89
- t.source = 'mainair-app.xml'
90
- t.destination = File.join('app', 'flex', "#{project_name}-app.xml")
91
- end
92
-
93
- desc <<-DESC
94
- Generates the primary Ruboss directory structure.
95
- Sets up Flex Builder specific descriptor files and options fetches
96
- the latest published Ruboss Framework SWC file.
97
- DESC
98
-
99
- invoke :ruboss_controller
100
- end
101
-
102
- add :ruboss_config, RubossConfigGenerator
103
- end
@@ -1,59 +0,0 @@
1
- module Merb::Generators
2
- class RubossControllerGenerator < Generator
3
- include Ruboss::Configuration
4
-
5
- def initialize(*args)
6
- super
7
- @project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
8
- end
9
-
10
- def project_name
11
- @project_name
12
- end
13
-
14
- def flex_project_name
15
- @flex_project_name
16
- end
17
-
18
- def base_folder
19
- @base_folder
20
- end
21
-
22
- def base_package
23
- @base_package
24
- end
25
-
26
- def command_controller_name
27
- @command_controller_name
28
- end
29
-
30
- def model_names
31
- list_as_files("app/flex/#{base_folder}/models")
32
- end
33
-
34
- def command_names
35
- list_as_files("app/flex/#{base_folder}/commands")
36
- end
37
-
38
- def self.source_root
39
- File.join(File.dirname(__FILE__), 'templates', 'ruboss_controller')
40
- end
41
-
42
- template :controller do |t|
43
- t.source = 'controller.as.erb'
44
- t.destination = File.join('app', 'flex', base_folder, 'controllers', "#{command_controller_name}.as")
45
- end
46
-
47
- desc <<-DESC
48
- Generates the main Ruboss Flex application controller.
49
- Typically app/flex/<yourappname>/controllers/ApplicationController.as,
50
- e.g. app/flex/pomodo/controllers/ApplicationController.as
51
-
52
- It pulls out all available models and commands from respective
53
- folders and makes sure they'll be pulled into the Flex application
54
- at runtime.
55
- DESC
56
- end
57
-
58
- add :ruboss_controller, RubossControllerGenerator
59
- end
@@ -1,67 +0,0 @@
1
- require 'open-uri'
2
- require 'fileutils'
3
-
4
- module Merb::Generators
5
- class RubossFlexAppGenerator < Generator
6
- include Ruboss::Configuration
7
-
8
- option :air, :as => :boolean, :default => false, :desc => 'Configure AIR project instead of Flex. Flex is default.'
9
-
10
- def initialize(*args)
11
- super
12
- @project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
13
-
14
- @component_names = []
15
- if File.exists?("app/flex/#{base_folder}/components/generated")
16
- @component_names = list_mxml_files("app/flex/#{base_folder}/components/generated")
17
- end
18
- end
19
-
20
- def project_name
21
- @project_name
22
- end
23
-
24
- def flex_project_name
25
- @flex_project_name
26
- end
27
-
28
- def base_folder
29
- @base_folder
30
- end
31
-
32
- def base_package
33
- @base_package
34
- end
35
-
36
- def command_controller_name
37
- @command_controller_name
38
- end
39
-
40
- def component_names
41
- @component_names
42
- end
43
-
44
- def application_tag
45
- if get_option(:air)
46
- 'WindowedApplication'
47
- else
48
- 'Application'
49
- end
50
- end
51
-
52
- def self.source_root
53
- File.join(File.dirname(__FILE__), 'templates', 'ruboss_flex_app')
54
- end
55
-
56
- desc <<-DESC
57
- Generates main flex application file.
58
- DESC
59
-
60
- template :main_app do |t|
61
- t.source = 'mainapp.mxml'
62
- t.destination = File.join('app', 'flex', "#{project_name}.mxml")
63
- end
64
- end
65
-
66
- add :ruboss_flex_app, RubossFlexAppGenerator
67
- end
@@ -1,37 +0,0 @@
1
- module Merb::Generators
2
-
3
- class RubossResourceGenerator < Generator
4
-
5
- desc <<-DESC
6
- Generates a new ruboss resource.
7
- DESC
8
-
9
- first_argument :name, :required => true, :desc => "resource name (singular)"
10
- second_argument :attributes, :as => :hash, :default => {}, :desc => "space separated resource model properties in form of name:type. Example: state:string"
11
-
12
- option :testing_framework, :desc => 'Testing framework to use (one of: rspec, test_unit)'
13
- option :orm, :desc => 'Object-Relation Mapper to use (one of: none, activerecord, datamapper, sequel)'
14
-
15
- invoke :model do |generator|
16
- generator.new(destination_root, options, model_name, attributes)
17
- end
18
-
19
- invoke :ruboss_resource_controller do |generator|
20
- generator.new(destination_root, options, controller_name, attributes)
21
- end
22
-
23
- def controller_name
24
- name.pluralize
25
- end
26
-
27
- def model_name
28
- name
29
- end
30
-
31
- def after_generation
32
- STDOUT << message("Don't forget to set your resource route in config/router.rb for instance: resources :#{model_name.downcase}s ")
33
- end
34
- end
35
-
36
- add :ruboss_resource, RubossResourceGenerator
37
- end