dima-restfulx 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/History.txt +7 -0
  2. data/Manifest.txt +127 -0
  3. data/README.rdoc +50 -0
  4. data/Rakefile +42 -0
  5. data/app_generators/rx_app/USAGE +22 -0
  6. data/app_generators/rx_app/rx_app_generator.rb +94 -0
  7. data/app_generators/rx_app/templates/actionscript.properties +16 -0
  8. data/app_generators/rx_app/templates/actionscriptair.properties +16 -0
  9. data/app_generators/rx_app/templates/app.yaml.erb +12 -0
  10. data/app_generators/rx_app/templates/default_tasks.rake +51 -0
  11. data/app_generators/rx_app/templates/empty.txt +0 -0
  12. data/app_generators/rx_app/templates/expressInstall.swf +0 -0
  13. data/app_generators/rx_app/templates/flex.properties +2 -0
  14. data/app_generators/rx_app/templates/generate.rb +17 -0
  15. data/app_generators/rx_app/templates/html-template/AC_OETags.js +276 -0
  16. data/app_generators/rx_app/templates/html-template/history/history.css +6 -0
  17. data/app_generators/rx_app/templates/html-template/history/history.js +645 -0
  18. data/app_generators/rx_app/templates/html-template/history/historyFrame.html +29 -0
  19. data/app_generators/rx_app/templates/html-template/index.template.html +121 -0
  20. data/app_generators/rx_app/templates/html-template/playerProductInstall.swf +0 -0
  21. data/app_generators/rx_app/templates/index.html.erb +18 -0
  22. data/app_generators/rx_app/templates/index.yaml +11 -0
  23. data/app_generators/rx_app/templates/mainair-app.xml +134 -0
  24. data/app_generators/rx_app/templates/mainapp-config.xml +21 -0
  25. data/app_generators/rx_app/templates/mainapp.mxml +31 -0
  26. data/app_generators/rx_app/templates/project-textmate.erb +52 -0
  27. data/app_generators/rx_app/templates/project.properties +18 -0
  28. data/app_generators/rx_app/templates/projectair.properties +24 -0
  29. data/app_generators/rx_app/templates/swfobject.js +5 -0
  30. data/bin/rx-gen +31 -0
  31. data/generators/rx_config/USAGE +5 -0
  32. data/generators/rx_config/rx_config_generator.rb +19 -0
  33. data/generators/rx_controller/USAGE +10 -0
  34. data/generators/rx_controller/rx_controller_generator.rb +39 -0
  35. data/generators/rx_controller/templates/assist.py +65 -0
  36. data/generators/rx_controller/templates/controller.as.erb +36 -0
  37. data/generators/rx_controller/templates/restful.py +136 -0
  38. data/generators/rx_main_app/USAGE +8 -0
  39. data/generators/rx_main_app/rx_main_app_generator.rb +60 -0
  40. data/generators/rx_main_app/templates/main.py.erb +29 -0
  41. data/generators/rx_main_app/templates/mainapp.mxml +35 -0
  42. data/generators/rx_scaffold/USAGE +29 -0
  43. data/generators/rx_scaffold/rx_scaffold_generator.rb +146 -0
  44. data/generators/rx_scaffold/templates/component.mxml.erb +149 -0
  45. data/generators/rx_scaffold/templates/controller.py.erb +27 -0
  46. data/generators/rx_scaffold/templates/model.as.erb +42 -0
  47. data/generators/rx_scaffold/templates/model.py.erb +14 -0
  48. data/generators/rx_yaml_scaffold/USAGE +45 -0
  49. data/generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +47 -0
  50. data/lib/restfulx/active_foo.rb +186 -0
  51. data/lib/restfulx/active_record_tasks.rb +81 -0
  52. data/lib/restfulx/configuration.rb +76 -0
  53. data/lib/restfulx/datamapper_foo.rb +31 -0
  54. data/lib/restfulx/rails/recipes.rb +60 -0
  55. data/lib/restfulx/rails/swf_helper.rb +60 -0
  56. data/lib/restfulx/tasks.rb +85 -0
  57. data/lib/restfulx.rb +117 -0
  58. data/rails_generators/rx_config/USAGE +18 -0
  59. data/rails_generators/rx_config/rx_config_generator.rb +115 -0
  60. data/rails_generators/rx_config/templates/actionscript.properties +16 -0
  61. data/rails_generators/rx_config/templates/actionscriptair.properties +16 -0
  62. data/rails_generators/rx_config/templates/expressInstall.swf +0 -0
  63. data/rails_generators/rx_config/templates/flex.properties +2 -0
  64. data/rails_generators/rx_config/templates/html-template/AC_OETags.js +276 -0
  65. data/rails_generators/rx_config/templates/html-template/history/history.css +6 -0
  66. data/rails_generators/rx_config/templates/html-template/history/history.js +645 -0
  67. data/rails_generators/rx_config/templates/html-template/history/historyFrame.html +29 -0
  68. data/rails_generators/rx_config/templates/html-template/index.template.html +121 -0
  69. data/rails_generators/rx_config/templates/html-template/playerProductInstall.swf +0 -0
  70. data/rails_generators/rx_config/templates/index.html.erb +18 -0
  71. data/rails_generators/rx_config/templates/mainair-app.xml +134 -0
  72. data/rails_generators/rx_config/templates/mainapp-config.xml +21 -0
  73. data/rails_generators/rx_config/templates/mainapp.mxml +31 -0
  74. data/rails_generators/rx_config/templates/project-textmate.erb +52 -0
  75. data/rails_generators/rx_config/templates/project.properties +18 -0
  76. data/rails_generators/rx_config/templates/projectair.properties +24 -0
  77. data/rails_generators/rx_config/templates/restfulx.yml +14 -0
  78. data/rails_generators/rx_config/templates/restfulx_tasks.rake +6 -0
  79. data/rails_generators/rx_config/templates/swfobject.js +5 -0
  80. data/rails_generators/rx_controller/USAGE +10 -0
  81. data/rails_generators/rx_controller/rx_controller_generator.rb +28 -0
  82. data/rails_generators/rx_controller/templates/controller.as.erb +40 -0
  83. data/rails_generators/rx_scaffold/USAGE +35 -0
  84. data/rails_generators/rx_scaffold/rx_scaffold_generator.rb +179 -0
  85. data/rails_generators/rx_scaffold/templates/component.mxml.erb +149 -0
  86. data/rails_generators/rx_scaffold/templates/controller.rb.erb +97 -0
  87. data/rails_generators/rx_scaffold/templates/fixtures.yml.erb +35 -0
  88. data/rails_generators/rx_scaffold/templates/migration.rb.erb +19 -0
  89. data/rails_generators/rx_scaffold/templates/model.as.erb +42 -0
  90. data/rails_generators/rx_scaffold/templates/model.rb.erb +11 -0
  91. data/rails_generators/rx_yaml_scaffold/USAGE +51 -0
  92. data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +49 -0
  93. data/rdoc/generators/template/html/jamis.rb +588 -0
  94. data/spec/restfulx_spec.rb +7 -0
  95. data/spec/spec_helper.rb +16 -0
  96. data/test/rails/controllers/application.rb +15 -0
  97. data/test/rails/controllers/locations_controller.rb +93 -0
  98. data/test/rails/controllers/notes_controller.rb +96 -0
  99. data/test/rails/controllers/projects_controller.rb +93 -0
  100. data/test/rails/controllers/tasks_controller.rb +93 -0
  101. data/test/rails/controllers/users_controller.rb +93 -0
  102. data/test/rails/database.yml +4 -0
  103. data/test/rails/fixtures/locations.yml +8 -0
  104. data/test/rails/fixtures/notes.yml +17 -0
  105. data/test/rails/fixtures/projects.yml +25 -0
  106. data/test/rails/fixtures/simple_properties.yml +19 -0
  107. data/test/rails/fixtures/tasks.yml +46 -0
  108. data/test/rails/fixtures/users.yml +13 -0
  109. data/test/rails/helpers/functional_test_helper.rb +21 -0
  110. data/test/rails/helpers/test_helper.rb +61 -0
  111. data/test/rails/helpers/unit_test_helper.rb +30 -0
  112. data/test/rails/model.yml +35 -0
  113. data/test/rails/models/location.rb +4 -0
  114. data/test/rails/models/note.rb +3 -0
  115. data/test/rails/models/project.rb +4 -0
  116. data/test/rails/models/simple_property.rb +2 -0
  117. data/test/rails/models/task.rb +18 -0
  118. data/test/rails/models/user.rb +20 -0
  119. data/test/rails/playing_around_in_a_console.txt +71 -0
  120. data/test/rails/schema.rb +77 -0
  121. data/test/rails/test.swf +1 -0
  122. data/test/rails/test_active_foo.rb +36 -0
  123. data/test/rails/test_rails_integration_functional.rb +22 -0
  124. data/test/rails/test_to_fxml.rb +35 -0
  125. data/test/rails/test_to_json.rb +23 -0
  126. data/test/rails/views/notes/empty_params_action.html.erb +1 -0
  127. data/test/rails/views/notes/index.html.erb +1 -0
  128. metadata +211 -0
data/History.txt ADDED
@@ -0,0 +1,7 @@
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
data/Manifest.txt ADDED
@@ -0,0 +1,127 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.rdoc
4
+ Rakefile
5
+ app_generators/rx_app/USAGE
6
+ app_generators/rx_app/rx_app_generator.rb
7
+ app_generators/rx_app/templates/actionscript.properties
8
+ app_generators/rx_app/templates/actionscriptair.properties
9
+ app_generators/rx_app/templates/app.yaml.erb
10
+ app_generators/rx_app/templates/default_tasks.rake
11
+ app_generators/rx_app/templates/empty.txt
12
+ app_generators/rx_app/templates/expressInstall.swf
13
+ app_generators/rx_app/templates/flex.properties
14
+ app_generators/rx_app/templates/generate.rb
15
+ app_generators/rx_app/templates/html-template/AC_OETags.js
16
+ app_generators/rx_app/templates/html-template/history/history.css
17
+ app_generators/rx_app/templates/html-template/history/history.js
18
+ app_generators/rx_app/templates/html-template/history/historyFrame.html
19
+ app_generators/rx_app/templates/html-template/index.template.html
20
+ app_generators/rx_app/templates/html-template/playerProductInstall.swf
21
+ app_generators/rx_app/templates/index.html.erb
22
+ app_generators/rx_app/templates/index.yaml
23
+ app_generators/rx_app/templates/mainair-app.xml
24
+ app_generators/rx_app/templates/mainapp-config.xml
25
+ app_generators/rx_app/templates/mainapp.mxml
26
+ app_generators/rx_app/templates/project-textmate.erb
27
+ app_generators/rx_app/templates/project.properties
28
+ app_generators/rx_app/templates/projectair.properties
29
+ app_generators/rx_app/templates/swfobject.js
30
+ bin/rx-gen
31
+ generators/rx_config/USAGE
32
+ generators/rx_config/rx_config_generator.rb
33
+ generators/rx_controller/USAGE
34
+ generators/rx_controller/rx_controller_generator.rb
35
+ generators/rx_controller/templates/assist.py
36
+ generators/rx_controller/templates/controller.as.erb
37
+ generators/rx_controller/templates/restful.py
38
+ generators/rx_main_app/USAGE
39
+ generators/rx_main_app/rx_main_app_generator.rb
40
+ generators/rx_main_app/templates/main.py.erb
41
+ generators/rx_main_app/templates/mainapp.mxml
42
+ generators/rx_scaffold/USAGE
43
+ generators/rx_scaffold/rx_scaffold_generator.rb
44
+ generators/rx_scaffold/templates/component.mxml.erb
45
+ generators/rx_scaffold/templates/controller.py.erb
46
+ generators/rx_scaffold/templates/model.as.erb
47
+ generators/rx_scaffold/templates/model.py.erb
48
+ generators/rx_yaml_scaffold/USAGE
49
+ generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
50
+ lib/restfulx.rb
51
+ lib/restfulx/active_foo.rb
52
+ lib/restfulx/active_record_tasks.rb
53
+ lib/restfulx/configuration.rb
54
+ lib/restfulx/datamapper_foo.rb
55
+ lib/restfulx/rails/recipes.rb
56
+ lib/restfulx/rails/swf_helper.rb
57
+ lib/restfulx/tasks.rb
58
+ rails_generators/rx_config/USAGE
59
+ rails_generators/rx_config/rx_config_generator.rb
60
+ rails_generators/rx_config/templates/actionscript.properties
61
+ rails_generators/rx_config/templates/actionscriptair.properties
62
+ rails_generators/rx_config/templates/expressInstall.swf
63
+ rails_generators/rx_config/templates/flex.properties
64
+ rails_generators/rx_config/templates/html-template/AC_OETags.js
65
+ rails_generators/rx_config/templates/html-template/history/history.css
66
+ rails_generators/rx_config/templates/html-template/history/history.js
67
+ rails_generators/rx_config/templates/html-template/history/historyFrame.html
68
+ rails_generators/rx_config/templates/html-template/index.template.html
69
+ rails_generators/rx_config/templates/html-template/playerProductInstall.swf
70
+ rails_generators/rx_config/templates/index.html.erb
71
+ rails_generators/rx_config/templates/mainair-app.xml
72
+ rails_generators/rx_config/templates/mainapp-config.xml
73
+ rails_generators/rx_config/templates/mainapp.mxml
74
+ rails_generators/rx_config/templates/project-textmate.erb
75
+ rails_generators/rx_config/templates/project.properties
76
+ rails_generators/rx_config/templates/projectair.properties
77
+ rails_generators/rx_config/templates/restfulx.yml
78
+ rails_generators/rx_config/templates/restfulx_tasks.rake
79
+ rails_generators/rx_config/templates/swfobject.js
80
+ rails_generators/rx_controller/USAGE
81
+ rails_generators/rx_controller/rx_controller_generator.rb
82
+ rails_generators/rx_controller/templates/controller.as.erb
83
+ rails_generators/rx_scaffold/USAGE
84
+ rails_generators/rx_scaffold/rx_scaffold_generator.rb
85
+ rails_generators/rx_scaffold/templates/component.mxml.erb
86
+ rails_generators/rx_scaffold/templates/controller.rb.erb
87
+ rails_generators/rx_scaffold/templates/fixtures.yml.erb
88
+ rails_generators/rx_scaffold/templates/migration.rb.erb
89
+ rails_generators/rx_scaffold/templates/model.as.erb
90
+ rails_generators/rx_scaffold/templates/model.rb.erb
91
+ rails_generators/rx_yaml_scaffold/USAGE
92
+ rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb
93
+ rdoc/generators/template/html/jamis.rb
94
+ spec/restfulx_spec.rb
95
+ spec/spec_helper.rb
96
+ test/rails/controllers/application.rb
97
+ test/rails/controllers/locations_controller.rb
98
+ test/rails/controllers/notes_controller.rb
99
+ test/rails/controllers/projects_controller.rb
100
+ test/rails/controllers/tasks_controller.rb
101
+ test/rails/controllers/users_controller.rb
102
+ test/rails/database.yml
103
+ test/rails/fixtures/locations.yml
104
+ test/rails/fixtures/notes.yml
105
+ test/rails/fixtures/projects.yml
106
+ test/rails/fixtures/simple_properties.yml
107
+ test/rails/fixtures/tasks.yml
108
+ test/rails/fixtures/users.yml
109
+ test/rails/helpers/functional_test_helper.rb
110
+ test/rails/helpers/test_helper.rb
111
+ test/rails/helpers/unit_test_helper.rb
112
+ test/rails/model.yml
113
+ test/rails/models/location.rb
114
+ test/rails/models/note.rb
115
+ test/rails/models/project.rb
116
+ test/rails/models/simple_property.rb
117
+ test/rails/models/task.rb
118
+ test/rails/models/user.rb
119
+ test/rails/playing_around_in_a_console.txt
120
+ test/rails/schema.rb
121
+ test/rails/test.swf
122
+ test/rails/test_active_foo.rb
123
+ test/rails/test_rails_integration_functional.rb
124
+ test/rails/test_to_fxml.rb
125
+ test/rails/test_to_json.rb
126
+ test/rails/views/notes/empty_params_action.html.erb
127
+ test/rails/views/notes/index.html.erb
data/README.rdoc ADDED
@@ -0,0 +1,50 @@
1
+ = RestfulX Framework: The RESTful way to develop Adobe Flex and AIR applications
2
+
3
+ == Description
4
+
5
+ Here's some of the things you can do with *RestfulX*:
6
+
7
+ * *Create* a complete _Adobe_ _Flex_ or _AIR_ application in less than 5 minutes.
8
+
9
+ Use our lightweight Ruby-based code generation toolkit to create a fully functional
10
+ CRUD application. Simply do:
11
+
12
+ sudo gem install restfulx
13
+
14
+ And then run:
15
+
16
+ rx-gen -h
17
+
18
+ * *Integrate* with _Ruby_ _On_ _Rails_, _Merb_ or _Sinatra_ applications
19
+ that use _ActiveRecord_, _DataMapper_, _CouchRest_, _ActiveCouch_ and so on.
20
+
21
+ * *Communicate* between your Flex/AIR Rich Internet Application and service providers
22
+ using either _XML_ or _JSON_.
23
+
24
+ * *Persist* your data directly in Adobe AIR _SQLite_ database or _CouchDB_
25
+ without any additional infrastructure or intermediate servers.
26
+
27
+ * *Deploy* your RestfulX application on the Google App Engine and use Google
28
+ DataStore for persistence.
29
+
30
+ * *Synchronize* your data between AIR _SQLite_ and other service providers.
31
+
32
+ == Getting Started
33
+
34
+ For details on how to get started with the RestfulX framework refer to:
35
+
36
+ http://github.com/dima/restfulx/wikis/home
37
+
38
+ == Getting Involved
39
+
40
+ Report bugs or track framework development progress:
41
+
42
+ http://restfulx.lighthouseapp.com/dashboard
43
+
44
+ Get involved with the community:
45
+
46
+ http://groups.google.com/group/restfulx-framework
47
+
48
+ == License
49
+
50
+ Copyright (c) 2008-2009 Dima Berastau and Contributors, released under MIT License
data/Rakefile ADDED
@@ -0,0 +1,42 @@
1
+ # Look in the tasks/setup.rb file for the various options that can be
2
+ # configured in this Rakefile. The .rake files in the tasks directory
3
+ # are where the options are used.
4
+
5
+ begin
6
+ require 'bones'
7
+ Bones.setup
8
+ rescue LoadError
9
+ load 'tasks/setup.rb'
10
+ end
11
+
12
+ ensure_in_path 'lib'
13
+ require 'restfulx'
14
+
15
+ depend_on 'rubigen', '1.4.0'
16
+ depend_on 'activesupport', '2.0.0'
17
+
18
+ task :default => 'spec:run'
19
+
20
+ PROJ.name = 'restfulx'
21
+ PROJ.summary = 'RestfulX Framework Code Generation Engine / Rails 2.1+ Integration Support'
22
+ PROJ.authors = 'Dima Berastau'
23
+ PROJ.email = 'dima.berastau@gmail.com'
24
+ PROJ.url = 'http://wiki.github.com/dima/restfulx'
25
+ PROJ.version = RestfulX::VERSION
26
+
27
+ PROJ.executables = ['bin/rx-gen']
28
+
29
+ #PROJ.rdoc.opts << '-Tjamis'
30
+ PROJ.rdoc.exclude << %w(.txt)
31
+ PROJ.rdoc.main = 'README.rdoc'
32
+ PROJ.rdoc.dir = 'doc/api'
33
+
34
+ PROJ.readme_file = 'README.rdoc'
35
+ PROJ.rubyforge.name = 'restfulx'
36
+
37
+ PROJ.exclude << %w(.DS_Store .gitignore .log, .sqlite3)
38
+
39
+ PROJ.spec.opts << '--color'
40
+ PROJ.test.opts << '-W1'
41
+
42
+ # EOF
@@ -0,0 +1,22 @@
1
+ Description:
2
+ Generates the primary RestfulX project directory structure and sets
3
+ up Flex Builder and TextMate specific descriptor files
4
+
5
+ You can generate Flex Builder configuration for either *pure* Flex
6
+ project or an AIR project. To generate AIR configuration pass the -a
7
+ (--air) option to the generator.
8
+
9
+ You can also choose to generate a simple Google App Engine back-end
10
+ along with your Flex front-end by passing the --gae option.
11
+
12
+ Examples:
13
+ `rx-gen pomodo` # generates project structure and a
14
+ # default Flex app configuration.
15
+ `rx-gen -a pomodo` # as above but generates an AIR app
16
+ # and configuration
17
+ `rx-gen --gae pomodo` # generate Flex + GAE application
18
+ # configuration
19
+
20
+ Next Steps:
21
+ In your new RestfulX project folder run `ruby script/generate` for
22
+ a list of available generators.
@@ -0,0 +1,94 @@
1
+ class RxAppGenerator < RubiGen::Base
2
+ include RestfulX::Configuration
3
+
4
+ attr_reader :project_name,
5
+ :flex_project_name,
6
+ :base_package,
7
+ :base_folder,
8
+ :command_controller_name,
9
+ :component_names,
10
+ :application_tag,
11
+ :use_air
12
+
13
+ def initialize(runtime_args, runtime_options = {})
14
+ super
15
+ usage if args.empty?
16
+ @destination_root = File.expand_path(args.shift)
17
+
18
+ @project_name, @flex_project_name, @command_controller_name,
19
+ @base_package, @base_folder = extract_names(base_name)
20
+
21
+ @use_air = options[:air_config]
22
+ if @use_air
23
+ @application_tag = 'WindowedApplication'
24
+ else
25
+ @application_tag = 'Application'
26
+ end
27
+
28
+ @component_names = []
29
+ end
30
+
31
+ def manifest
32
+ record do |m|
33
+ m.directory ''
34
+
35
+ %w(script lib db bin-debug).each { |dir| m.directory dir }
36
+
37
+ if options[:gae]
38
+ m.file 'index.yaml', 'index.yaml' unless File.exist?('index.yaml')
39
+ m.template 'app.yaml.erb', 'app.yaml' unless File.exist?('app.yaml')
40
+ m.directory 'app/controllers'
41
+ m.file 'empty.txt', 'app/__init__.py'
42
+ m.file 'empty.txt', 'app/controllers/__init__.py'
43
+ m.directory 'app/models'
44
+ m.file 'empty.txt', 'app/models/__init__.py'
45
+ end
46
+
47
+ m.file 'default_tasks.rake', 'Rakefile' unless File.exist?('Rakefile')
48
+ m.file 'flex.properties', '.flexProperties'
49
+ m.file 'generate.rb', 'script/generate', { :chmod => 0755 }
50
+ if @use_air
51
+ m.template 'actionscriptair.properties', '.actionScriptProperties'
52
+ m.template 'projectair.properties', '.project'
53
+ else
54
+ m.template 'actionscript.properties', '.actionScriptProperties'
55
+ m.template 'project.properties', '.project'
56
+
57
+ m.directory 'html-template/history'
58
+ %w(index.template.html AC_OETags.js playerProductInstall.swf).each do |file|
59
+ m.file "html-template/#{file}", "html-template/#{file}"
60
+ end
61
+
62
+ %w(history.css history.js historyFrame.html).each do |file|
63
+ m.file "html-template/history/#{file}", "html-template/history/#{file}"
64
+ end
65
+
66
+ m.directory 'public/javascripts'
67
+ m.file 'swfobject.js', 'public/javascripts/swfobject.js'
68
+ m.file 'expressInstall.swf', 'public/expressInstall.swf'
69
+ m.template 'index.html.erb', 'public/index.html'
70
+ end
71
+
72
+ %w(components controllers commands models events).each do |dir|
73
+ m.directory "app/flex/#{base_folder}/#{dir}"
74
+ end
75
+
76
+ m.directory "app/flex/#{base_folder}/components/generated"
77
+
78
+ m.template 'project-textmate.erb', "#{project_name.underscore}.tmproj"
79
+ m.template 'mainapp.mxml', File.join('app', 'flex', "#{project_name}.mxml")
80
+ m.template 'mainapp-config.xml', File.join('app', 'flex', "#{project_name}-config.xml")
81
+ m.template 'mainair-app.xml', File.join('app', 'flex', "#{project_name}-app.xml") if @use_air
82
+ end
83
+ end
84
+
85
+ protected
86
+ def add_options!(opt)
87
+ opt.separator ''
88
+ opt.separator 'Options:'
89
+ opt.on("-a", "--air", "Configure AIR project instead of Flex. Flex is default.",
90
+ "Default: false") { |v| options[:air_config] = v }
91
+ opt.on("--gae", "Generate Google App Engine Python classes in addition to RestfulX Flex resources.",
92
+ "Default: false") { |v| options[:gae] = v }
93
+ end
94
+ end
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <actionScriptProperties mainApplicationPath="<%= project_name %>.mxml" version="3">
3
+ <compiler additionalCompilerArguments="-locale en_US -keep-as3-metadata+=Resource,HasOne,HasMany,BelongsTo,DateTime,Lazy,Ignored" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="public/bin" rootURL="http://localhost:3000/bin" sourceFolderPath="app/flex" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
4
+ <compilerSourcePath/>
5
+ <libraryPath defaultLinkType="1">
6
+ <libraryPathEntry kind="4" path=""/>
7
+ <libraryPathEntry kind="1" linkType="1" path="lib"/>
8
+ </libraryPath>
9
+ <sourceAttachmentPath/>
10
+ </compiler>
11
+ <applications>
12
+ <application path="<%= project_name %>.mxml"/>
13
+ </applications>
14
+ <modules/>
15
+ <buildCSSFiles/>
16
+ </actionScriptProperties>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <actionScriptProperties mainApplicationPath="<%= project_name %>.mxml" version="3">
3
+ <compiler additionalCompilerArguments="-locale en_US -keep-as3-metadata+=Resource,HasOne,HasMany,BelongsTo,DateTime,Lazy,Ignored" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="bin-debug" sourceFolderPath="app/flex" strict="true" useApolloConfig="true" verifyDigests="true" warn="true">
4
+ <compilerSourcePath/>
5
+ <libraryPath defaultLinkType="1">
6
+ <libraryPathEntry kind="4" path=""/>
7
+ <libraryPathEntry kind="1" linkType="1" path="lib"/>
8
+ </libraryPath>
9
+ <sourceAttachmentPath/>
10
+ </compiler>
11
+ <applications>
12
+ <application path="<%= project_name %>.mxml"/>
13
+ </applications>
14
+ <modules/>
15
+ <buildCSSFiles/>
16
+ </actionScriptProperties>
@@ -0,0 +1,12 @@
1
+ application: <%= project_name.downcase %>
2
+ version: 1
3
+ runtime: python
4
+ api_version: 1
5
+
6
+ handlers:
7
+ - url: /public
8
+ static_dir: public
9
+ - url: .*
10
+ script: main.py
11
+
12
+
@@ -0,0 +1,51 @@
1
+ # this will use the latest version of restfulx gem
2
+ require 'restfulx/tasks'
3
+
4
+ TEST_APP_NAME = 'TestApp.mxml'
5
+
6
+ namespace :air do
7
+ desc "Build and run the AIR application"
8
+ task :run => ["rx:air:build", "rx:air:run"]
9
+ end
10
+
11
+ namespace :flex do
12
+ desc "Test flex application"
13
+ task :test => ["rx:test:build", "rx:test:run"]
14
+
15
+ desc "Build flex application"
16
+ task :build do
17
+ libs = [] # you can add libraries that are not in lib folder here
18
+ compile_app(get_executable('mxmlc'), 'bin-debug', "-library-path+=#{libs.join(',')}")
19
+ end
20
+ end
21
+
22
+ namespace :rx do
23
+ namespace :test do
24
+ desc "Build flex test swf file"
25
+ task :build do
26
+ project_path = File.join(APP_ROOT, "app/flex", TEST_APP_NAME)
27
+
28
+ libs = Dir.glob(File.join(APP_ROOT, 'lib', '*.swc'))
29
+ #libs << 'foobar' # you can add libraries that not in lib folder here
30
+
31
+ target_project_path = File.join(APP_ROOT, "bin-debug", TEST_APP_NAME.sub(/.mxml$/, '.swf'))
32
+
33
+ cmd = "#{get_executable('mxmlc')} +configname=air -library-path+=#{libs.join(',')} " <<
34
+ "-output #{target_project_path} -debug=true #{project_path}"
35
+
36
+ if !system("#{cmd}")
37
+ puts "failed to compile test application"
38
+ end
39
+ end
40
+
41
+ desc "Run flex test application"
42
+ task :run do
43
+ project_path = File.join(APP_ROOT, "app/flex", TEST_APP_NAME)
44
+ target_project_air_descriptor = project_path.sub(/.mxml$/, '-app.xml')
45
+
46
+ if !system("#{get_executable('adl')} #{target_project_air_descriptor} #{APP_ROOT}")
47
+ puts "failed to run test application"
48
+ end
49
+ end
50
+ end
51
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+ require 'activesupport'
12
+ require 'restfulx'
13
+
14
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
15
+
16
+ RubiGen::Base.use_component_sources!
17
+ RubiGen::Scripts::Generate.new.run(ARGV)