restfulx 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. data/README.rdoc +1 -1
  2. data/Rakefile +3 -1
  3. data/VERSION.yml +1 -1
  4. data/app_generators/rx_app/rx_app_generator.rb +2 -2
  5. data/app_generators/rx_app/templates/actionscript.properties +1 -1
  6. data/app_generators/rx_app/templates/actionscriptair.properties +1 -1
  7. data/app_generators/rx_app/templates/mainapp-config.xml +1 -0
  8. data/app_generators/rx_app/templates/mainapp.mxml +1 -1
  9. data/app_generators/rx_app/templates/restfulx.yml +26 -5
  10. data/lib/restfulx.rb +1 -1
  11. data/lib/restfulx/active_foo.rb +5 -2
  12. data/lib/restfulx/active_record_uuid_helper.rb +1 -1
  13. data/lib/restfulx/configuration.rb +15 -4
  14. data/lib/restfulx/rails/schema_to_yaml.rb +0 -11
  15. data/lib/restfulx/rails/schema_to_yaml/settings/core.rb +4 -1
  16. data/lib/restfulx/rails/swf_helper.rb +7 -3
  17. data/lib/restfulx/tasks.rb +0 -1
  18. data/rails_generators/rx_config/rx_config_generator.rb +16 -7
  19. data/rails_generators/rx_config/templates/actionscript.properties +1 -1
  20. data/rails_generators/rx_config/templates/actionscriptair.properties +1 -1
  21. data/rails_generators/rx_config/templates/mainapp-config.xml +1 -0
  22. data/rails_generators/rx_config/templates/restfulx.erb +45 -8
  23. data/rails_generators/rx_config/templates/restfulx.yml +4 -4
  24. data/rails_generators/rx_config/templates/session_store_flash.erb +1 -0
  25. data/rails_generators/rx_main_app/rx_main_app_generator.rb +2 -2
  26. data/rails_generators/rx_main_app/templates/mainapp.mxml +1 -1
  27. data/rails_generators/rx_scaffold/rx_scaffold_generator.rb +15 -6
  28. data/rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb +2 -2
  29. data/rails_generators/rx_scaffold/templates/functional_test.rb +45 -0
  30. data/rails_generators/rx_scaffold/templates/helper_test.rb +4 -0
  31. data/rails_generators/rx_scaffold/templates/layouts/default.erb +7 -5
  32. data/rails_generators/rx_scaffold/templates/migration.rb.erb +4 -4
  33. data/rxgen_generators/rx_config/rx_config_generator.rb +2 -0
  34. data/rxgen_generators/rx_controller/templates/assist.py +1 -1
  35. data/rxgen_generators/rx_main_app/rx_main_app_generator.rb +2 -2
  36. data/rxgen_generators/rx_main_app/templates/mainapp.mxml +1 -1
  37. data/rxgen_generators/rx_scaffold/rx_scaffold_generator.rb +56 -9
  38. data/rxgen_generators/rx_scaffold/templates/{component.mxml.erb → layouts/default.erb} +56 -10
  39. data/rxgen_generators/rx_scaffold/templates/model.as.erb +33 -2
  40. data/test/rails/controllers/{application.rb → application_controller.rb} +0 -0
  41. data/test/rails/helpers/functional_test_helper.rb +1 -1
  42. data/test/rails/helpers/test_helper.rb +1 -8
  43. data/test/rails/helpers/unit_test_helper.rb +2 -3
  44. data/test/rails/test_active_foo.rb +1 -1
  45. data/test/rails/test_rails_integration_functional.rb +1 -1
  46. data/test/rails/test_to_fxml.rb +1 -1
  47. data/test/rails/test_to_json.rb +1 -1
  48. metadata +59 -73
@@ -1,12 +1,19 @@
1
1
  package <%= base_package %>.models {
2
- <% if has_manies.length > 0 -%>
2
+ <% if has_manies.length > 0 || has_many_through.length > 0 -%>
3
3
  import org.restfulx.collections.ModelsCollection;
4
4
  <% end -%>
5
+ <% if tree_model.size > 0 -%>
6
+ <% @tree_or_no_tree = 'RxTreeModel' %>
7
+ import org.restfulx.models.RxTreeModel
8
+ <% end -%>
9
+ <% unless tree_model.size > 0 -%>
10
+ <% @tree_or_no_tree = 'RxModel' %>
5
11
  import org.restfulx.models.RxModel;
12
+ <% end -%>
6
13
 
7
14
  [Resource(name="<%= resource_controller_name %>")]
8
15
  [Bindable]
9
- public class <%= class_name %> extends RxModel {
16
+ public class <%= class_name %> extends <%= @tree_or_no_tree %> {
10
17
  <% if attributes && !attributes.empty? && attributes[0].flex_type != "Boolean" -%>
11
18
  public static const LABEL:String = "<%= attributes[0].flex_name %>";
12
19
  <% else -%>
@@ -24,6 +31,25 @@ package <%= base_package %>.models {
24
31
  [BelongsTo]
25
32
  public var <%= model.camelcase(:lower) %>:<%= model.camelcase %>;
26
33
 
34
+ <% end -%>
35
+ <% if tree_model.size > 0 -%>
36
+ [BelongsTo]
37
+ public var <%= tree_model[0].camelcase(:lower) %>:<%= class_name %>;
38
+
39
+ <% end -%>
40
+ <% for model in polymorphic -%>
41
+ [BelongsTo(polymorphic="true", dependsOn="Model1, Model2")]
42
+ public var <%= model.camelcase(:lower) %>:Object;
43
+
44
+ <% end -%>
45
+ <% if has_many_through.size > 0 -%>
46
+ <% has_many_through.each do |k,v| %>
47
+ [HasMany]
48
+ public var <%= k.camelcase(:lower) %>:ModelsCollection;
49
+
50
+ [HasMany(through="<%= k.camelcase %>")]
51
+ public var <%= v.camelcase(:lower) %>:ModelsCollection;
52
+ <% end -%>
27
53
  <% end -%>
28
54
  <% for model in has_ones -%>
29
55
  [HasOne]
@@ -34,6 +60,11 @@ package <%= base_package %>.models {
34
60
  [HasMany]
35
61
  public var <%= model.camelcase(:lower) %>:ModelsCollection;
36
62
 
63
+ <% end -%>
64
+ <% if attachment_field.size > 0 -%>
65
+ [Ignored]
66
+ public var attachmentUrl:String;
67
+
37
68
  <% end -%>
38
69
  public function <%= class_name %>() {
39
70
  super(LABEL);
@@ -3,7 +3,7 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
3
  schema_file = File.join(File.dirname(__FILE__), '..', 'schema.rb')
4
4
  ENV["RAILS_ENV"] = "test"
5
5
 
6
- require File.join(File.dirname(__FILE__), '..', 'controllers', 'application')
6
+ require File.join(File.dirname(__FILE__), '..', 'controllers', 'application_controller')
7
7
  require File.join(File.dirname(__FILE__), '..', 'controllers', 'notes_controller')
8
8
 
9
9
  config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))['test']
@@ -9,7 +9,6 @@ require 'active_record'
9
9
  require 'active_record/fixtures'
10
10
  require 'action_controller'
11
11
  require 'action_controller/test_case'
12
- require 'action_controller/assertions'
13
12
  require 'action_controller/test_process'
14
13
  require 'action_controller/integration'
15
14
  require 'sqlite3'
@@ -31,13 +30,7 @@ class MockResponse
31
30
 
32
31
  end
33
32
 
34
- class Test::Unit::TestCase #:nodoc:
35
- # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
36
- self.use_transactional_fixtures = true
37
-
38
- # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
39
- self.use_instantiated_fixtures = true
40
-
33
+ class ActiveRecord::TestCase #:nodoc:
41
34
  # Add more helper methods to be used by all tests here...
42
35
 
43
36
  # Use this to test xml or fxml responses in unit tests. For example,
@@ -13,7 +13,6 @@ require 'active_record'
13
13
  require 'active_record/fixtures'
14
14
  require 'action_controller'
15
15
  require 'action_controller/test_case'
16
- require 'action_controller/assertions'
17
16
  require 'action_controller/test_process'
18
17
  require 'action_controller/integration'
19
18
  require 'sqlite3'
@@ -26,5 +25,5 @@ ActiveRecord::Base.establish_connection(config)
26
25
 
27
26
  load(schema_file) if File.exist?(schema_file)
28
27
 
29
- Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
30
- $:.unshift(Test::Unit::TestCase.fixture_path)
28
+ ActiveSupport::TestCase.fixture_path.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
29
+ $:.unshift(ActiveSupport::TestCase.fixture_path.fixture_path)
@@ -2,7 +2,7 @@ RAILS_ROOT = File.dirname(__FILE__) unless defined? RAILS_ROOT
2
2
  require File.join(File.dirname(__FILE__), 'helpers', 'test_helper')
3
3
  require File.join(File.dirname(__FILE__), 'helpers', 'unit_test_helper')
4
4
 
5
- class ActiveFooTest < Test::Unit::TestCase
5
+ class ActiveFooTest < ActiveRecord::TestCase
6
6
  fixtures :all
7
7
 
8
8
  def setup
@@ -5,7 +5,7 @@ ActionController::Routing::Routes.draw do |map|
5
5
  map.connect ':controller/:action/:id'
6
6
  end
7
7
 
8
- class RailsIntegrationFunctionalTest < Test::Unit::TestCase
8
+ class RailsIntegrationFunctionalTest < ActiveRecord::TestCase
9
9
  fixtures :all
10
10
 
11
11
  def setup
@@ -8,7 +8,7 @@ require 'models/task'
8
8
  require 'models/user'
9
9
  require 'models/simple_property'
10
10
 
11
- class ToFxmlTest < Test::Unit::TestCase
11
+ class ToFxmlTest < ActiveRecord::TestCase
12
12
  fixtures :locations, :notes, :projects, :tasks, :users, :simple_properties
13
13
 
14
14
  def test_to_fxml_sanity
@@ -8,7 +8,7 @@ require 'models/task'
8
8
  require 'models/user'
9
9
  require 'models/simple_property'
10
10
 
11
- class ToJsonTest < Test::Unit::TestCase
11
+ class ToJsonTest < ActiveRecord::TestCase
12
12
  fixtures :locations, :notes, :projects, :tasks, :users, :simple_properties
13
13
 
14
14
  def test_to_json_sanity
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restfulx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Berastau
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-19 00:00:00 -07:00
12
+ date: 2009-07-16 00:00:00 -07:00
13
13
  default_executable: rx-gen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,13 +41,11 @@ extensions: []
41
41
  extra_rdoc_files:
42
42
  - README.rdoc
43
43
  files:
44
- - Rakefile
45
44
  - README.rdoc
45
+ - Rakefile
46
46
  - VERSION.yml
47
- - bin/rx-gen
48
- - app_generators/rx_app
47
+ - app_generators/rx_app/USAGE
49
48
  - app_generators/rx_app/rx_app_generator.rb
50
- - app_generators/rx_app/templates
51
49
  - app_generators/rx_app/templates/actionscript.properties
52
50
  - app_generators/rx_app/templates/actionscriptair.properties
53
51
  - app_generators/rx_app/templates/app.yaml.erb
@@ -56,9 +54,7 @@ files:
56
54
  - app_generators/rx_app/templates/expressInstall.swf
57
55
  - app_generators/rx_app/templates/flex.properties
58
56
  - app_generators/rx_app/templates/generate.rb
59
- - app_generators/rx_app/templates/html-template
60
57
  - app_generators/rx_app/templates/html-template/AC_OETags.js
61
- - app_generators/rx_app/templates/html-template/history
62
58
  - app_generators/rx_app/templates/html-template/history/history.css
63
59
  - app_generators/rx_app/templates/html-template/history/history.js
64
60
  - app_generators/rx_app/templates/html-template/history/historyFrame.html
@@ -74,18 +70,28 @@ files:
74
70
  - app_generators/rx_app/templates/projectair.properties
75
71
  - app_generators/rx_app/templates/restfulx.yml
76
72
  - app_generators/rx_app/templates/swfobject.js
77
- - app_generators/rx_app/USAGE
78
- - rails_generators/rx_config
73
+ - bin/rx-gen
74
+ - lib/restfulx.rb
75
+ - lib/restfulx/active_foo.rb
76
+ - lib/restfulx/active_record_tasks.rb
77
+ - lib/restfulx/active_record_uuid_helper.rb
78
+ - lib/restfulx/configuration.rb
79
+ - lib/restfulx/datamapper_foo.rb
80
+ - lib/restfulx/rails/recipes.rb
81
+ - lib/restfulx/rails/schema_to_yaml.rb
82
+ - lib/restfulx/rails/schema_to_yaml/extensions/enumerable.rb
83
+ - lib/restfulx/rails/schema_to_yaml/settings/config.rb
84
+ - lib/restfulx/rails/schema_to_yaml/settings/core.rb
85
+ - lib/restfulx/rails/swf_helper.rb
86
+ - lib/restfulx/tasks.rb
87
+ - rails_generators/rx_config/USAGE
79
88
  - rails_generators/rx_config/rx_config_generator.rb
80
- - rails_generators/rx_config/templates
81
89
  - rails_generators/rx_config/templates/actionscript.properties
82
90
  - rails_generators/rx_config/templates/actionscriptair.properties
83
91
  - rails_generators/rx_config/templates/expressInstall.swf
84
92
  - rails_generators/rx_config/templates/flex.properties
85
93
  - rails_generators/rx_config/templates/flex_controller.erb
86
- - rails_generators/rx_config/templates/html-template
87
94
  - rails_generators/rx_config/templates/html-template/AC_OETags.js
88
- - rails_generators/rx_config/templates/html-template/history
89
95
  - rails_generators/rx_config/templates/html-template/history/history.css
90
96
  - rails_generators/rx_config/templates/html-template/history/history.js
91
97
  - rails_generators/rx_config/templates/html-template/history/historyFrame.html
@@ -102,102 +108,67 @@ files:
102
108
  - rails_generators/rx_config/templates/restfulx.yml
103
109
  - rails_generators/rx_config/templates/restfulx_tasks.rake
104
110
  - rails_generators/rx_config/templates/routes.erb
111
+ - rails_generators/rx_config/templates/session_store_flash.erb
105
112
  - rails_generators/rx_config/templates/swfobject.js
106
- - rails_generators/rx_config/USAGE
107
- - rails_generators/rx_controller
113
+ - rails_generators/rx_controller/USAGE
108
114
  - rails_generators/rx_controller/rx_controller_generator.rb
109
- - rails_generators/rx_controller/templates
110
115
  - rails_generators/rx_controller/templates/controller.as.erb
111
- - rails_generators/rx_controller/USAGE
112
- - rails_generators/rx_main_app
116
+ - rails_generators/rx_main_app/USAGE
113
117
  - rails_generators/rx_main_app/rx_main_app_generator.rb
114
- - rails_generators/rx_main_app/templates
115
118
  - rails_generators/rx_main_app/templates/mainapp.mxml
116
- - rails_generators/rx_main_app/USAGE
117
- - rails_generators/rx_scaffold
119
+ - rails_generators/rx_scaffold/USAGE
118
120
  - rails_generators/rx_scaffold/rx_scaffold_generator.rb
119
- - rails_generators/rx_scaffold/templates
120
- - rails_generators/rx_scaffold/templates/controllers
121
121
  - rails_generators/rx_scaffold/templates/controllers/default.rb.erb
122
122
  - rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb
123
123
  - rails_generators/rx_scaffold/templates/fixtures.yml.erb
124
- - rails_generators/rx_scaffold/templates/layouts
124
+ - rails_generators/rx_scaffold/templates/functional_test.rb
125
+ - rails_generators/rx_scaffold/templates/helper_test.rb
125
126
  - rails_generators/rx_scaffold/templates/layouts/default.erb
126
127
  - rails_generators/rx_scaffold/templates/migration.rb.erb
127
128
  - rails_generators/rx_scaffold/templates/model.as.erb
128
129
  - rails_generators/rx_scaffold/templates/model.rb.erb
129
- - rails_generators/rx_scaffold/USAGE
130
- - rails_generators/rx_yaml_scaffold
131
- - rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
132
130
  - rails_generators/rx_yaml_scaffold/USAGE
133
- - rxgen_generators/rx_config
134
- - rxgen_generators/rx_config/rx_config_generator.rb
131
+ - rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
135
132
  - rxgen_generators/rx_config/USAGE
136
- - rxgen_generators/rx_controller
133
+ - rxgen_generators/rx_config/rx_config_generator.rb
134
+ - rxgen_generators/rx_controller/USAGE
137
135
  - rxgen_generators/rx_controller/rx_controller_generator.rb
138
- - rxgen_generators/rx_controller/templates
139
136
  - rxgen_generators/rx_controller/templates/assist.py
140
137
  - rxgen_generators/rx_controller/templates/controller.as.erb
141
138
  - rxgen_generators/rx_controller/templates/iso8601.py
142
139
  - rxgen_generators/rx_controller/templates/restful.py
143
- - rxgen_generators/rx_controller/USAGE
144
- - rxgen_generators/rx_main_app
140
+ - rxgen_generators/rx_main_app/USAGE
145
141
  - rxgen_generators/rx_main_app/rx_main_app_generator.rb
146
- - rxgen_generators/rx_main_app/templates
147
142
  - rxgen_generators/rx_main_app/templates/main.py.erb
148
143
  - rxgen_generators/rx_main_app/templates/mainapp.mxml
149
- - rxgen_generators/rx_main_app/USAGE
150
- - rxgen_generators/rx_scaffold
144
+ - rxgen_generators/rx_scaffold/USAGE
151
145
  - rxgen_generators/rx_scaffold/rx_scaffold_generator.rb
152
- - rxgen_generators/rx_scaffold/templates
153
- - rxgen_generators/rx_scaffold/templates/component.mxml.erb
154
146
  - rxgen_generators/rx_scaffold/templates/controller.py.erb
147
+ - rxgen_generators/rx_scaffold/templates/layouts/default.erb
155
148
  - rxgen_generators/rx_scaffold/templates/model.as.erb
156
149
  - rxgen_generators/rx_scaffold/templates/model.py.erb
157
- - rxgen_generators/rx_scaffold/USAGE
158
- - rxgen_generators/rx_yaml_scaffold
159
- - rxgen_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
160
150
  - rxgen_generators/rx_yaml_scaffold/USAGE
161
- - lib/restfulx
162
- - lib/restfulx/active_foo.rb
163
- - lib/restfulx/active_record_tasks.rb
164
- - lib/restfulx/active_record_uuid_helper.rb
165
- - lib/restfulx/configuration.rb
166
- - lib/restfulx/datamapper_foo.rb
167
- - lib/restfulx/rails
168
- - lib/restfulx/rails/recipes.rb
169
- - lib/restfulx/rails/schema_to_yaml
170
- - lib/restfulx/rails/schema_to_yaml/extensions
171
- - lib/restfulx/rails/schema_to_yaml/extensions/enumerable.rb
172
- - lib/restfulx/rails/schema_to_yaml/settings
173
- - lib/restfulx/rails/schema_to_yaml/settings/config.rb
174
- - lib/restfulx/rails/schema_to_yaml/settings/core.rb
175
- - lib/restfulx/rails/schema_to_yaml.rb
176
- - lib/restfulx/rails/swf_helper.rb
177
- - lib/restfulx/tasks.rb
178
- - lib/restfulx.rb
179
- - test/rails
180
- - test/rails/controllers
181
- - test/rails/controllers/application.rb
151
+ - rxgen_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
152
+ - spec/restfulx_spec.rb
153
+ - spec/spec_helper.rb
154
+ - tasks/restfulx.rake
155
+ - test/rails/controllers/application_controller.rb
182
156
  - test/rails/controllers/locations_controller.rb
183
157
  - test/rails/controllers/notes_controller.rb
184
158
  - test/rails/controllers/projects_controller.rb
185
159
  - test/rails/controllers/tasks_controller.rb
186
160
  - test/rails/controllers/users_controller.rb
187
161
  - test/rails/database.yml
188
- - test/rails/fixtures
189
162
  - test/rails/fixtures/locations.yml
190
163
  - test/rails/fixtures/notes.yml
191
164
  - test/rails/fixtures/projects.yml
192
165
  - test/rails/fixtures/simple_properties.yml
193
166
  - test/rails/fixtures/tasks.yml
194
167
  - test/rails/fixtures/users.yml
195
- - test/rails/helpers
196
168
  - test/rails/helpers/functional_test_helper.rb
197
169
  - test/rails/helpers/test_helper.rb
198
170
  - test/rails/helpers/unit_test_helper.rb
199
171
  - test/rails/model.yml
200
- - test/rails/models
201
172
  - test/rails/models/location.rb
202
173
  - test/rails/models/note.rb
203
174
  - test/rails/models/project.rb
@@ -210,18 +181,12 @@ files:
210
181
  - test/rails/test_rails_integration_functional.rb
211
182
  - test/rails/test_to_fxml.rb
212
183
  - test/rails/test_to_json.rb
213
- - test/rails/views
214
- - test/rails/views/notes
215
184
  - test/rails/views/notes/empty_params_action.html.erb
216
185
  - test/rails/views/notes/index.html.erb
217
- - spec/restfulx_spec.rb
218
- - spec/spec_helper.rb
219
- - tasks/restfulx.rake
220
186
  has_rdoc: true
221
187
  homepage: http://restfulx.org
222
188
  post_install_message:
223
189
  rdoc_options:
224
- - --inline-source
225
190
  - --charset=UTF-8
226
191
  require_paths:
227
192
  - lib
@@ -244,5 +209,26 @@ rubygems_version: 1.3.1
244
209
  signing_key:
245
210
  specification_version: 2
246
211
  summary: RestfulX Framework Code Generation Engine / Rails 2.1+ Integration Support
247
- test_files: []
248
-
212
+ test_files:
213
+ - spec/restfulx_spec.rb
214
+ - spec/spec_helper.rb
215
+ - test/rails/controllers/application_controller.rb
216
+ - test/rails/controllers/locations_controller.rb
217
+ - test/rails/controllers/notes_controller.rb
218
+ - test/rails/controllers/projects_controller.rb
219
+ - test/rails/controllers/tasks_controller.rb
220
+ - test/rails/controllers/users_controller.rb
221
+ - test/rails/helpers/functional_test_helper.rb
222
+ - test/rails/helpers/test_helper.rb
223
+ - test/rails/helpers/unit_test_helper.rb
224
+ - test/rails/models/location.rb
225
+ - test/rails/models/note.rb
226
+ - test/rails/models/project.rb
227
+ - test/rails/models/simple_property.rb
228
+ - test/rails/models/task.rb
229
+ - test/rails/models/user.rb
230
+ - test/rails/schema.rb
231
+ - test/rails/test_active_foo.rb
232
+ - test/rails/test_rails_integration_functional.rb
233
+ - test/rails/test_to_fxml.rb
234
+ - test/rails/test_to_json.rb