restfulx 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/Rakefile +65 -30
  2. data/VERSION.yml +4 -0
  3. data/app_generators/rx_app/rx_app_generator.rb +25 -9
  4. data/app_generators/rx_app/templates/actionscript.properties +3 -3
  5. data/app_generators/rx_app/templates/actionscriptair.properties +3 -3
  6. data/app_generators/rx_app/templates/app.yaml.erb +1 -1
  7. data/app_generators/rx_app/templates/default_tasks.rake +5 -18
  8. data/app_generators/rx_app/templates/generate.rb +1 -1
  9. data/app_generators/rx_app/templates/index.html.erb +1 -1
  10. data/app_generators/rx_app/templates/mainair-app.xml +3 -3
  11. data/app_generators/rx_app/templates/mainapp.mxml +123 -2
  12. data/app_generators/rx_app/templates/project-textmate.erb +4 -4
  13. data/app_generators/rx_app/templates/project.properties +1 -1
  14. data/app_generators/rx_app/templates/projectair.properties +1 -1
  15. data/app_generators/rx_app/templates/restfulx.yml +25 -0
  16. data/bin/rx-gen +1 -1
  17. data/lib/restfulx/active_foo.rb +0 -8
  18. data/lib/restfulx/active_record_tasks.rb +9 -0
  19. data/lib/restfulx/active_record_uuid_helper.rb +17 -0
  20. data/lib/restfulx/configuration.rb +19 -31
  21. data/lib/restfulx/rails/schema_to_yaml/extensions/enumerable.rb +8 -0
  22. data/lib/restfulx/rails/schema_to_yaml/settings/config.rb +17 -0
  23. data/lib/restfulx/rails/schema_to_yaml/settings/core.rb +70 -0
  24. data/lib/restfulx/rails/schema_to_yaml.rb +121 -0
  25. data/lib/restfulx/rails/swf_helper.rb +1 -6
  26. data/lib/restfulx/tasks.rb +68 -42
  27. data/lib/restfulx.rb +4 -35
  28. data/rails_generators/rx_config/USAGE +2 -1
  29. data/rails_generators/rx_config/rx_config_generator.rb +80 -53
  30. data/rails_generators/rx_config/templates/actionscript.properties +3 -3
  31. data/rails_generators/rx_config/templates/actionscriptair.properties +3 -3
  32. data/rails_generators/rx_config/templates/flex_controller.erb +4 -0
  33. data/rails_generators/rx_config/templates/{index.html.erb → index.erb} +2 -4
  34. data/rails_generators/rx_config/templates/mainair-app.xml +3 -3
  35. data/rails_generators/rx_config/templates/mainapp.mxml +100 -2
  36. data/rails_generators/rx_config/templates/project-textmate.erb +4 -4
  37. data/rails_generators/rx_config/templates/project.properties +1 -1
  38. data/rails_generators/rx_config/templates/projectair.properties +1 -1
  39. data/rails_generators/rx_config/templates/restfulx.erb +38 -0
  40. data/rails_generators/rx_config/templates/restfulx.yml +55 -4
  41. data/rails_generators/rx_config/templates/restfulx_tasks.rake +3 -0
  42. data/rails_generators/rx_config/templates/routes.erb +47 -0
  43. data/rails_generators/rx_controller/rx_controller_generator.rb +9 -6
  44. data/rails_generators/rx_controller/templates/controller.as.erb +7 -9
  45. data/rails_generators/rx_main_app/rx_main_app_generator.rb +60 -0
  46. data/rails_generators/rx_main_app/templates/mainapp.mxml +129 -0
  47. data/rails_generators/rx_scaffold/rx_scaffold_generator.rb +88 -34
  48. data/rails_generators/rx_scaffold/templates/{controller.rb.erb → controllers/default.rb.erb} +29 -1
  49. data/rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb +23 -0
  50. data/rails_generators/rx_scaffold/templates/fixtures.yml.erb +9 -5
  51. data/{generators/rx_scaffold/templates/component.mxml.erb → rails_generators/rx_scaffold/templates/layouts/default.erb} +75 -59
  52. data/rails_generators/rx_scaffold/templates/migration.rb.erb +29 -2
  53. data/rails_generators/rx_scaffold/templates/model.as.erb +33 -2
  54. data/rails_generators/rx_scaffold/templates/model.rb.erb +36 -1
  55. data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +29 -10
  56. data/{generators → rxgen_generators}/rx_controller/rx_controller_generator.rb +7 -5
  57. data/{generators → rxgen_generators}/rx_controller/templates/assist.py +3 -3
  58. data/{generators → rxgen_generators}/rx_controller/templates/controller.as.erb +8 -6
  59. data/rxgen_generators/rx_controller/templates/iso8601.py +92 -0
  60. data/rxgen_generators/rx_main_app/USAGE +8 -0
  61. data/{generators → rxgen_generators}/rx_main_app/rx_main_app_generator.rb +10 -5
  62. data/rxgen_generators/rx_main_app/templates/mainapp.mxml +152 -0
  63. data/{generators → rxgen_generators}/rx_scaffold/rx_scaffold_generator.rb +6 -5
  64. data/{rails_generators → rxgen_generators}/rx_scaffold/templates/component.mxml.erb +24 -52
  65. data/spec/restfulx_spec.rb +1 -4
  66. data/spec/spec_helper.rb +0 -3
  67. data/tasks/restfulx.rake +2 -0
  68. metadata +102 -81
  69. data/History.txt +0 -7
  70. data/Manifest.txt +0 -127
  71. data/generators/rx_main_app/templates/mainapp.mxml +0 -35
  72. data/rdoc/generators/template/html/jamis.rb +0 -588
  73. data/tasks/ann.rake +0 -80
  74. data/tasks/bones.rake +0 -20
  75. data/tasks/gem.rake +0 -201
  76. data/tasks/git.rake +0 -40
  77. data/tasks/manifest.rake +0 -48
  78. data/tasks/notes.rake +0 -27
  79. data/tasks/post_load.rake +0 -39
  80. data/tasks/rdoc.rake +0 -50
  81. data/tasks/rubyforge.rake +0 -55
  82. data/tasks/setup.rb +0 -279
  83. data/tasks/spec.rake +0 -54
  84. data/tasks/svn.rake +0 -47
  85. data/tasks/test.rake +0 -40
  86. data/test/rails/playing_around_in_a_console.txt +0 -71
  87. /data/{generators → rails_generators}/rx_main_app/USAGE +0 -0
  88. /data/{generators → rxgen_generators}/rx_config/USAGE +0 -0
  89. /data/{generators → rxgen_generators}/rx_config/rx_config_generator.rb +0 -0
  90. /data/{generators → rxgen_generators}/rx_controller/USAGE +0 -0
  91. /data/{generators → rxgen_generators}/rx_controller/templates/restful.py +0 -0
  92. /data/{generators → rxgen_generators}/rx_main_app/templates/main.py.erb +0 -0
  93. /data/{generators → rxgen_generators}/rx_scaffold/USAGE +0 -0
  94. /data/{generators → rxgen_generators}/rx_scaffold/templates/controller.py.erb +0 -0
  95. /data/{generators → rxgen_generators}/rx_scaffold/templates/model.as.erb +0 -0
  96. /data/{generators → rxgen_generators}/rx_scaffold/templates/model.py.erb +0 -0
  97. /data/{generators → rxgen_generators}/rx_yaml_scaffold/USAGE +0 -0
  98. /data/{generators → rxgen_generators}/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +0 -0
@@ -0,0 +1,152 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <mx:<%= application_tag %> xmlns:mx="http://www.adobe.com/2006/mxml"
3
+ xmlns:generated="<%= base_package %>.components.generated.*"
4
+ paddingBottom="8" paddingLeft="8" paddingRight="8" paddingTop="8"
5
+ layout="horizontal" styleName="plain" initialize="init()">
6
+ <mx:Script>
7
+ <![CDATA[
8
+ <% if use_air -%>
9
+ <% if distributed -%>
10
+ import air.net.SocketMonitor;
11
+ import org.restfulx.events.PullEndEvent;
12
+ import org.restfulx.events.PullStartEvent;
13
+ import org.restfulx.events.PushEndEvent;
14
+ import org.restfulx.events.PushStartEvent;
15
+ import org.restfulx.controllers.ChangeController;
16
+ import org.restfulx.services.ISyncingServiceProvider;
17
+ <% end -%>
18
+ import org.restfulx.services.air.AIRServiceProvider;
19
+ <% end -%>
20
+ <% if use_gae -%>
21
+ import org.restfulx.services.http.GAEHTTPServiceProvider;
22
+ <% else -%>
23
+ import org.restfulx.services.http.XMLHTTPServiceProvider;
24
+ <% end -%>
25
+ import org.restfulx.Rx;
26
+ import <%= base_package %>.controllers.<%= command_controller_name %>;
27
+ <% if use_air -%>
28
+ <% if distributed -%>
29
+
30
+ [Bindable]
31
+ private var socketMonitor:SocketMonitor;
32
+
33
+ [Bindable]
34
+ private var online:Boolean;
35
+
36
+ [Bindable]
37
+ private var syncStatus:String;
38
+ <% end -%>
39
+ <% end -%>
40
+
41
+ private function init():void {
42
+ <% if use_air -%>
43
+ <% if distributed -%>
44
+ Rx.httpRootUrl = "http://localhost:3000/";
45
+ Rx.enableSync = true;
46
+
47
+ socketMonitor = new SocketMonitor("localhost", 3000);
48
+ socketMonitor.pollInterval = 2000; /* miliseconds */
49
+ socketMonitor.addEventListener(StatusEvent.STATUS, onNetworkStatusChange);
50
+ socketMonitor.start();
51
+
52
+ <% end -%>
53
+ <%= command_controller_name %>.initialize([AIRServiceProvider],
54
+ AIRServiceProvider.ID, "<%= base_package %>");
55
+ <% if distributed -%>
56
+
57
+ <% if use_gae -%>
58
+ Rx.changes.setSyncProviders(
59
+ ISyncingServiceProvider(Rx.services.getServiceProvider(AIRServiceProvider.ID)),
60
+ Rx.services.getServiceProvider(GAEHTTPServiceProvider.ID));
61
+ <% else -%>
62
+ Rx.changes.setSyncProviders(
63
+ ISyncingServiceProvider(Rx.services.getServiceProvider(AIRServiceProvider.ID)),
64
+ Rx.services.getServiceProvider(XMLHTTPServiceProvider.ID));
65
+ <% end -%>
66
+
67
+ Rx.changes.addEventListener(PushStartEvent.ID, onPushStart);
68
+ Rx.changes.addEventListener(PushEndEvent.ID, onPushEnd);
69
+ Rx.changes.addEventListener(PullStartEvent.ID, onPullStart);
70
+ Rx.changes.addEventListener(PullEndEvent.ID, onPullEnd);
71
+ <% end -%>
72
+ <% else -%>
73
+ <% if use_gae -%>
74
+ <%= command_controller_name %>.initialize([GAEHTTPServiceProvider], GAEHTTPServiceProvider.ID);
75
+ <% else -%>
76
+ <%= command_controller_name %>.initialize();
77
+ <% end -%>
78
+ <% end -%>
79
+ }
80
+ <% if use_air -%>
81
+ <% if distributed -%>
82
+
83
+ private function onPushStart(event:Event):void {
84
+ syncStatus = "Pushing changes ...";
85
+ }
86
+
87
+ private function onPushEnd(event:Event):void {
88
+ syncStatus = "Push complete.";
89
+ }
90
+
91
+ private function onPullStart(event:Event):void {
92
+ syncStatus = "Pulling data...";
93
+ }
94
+
95
+ private function onPullEnd(event:Event):void {
96
+ syncStatus = "Pull complete.";
97
+ }
98
+
99
+ private function onNetworkStatusChange(event:StatusEvent):void {
100
+ online = (socketMonitor.available) ? true : false;
101
+
102
+ if (online) {
103
+ <% if use_gae -%>
104
+ Rx.defaultServiceId = GAEHTTPServiceProvider.ID;
105
+ <% else -%>
106
+ Rx.defaultServiceId = XMLHTTPServiceProvider.ID;
107
+ <% end -%>
108
+ } else {
109
+ Rx.defaultServiceId = AIRServiceProvider.ID;
110
+ }
111
+ }
112
+
113
+ private function getCurrentProviderName(id:int):String {
114
+ switch (id) {
115
+ <% if use_gae -%>
116
+ case GAEHTTPServiceProvider.ID:
117
+ return "GAE";
118
+ <% else -%>
119
+ case XMLHTTPServiceProvider.ID:
120
+ return "XML/HTTP";
121
+ <% end -%>
122
+ case AIRServiceProvider.ID:
123
+ return "AIR (SQLite)";
124
+ default :
125
+ return "No idea";
126
+ }
127
+ }
128
+ <% end -%>
129
+ <% end -%>
130
+ ]]>
131
+ </mx:Script>
132
+ <% if use_air -%>
133
+ <% if distributed -%>
134
+ <mx:VBox height="100%">
135
+ <mx:Label text="Current Provider: {getCurrentProviderName(Rx.defaultServiceId)}"/>
136
+ <mx:Label text="Status: {online ? 'Online' : 'Offline' }"/>
137
+ <mx:HBox>
138
+ <mx:Button label="Push" click="{Rx.changes.push()}" enabled="{online}"/>
139
+ <mx:Button label="Pull" click="{Rx.changes.pull()}" enabled="{online}"/>
140
+ </mx:HBox>
141
+ <mx:Label text="{syncStatus}"/>
142
+ </mx:VBox>
143
+ <% end -%>
144
+ <% end -%>
145
+ <mx:LinkBar dataProvider="{mainViewStack}" direction="vertical" borderStyle="solid" backgroundColor="#EEEEEE"/>
146
+ <mx:ViewStack id="mainViewStack" width="100%" height="100%">
147
+ <!-- For a simple demo, put all the components here. -->
148
+ <% for component in component_names -%>
149
+ <generated:<%= component %>/>
150
+ <% end -%>
151
+ </mx:ViewStack>
152
+ </mx:<%= application_tag %>>
@@ -65,7 +65,8 @@ class RxScaffoldGenerator < RubiGen::Base
65
65
  :flex_project_name,
66
66
  :base_package,
67
67
  :base_folder,
68
- :command_controller_name
68
+ :command_controller_name,
69
+ :flex_root
69
70
 
70
71
  attr_reader :belongs_tos,
71
72
  :has_manies,
@@ -87,18 +88,18 @@ class RxScaffoldGenerator < RubiGen::Base
87
88
  @class_name = @name.camelize
88
89
 
89
90
  @project_name, @flex_project_name, @command_controller_name,
90
- @base_package, @base_folder = extract_names
91
+ @base_package, @base_folder, @flex_root = extract_names
91
92
  extract_relationships
92
93
  end
93
94
 
94
95
  def manifest
95
- record do |m|
96
+ record do |m|
96
97
  m.template 'model.as.erb',
97
- File.join("app", 'flex', base_folder, "models", "#{@class_name}.as"),
98
+ File.join("#{flex_root}", base_folder, "models", "#{@class_name}.as"),
98
99
  :assigns => { :resource_controller_name => "#{file_name.pluralize}" }
99
100
 
100
101
  m.template 'component.mxml.erb',
101
- File.join("app", 'flex', base_folder, "components", "generated", "#{@class_name}Box.mxml"),
102
+ File.join("#{flex_root}", base_folder, "components", "generated", "#{@class_name}Box.mxml"),
102
103
  :assigns => { :resource_controller_name => "#{file_name.pluralize}" }
103
104
 
104
105
  if options[:gae]
@@ -10,23 +10,23 @@
10
10
  <% end -%>
11
11
 
12
12
  [Bindable]
13
- private var _<%= class_name.dcfirst %>:<%= class_name %> = new <%= class_name %>();
13
+ private var <%= class_name.dcfirst %>:<%= class_name %> = new <%= class_name %>();
14
14
 
15
15
  private function new<%= class_name %>():void {
16
- _<%= class_name.dcfirst %> = new <%= class_name %>();
16
+ <%= class_name.dcfirst %> = new <%= class_name %>();
17
17
  <%= class_name.dcfirst.pluralize %>List.selectedIndex = -1;
18
18
  }
19
19
 
20
20
  private function save<%= class_name %>():void {
21
- if (_<%= class_name.dcfirst %>.id) {
22
- update<%= class_name %>();
21
+ updateModelProperties();
22
+ if (<%= class_name.dcfirst %>.id) {
23
+ <%= class_name.dcfirst %>.update({onSuccess: on<%= class_name %>Update});
23
24
  } else {
24
- create<%= class_name %>();
25
+ <%= class_name.dcfirst %>.create({onSuccess: on<%= class_name %>Create});
25
26
  }
26
27
  }
27
28
 
28
- private function create<%= class_name %>():void {
29
- var <%= class_name.dcfirst %>:<%= class_name %> = new <%= class_name %>();
29
+ private function updateModelProperties():void {
30
30
  <% for attribute in attributes -%>
31
31
  <% if attribute.type == :boolean -%>
32
32
  <%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
@@ -46,55 +46,27 @@
46
46
  <% for model in belongs_tos -%>
47
47
  <%= class_name.dcfirst %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
48
48
  <% end -%>
49
- <%= class_name.dcfirst %>.create({onSuccess: on<%= class_name %>Create});
50
- }
51
-
52
- private function update<%= class_name %>():void {
53
- <% for attribute in attributes -%>
54
- <% if attribute.type == :boolean -%>
55
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>CheckBox.selected;
56
- <% elsif attribute.type == :string -%>
57
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextInput.text;
58
- <% elsif attribute.type == :text -%>
59
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>TextArea.text;
60
- <% elsif attribute.type == :datetime || attribute.type == :time -%>
61
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateTimeTextInput.date;
62
- <% elsif attribute.type == :date -%>
63
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_name %>DateField.selectedDate;
64
- <% else -%>
65
- _<%= class_name.dcfirst %>.<%= attribute.flex_name %> = <%= attribute.flex_type %>(<%= attribute.flex_name %>TextInput.text);
66
- <% end -%>
67
- <% end -%>
68
-
69
- <% for model in belongs_tos -%>
70
- _<%= class_name.dcfirst %>.<%= model.camelcase(:lower) %> = <%= model.camelcase %>(<%= model.camelcase(:lower) %>ComboBox.selectedItem);
71
- <% end -%>
72
- _<%= class_name.dcfirst %>.update({onSuccess: on<%= class_name %>Update});
73
49
  }
74
50
 
75
51
  private function destroy<%= class_name %>():void {
76
- _<%= class_name.dcfirst %>.destroy({onSuccess: on<%= class_name %>Destroy});
52
+ <%= class_name.dcfirst %>.destroy({onSuccess: on<%= class_name %>Destroy});
77
53
  }
78
54
 
79
55
  private function on<%= class_name %>Select():void {
80
- _<%= class_name.dcfirst %> = RxUtils.clone(<%= class_name.dcfirst.pluralize %>List.selectedItem) as <%= class_name %>;
56
+ <%= class_name.dcfirst %> = RxUtils.clone(<%= class_name.dcfirst.pluralize %>List.selectedItem) as <%= class_name %>;
81
57
  }
82
58
 
83
- private function on<%= class_name %>Create(<%= class_name.dcfirst %>:<%= class_name %>):void {
84
- _<%= class_name.dcfirst %> = new <%= class_name %>;
59
+ private function on<%= class_name %>Create(result:<%= class_name %>):void {
60
+ <%= class_name.dcfirst %> = new <%= class_name %>;
85
61
  }
86
62
 
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 %> = RxUtils.clone(<%= class_name.dcfirst %>) as <%= class_name %>;
63
+ private function on<%= class_name %>Update(result:<%= class_name %>):void {
64
+ <%= class_name.dcfirst.pluralize %>List.selectedItem = result;
65
+ on<%= class_name %>Select();
90
66
  }
91
67
 
92
- private function on<%= class_name %>Destroy(<%= class_name.dcfirst %>:<%= class_name %>):void {
93
- on<%= class_name %>Create(<%= class_name.dcfirst %>);
94
- }
95
-
96
- private function canDelete<%= class_name %>(<%= class_name.dcfirst %>:<%= class_name %>):Boolean {
97
- return <%= class_name.dcfirst %> != null && !RxUtils.isEmpty(<%= class_name.dcfirst %>.id);
68
+ private function on<%= class_name %>Destroy(result:<%= class_name %>):void {
69
+ on<%= class_name %>Create(result);
98
70
  }
99
71
  ]]></mx:Script>
100
72
  <mx:Panel id="<%= class_name.dcfirst.pluralize %>Panel"
@@ -115,17 +87,17 @@
115
87
  <% for attribute in attributes -%>
116
88
  <mx:FormItem label="<%= attribute.flex_name.ucfirst %>" width="100%">
117
89
  <% if attribute.type == :boolean -%>
118
- <mx:CheckBox id="<%= attribute.flex_name %>CheckBox" selected="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
90
+ <mx:CheckBox id="<%= attribute.flex_name %>CheckBox" selected="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
119
91
  <% elsif attribute.type == :string -%>
120
- <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
92
+ <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
121
93
  <% elsif attribute.type == :text -%>
122
- <mx:TextArea id="<%= attribute.flex_name %>TextArea" width="100%" height="200" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
94
+ <mx:TextArea id="<%= attribute.flex_name %>TextArea" width="100%" height="200" text="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
123
95
  <% elsif attribute.type == :datetime || attribute.type == :time -%>
124
- <rx:DateTimeTextInput id="<%= attribute.flex_name %>DateTimeTextInput" width="200" date="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
96
+ <rx:DateTimeTextInput id="<%= attribute.flex_name %>DateTimeTextInput" width="200" date="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
125
97
  <% elsif attribute.type == :date -%>
126
- <mx:DateField id="<%= attribute.flex_name %>DateField" selectedDate="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
98
+ <mx:DateField id="<%= attribute.flex_name %>DateField" selectedDate="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
127
99
  <% else -%>
128
- <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{_<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
100
+ <mx:TextInput id="<%= attribute.flex_name %>TextInput" width="100%" text="{<%= class_name.dcfirst %>.<%= attribute.flex_name %>}"/>
129
101
  <% end -%>
130
102
  </mx:FormItem>
131
103
  <% end -%>
@@ -134,7 +106,7 @@
134
106
  <mx:ComboBox id="<%= model.camelcase(:lower) %>ComboBox" width="200"
135
107
  labelField="{<%= model.camelcase %>.LABEL}"
136
108
  dataProvider="{Rx.models.index(<%= model.camelcase %>)}" prompt="<%= model.camelcase %> ..."
137
- selectedItem="{_<%= class_name.dcfirst %>.<%= model.camelcase(:lower) %>}" />
109
+ selectedItem="{<%= class_name.dcfirst %>.<%= model.camelcase(:lower) %>}" />
138
110
  </mx:FormItem>
139
111
  <% end -%>
140
112
  </mx:Form>
@@ -142,7 +114,7 @@
142
114
  <mx:Button label="Save <%= class_name %>" width="50%" height="30"
143
115
  click="save<%= class_name %>()"/>
144
116
  <mx:Button label="Delete <%= class_name %>" width="50%" height="30"
145
- enabled="{canDelete<%= class_name %>(_<%= class_name.dcfirst %>)}"
117
+ enabled="{RxUtils.canDeleteModel(<%= class_name.dcfirst %>)}"
146
118
  click="destroy<%= class_name %>()"/>
147
119
  </mx:ControlBar>
148
120
  </mx:Panel>
@@ -1,7 +1,4 @@
1
-
2
1
  require File.join(File.dirname(__FILE__), %w[spec_helper])
3
2
 
4
3
  describe RestfulX do
5
- end
6
-
7
- # EOF
4
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  require File.expand_path(
3
2
  File.join(File.dirname(__FILE__), %w[.. lib restfulx]))
4
3
 
@@ -12,5 +11,3 @@ Spec::Runner.configure do |config|
12
11
  # config.mock_with :flexmock
13
12
  # config.mock_with :rr
14
13
  end
15
-
16
- # EOF
@@ -0,0 +1,2 @@
1
+ # Rails hook for RestfulX tasks when configured as a plugin instead of a gem
2
+ require File.join(File.dirname(__FILE__), "..", "lib", "restfulx", "active_record_tasks")
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.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Berastau
@@ -9,8 +9,8 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-03 00:00:00 -08:00
13
- default_executable:
12
+ date: 2009-03-19 00:00:00 -07:00
13
+ default_executable: rx-gen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubigen
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.0
23
+ version: 1.5.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
@@ -32,17 +32,7 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.0.0
34
34
  version:
35
- - !ruby/object:Gem::Dependency
36
- name: bones
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 2.2.0
44
- version:
45
- description: "Here's some of the things you can do with *RestfulX*: * *Create* a complete _Adobe_ _Flex_ or _AIR_ application in less than 5 minutes. Use our lightweight Ruby-based code generation toolkit to create a fully functional CRUD application. Simply do: sudo gem install restfulx And then run: rx-gen -h * *Integrate* with _Ruby_ _On_ _Rails_, _Merb_ or _Sinatra_ applications that use _ActiveRecord_, _DataMapper_, _CouchRest_, _ActiveCouch_ and so on. * *Communicate* between your Flex/AIR Rich Internet Application and service providers using either _XML_ or _JSON_. * *Persist* your data directly in Adobe AIR _SQLite_ database or _CouchDB_ without any additional infrastructure or intermediate servers. * *Deploy* your RestfulX application on the Google App Engine and use Google DataStore for persistence. * *Synchronize* your data between AIR _SQLite_ and other service providers."
35
+ description:
46
36
  email: dima.berastau@gmail.com
47
37
  executables:
48
38
  - rx-gen
@@ -50,14 +40,14 @@ extensions: []
50
40
 
51
41
  extra_rdoc_files:
52
42
  - README.rdoc
53
- - bin/rx-gen
54
43
  files:
55
- - History.txt
56
- - Manifest.txt
57
- - README.rdoc
58
44
  - Rakefile
59
- - app_generators/rx_app/USAGE
45
+ - README.rdoc
46
+ - VERSION.yml
47
+ - bin/rx-gen
48
+ - app_generators/rx_app
60
49
  - app_generators/rx_app/rx_app_generator.rb
50
+ - app_generators/rx_app/templates
61
51
  - app_generators/rx_app/templates/actionscript.properties
62
52
  - app_generators/rx_app/templates/actionscriptair.properties
63
53
  - app_generators/rx_app/templates/app.yaml.erb
@@ -66,7 +56,9 @@ files:
66
56
  - app_generators/rx_app/templates/expressInstall.swf
67
57
  - app_generators/rx_app/templates/flex.properties
68
58
  - app_generators/rx_app/templates/generate.rb
59
+ - app_generators/rx_app/templates/html-template
69
60
  - app_generators/rx_app/templates/html-template/AC_OETags.js
61
+ - app_generators/rx_app/templates/html-template/history
70
62
  - app_generators/rx_app/templates/html-template/history/history.css
71
63
  - app_generators/rx_app/templates/html-template/history/history.js
72
64
  - app_generators/rx_app/templates/html-template/history/historyFrame.html
@@ -80,86 +72,112 @@ files:
80
72
  - app_generators/rx_app/templates/project-textmate.erb
81
73
  - app_generators/rx_app/templates/project.properties
82
74
  - app_generators/rx_app/templates/projectair.properties
75
+ - app_generators/rx_app/templates/restfulx.yml
83
76
  - app_generators/rx_app/templates/swfobject.js
84
- - bin/rx-gen
85
- - generators/rx_config/USAGE
86
- - generators/rx_config/rx_config_generator.rb
87
- - generators/rx_controller/USAGE
88
- - generators/rx_controller/rx_controller_generator.rb
89
- - generators/rx_controller/templates/assist.py
90
- - generators/rx_controller/templates/controller.as.erb
91
- - generators/rx_controller/templates/restful.py
92
- - generators/rx_main_app/USAGE
93
- - generators/rx_main_app/rx_main_app_generator.rb
94
- - generators/rx_main_app/templates/main.py.erb
95
- - generators/rx_main_app/templates/mainapp.mxml
96
- - generators/rx_scaffold/USAGE
97
- - generators/rx_scaffold/rx_scaffold_generator.rb
98
- - generators/rx_scaffold/templates/component.mxml.erb
99
- - generators/rx_scaffold/templates/controller.py.erb
100
- - generators/rx_scaffold/templates/model.as.erb
101
- - generators/rx_scaffold/templates/model.py.erb
102
- - generators/rx_yaml_scaffold/USAGE
103
- - generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
104
- - lib/restfulx.rb
105
- - lib/restfulx/active_foo.rb
106
- - lib/restfulx/active_record_tasks.rb
107
- - lib/restfulx/configuration.rb
108
- - lib/restfulx/datamapper_foo.rb
109
- - lib/restfulx/rails/recipes.rb
110
- - lib/restfulx/rails/swf_helper.rb
111
- - lib/restfulx/tasks.rb
112
- - rails_generators/rx_config/USAGE
77
+ - app_generators/rx_app/USAGE
78
+ - rails_generators/rx_config
113
79
  - rails_generators/rx_config/rx_config_generator.rb
80
+ - rails_generators/rx_config/templates
114
81
  - rails_generators/rx_config/templates/actionscript.properties
115
82
  - rails_generators/rx_config/templates/actionscriptair.properties
116
83
  - rails_generators/rx_config/templates/expressInstall.swf
117
84
  - rails_generators/rx_config/templates/flex.properties
85
+ - rails_generators/rx_config/templates/flex_controller.erb
86
+ - rails_generators/rx_config/templates/html-template
118
87
  - rails_generators/rx_config/templates/html-template/AC_OETags.js
88
+ - rails_generators/rx_config/templates/html-template/history
119
89
  - rails_generators/rx_config/templates/html-template/history/history.css
120
90
  - rails_generators/rx_config/templates/html-template/history/history.js
121
91
  - rails_generators/rx_config/templates/html-template/history/historyFrame.html
122
92
  - rails_generators/rx_config/templates/html-template/index.template.html
123
93
  - rails_generators/rx_config/templates/html-template/playerProductInstall.swf
124
- - rails_generators/rx_config/templates/index.html.erb
94
+ - rails_generators/rx_config/templates/index.erb
125
95
  - rails_generators/rx_config/templates/mainair-app.xml
126
96
  - rails_generators/rx_config/templates/mainapp-config.xml
127
97
  - rails_generators/rx_config/templates/mainapp.mxml
128
98
  - rails_generators/rx_config/templates/project-textmate.erb
129
99
  - rails_generators/rx_config/templates/project.properties
130
100
  - rails_generators/rx_config/templates/projectair.properties
101
+ - rails_generators/rx_config/templates/restfulx.erb
131
102
  - rails_generators/rx_config/templates/restfulx.yml
132
103
  - rails_generators/rx_config/templates/restfulx_tasks.rake
104
+ - rails_generators/rx_config/templates/routes.erb
133
105
  - rails_generators/rx_config/templates/swfobject.js
134
- - rails_generators/rx_controller/USAGE
106
+ - rails_generators/rx_config/USAGE
107
+ - rails_generators/rx_controller
135
108
  - rails_generators/rx_controller/rx_controller_generator.rb
109
+ - rails_generators/rx_controller/templates
136
110
  - rails_generators/rx_controller/templates/controller.as.erb
137
- - rails_generators/rx_scaffold/USAGE
111
+ - rails_generators/rx_controller/USAGE
112
+ - rails_generators/rx_main_app
113
+ - rails_generators/rx_main_app/rx_main_app_generator.rb
114
+ - rails_generators/rx_main_app/templates
115
+ - rails_generators/rx_main_app/templates/mainapp.mxml
116
+ - rails_generators/rx_main_app/USAGE
117
+ - rails_generators/rx_scaffold
138
118
  - rails_generators/rx_scaffold/rx_scaffold_generator.rb
139
- - rails_generators/rx_scaffold/templates/component.mxml.erb
140
- - rails_generators/rx_scaffold/templates/controller.rb.erb
119
+ - rails_generators/rx_scaffold/templates
120
+ - rails_generators/rx_scaffold/templates/controllers
121
+ - rails_generators/rx_scaffold/templates/controllers/default.rb.erb
122
+ - rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb
141
123
  - rails_generators/rx_scaffold/templates/fixtures.yml.erb
124
+ - rails_generators/rx_scaffold/templates/layouts
125
+ - rails_generators/rx_scaffold/templates/layouts/default.erb
142
126
  - rails_generators/rx_scaffold/templates/migration.rb.erb
143
127
  - rails_generators/rx_scaffold/templates/model.as.erb
144
128
  - rails_generators/rx_scaffold/templates/model.rb.erb
145
- - rails_generators/rx_yaml_scaffold/USAGE
129
+ - rails_generators/rx_scaffold/USAGE
130
+ - rails_generators/rx_yaml_scaffold
146
131
  - rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
147
- - rdoc/generators/template/html/jamis.rb
148
- - spec/restfulx_spec.rb
149
- - spec/spec_helper.rb
150
- - tasks/ann.rake
151
- - tasks/bones.rake
152
- - tasks/gem.rake
153
- - tasks/git.rake
154
- - tasks/manifest.rake
155
- - tasks/notes.rake
156
- - tasks/post_load.rake
157
- - tasks/rdoc.rake
158
- - tasks/rubyforge.rake
159
- - tasks/setup.rb
160
- - tasks/spec.rake
161
- - tasks/svn.rake
162
- - tasks/test.rake
132
+ - rails_generators/rx_yaml_scaffold/USAGE
133
+ - rxgen_generators/rx_config
134
+ - rxgen_generators/rx_config/rx_config_generator.rb
135
+ - rxgen_generators/rx_config/USAGE
136
+ - rxgen_generators/rx_controller
137
+ - rxgen_generators/rx_controller/rx_controller_generator.rb
138
+ - rxgen_generators/rx_controller/templates
139
+ - rxgen_generators/rx_controller/templates/assist.py
140
+ - rxgen_generators/rx_controller/templates/controller.as.erb
141
+ - rxgen_generators/rx_controller/templates/iso8601.py
142
+ - rxgen_generators/rx_controller/templates/restful.py
143
+ - rxgen_generators/rx_controller/USAGE
144
+ - rxgen_generators/rx_main_app
145
+ - rxgen_generators/rx_main_app/rx_main_app_generator.rb
146
+ - rxgen_generators/rx_main_app/templates
147
+ - rxgen_generators/rx_main_app/templates/main.py.erb
148
+ - rxgen_generators/rx_main_app/templates/mainapp.mxml
149
+ - rxgen_generators/rx_main_app/USAGE
150
+ - rxgen_generators/rx_scaffold
151
+ - rxgen_generators/rx_scaffold/rx_scaffold_generator.rb
152
+ - rxgen_generators/rx_scaffold/templates
153
+ - rxgen_generators/rx_scaffold/templates/component.mxml.erb
154
+ - rxgen_generators/rx_scaffold/templates/controller.py.erb
155
+ - rxgen_generators/rx_scaffold/templates/model.as.erb
156
+ - 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
+ - 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
163
181
  - test/rails/controllers/application.rb
164
182
  - test/rails/controllers/locations_controller.rb
165
183
  - test/rails/controllers/notes_controller.rb
@@ -167,37 +185,44 @@ files:
167
185
  - test/rails/controllers/tasks_controller.rb
168
186
  - test/rails/controllers/users_controller.rb
169
187
  - test/rails/database.yml
188
+ - test/rails/fixtures
170
189
  - test/rails/fixtures/locations.yml
171
190
  - test/rails/fixtures/notes.yml
172
191
  - test/rails/fixtures/projects.yml
173
192
  - test/rails/fixtures/simple_properties.yml
174
193
  - test/rails/fixtures/tasks.yml
175
194
  - test/rails/fixtures/users.yml
195
+ - test/rails/helpers
176
196
  - test/rails/helpers/functional_test_helper.rb
177
197
  - test/rails/helpers/test_helper.rb
178
198
  - test/rails/helpers/unit_test_helper.rb
179
199
  - test/rails/model.yml
200
+ - test/rails/models
180
201
  - test/rails/models/location.rb
181
202
  - test/rails/models/note.rb
182
203
  - test/rails/models/project.rb
183
204
  - test/rails/models/simple_property.rb
184
205
  - test/rails/models/task.rb
185
206
  - test/rails/models/user.rb
186
- - test/rails/playing_around_in_a_console.txt
187
207
  - test/rails/schema.rb
188
208
  - test/rails/test.swf
189
209
  - test/rails/test_active_foo.rb
190
210
  - test/rails/test_rails_integration_functional.rb
191
211
  - test/rails/test_to_fxml.rb
192
212
  - test/rails/test_to_json.rb
213
+ - test/rails/views
214
+ - test/rails/views/notes
193
215
  - test/rails/views/notes/empty_params_action.html.erb
194
216
  - test/rails/views/notes/index.html.erb
217
+ - spec/restfulx_spec.rb
218
+ - spec/spec_helper.rb
219
+ - tasks/restfulx.rake
195
220
  has_rdoc: true
196
- homepage: http://wiki.github.com/dima/restfulx
221
+ homepage: http://restfulx.org
197
222
  post_install_message:
198
223
  rdoc_options:
199
- - --main
200
- - README.rdoc
224
+ - --inline-source
225
+ - --charset=UTF-8
201
226
  require_paths:
202
227
  - lib
203
228
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -219,9 +244,5 @@ rubygems_version: 1.3.1
219
244
  signing_key:
220
245
  specification_version: 2
221
246
  summary: RestfulX Framework Code Generation Engine / Rails 2.1+ Integration Support
222
- test_files:
223
- - test/rails/helpers/test_helper.rb
224
- - test/rails/test_active_foo.rb
225
- - test/rails/test_rails_integration_functional.rb
226
- - test/rails/test_to_fxml.rb
227
- - test/rails/test_to_json.rb
247
+ test_files: []
248
+
data/History.txt DELETED
@@ -1,7 +0,0 @@
1
- == 1.1.2 / 2009-01-11
2
-
3
- * Got rid of default_methods helper for AR models. to_fxml(:methods => []) syntax must be used instead.
4
-
5
- == 1.1.1 / 2009-01-09
6
-
7
- * Bug fixing code generation templates so that AIR projects compile properly with Flex SDK 3.2.0