restfulx 1.2.0
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.
- data/History.txt +7 -0
- data/Manifest.txt +127 -0
- data/README.rdoc +50 -0
- data/Rakefile +42 -0
- data/app_generators/rx_app/USAGE +22 -0
- data/app_generators/rx_app/rx_app_generator.rb +94 -0
- data/app_generators/rx_app/templates/actionscript.properties +16 -0
- data/app_generators/rx_app/templates/actionscriptair.properties +16 -0
- data/app_generators/rx_app/templates/app.yaml.erb +12 -0
- data/app_generators/rx_app/templates/default_tasks.rake +51 -0
- data/app_generators/rx_app/templates/empty.txt +0 -0
- data/app_generators/rx_app/templates/expressInstall.swf +0 -0
- data/app_generators/rx_app/templates/flex.properties +2 -0
- data/app_generators/rx_app/templates/generate.rb +17 -0
- data/app_generators/rx_app/templates/html-template/AC_OETags.js +276 -0
- data/app_generators/rx_app/templates/html-template/history/history.css +6 -0
- data/app_generators/rx_app/templates/html-template/history/history.js +645 -0
- data/app_generators/rx_app/templates/html-template/history/historyFrame.html +29 -0
- data/app_generators/rx_app/templates/html-template/index.template.html +121 -0
- data/app_generators/rx_app/templates/html-template/playerProductInstall.swf +0 -0
- data/app_generators/rx_app/templates/index.html.erb +18 -0
- data/app_generators/rx_app/templates/index.yaml +11 -0
- data/app_generators/rx_app/templates/mainair-app.xml +134 -0
- data/app_generators/rx_app/templates/mainapp-config.xml +21 -0
- data/app_generators/rx_app/templates/mainapp.mxml +31 -0
- data/app_generators/rx_app/templates/project-textmate.erb +52 -0
- data/app_generators/rx_app/templates/project.properties +18 -0
- data/app_generators/rx_app/templates/projectair.properties +24 -0
- data/app_generators/rx_app/templates/swfobject.js +5 -0
- data/bin/rx-gen +31 -0
- data/generators/rx_config/USAGE +5 -0
- data/generators/rx_config/rx_config_generator.rb +19 -0
- data/generators/rx_controller/USAGE +10 -0
- data/generators/rx_controller/rx_controller_generator.rb +39 -0
- data/generators/rx_controller/templates/assist.py +65 -0
- data/generators/rx_controller/templates/controller.as.erb +36 -0
- data/generators/rx_controller/templates/restful.py +136 -0
- data/generators/rx_main_app/USAGE +8 -0
- data/generators/rx_main_app/rx_main_app_generator.rb +60 -0
- data/generators/rx_main_app/templates/main.py.erb +29 -0
- data/generators/rx_main_app/templates/mainapp.mxml +35 -0
- data/generators/rx_scaffold/USAGE +29 -0
- data/generators/rx_scaffold/rx_scaffold_generator.rb +146 -0
- data/generators/rx_scaffold/templates/component.mxml.erb +149 -0
- data/generators/rx_scaffold/templates/controller.py.erb +27 -0
- data/generators/rx_scaffold/templates/model.as.erb +42 -0
- data/generators/rx_scaffold/templates/model.py.erb +14 -0
- data/generators/rx_yaml_scaffold/USAGE +45 -0
- data/generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +47 -0
- data/lib/restfulx/active_foo.rb +186 -0
- data/lib/restfulx/active_record_tasks.rb +81 -0
- data/lib/restfulx/configuration.rb +76 -0
- data/lib/restfulx/datamapper_foo.rb +31 -0
- data/lib/restfulx/rails/recipes.rb +60 -0
- data/lib/restfulx/rails/swf_helper.rb +60 -0
- data/lib/restfulx/tasks.rb +85 -0
- data/lib/restfulx.rb +117 -0
- data/rails_generators/rx_config/USAGE +18 -0
- data/rails_generators/rx_config/rx_config_generator.rb +115 -0
- data/rails_generators/rx_config/templates/actionscript.properties +16 -0
- data/rails_generators/rx_config/templates/actionscriptair.properties +16 -0
- data/rails_generators/rx_config/templates/expressInstall.swf +0 -0
- data/rails_generators/rx_config/templates/flex.properties +2 -0
- data/rails_generators/rx_config/templates/html-template/AC_OETags.js +276 -0
- data/rails_generators/rx_config/templates/html-template/history/history.css +6 -0
- data/rails_generators/rx_config/templates/html-template/history/history.js +645 -0
- data/rails_generators/rx_config/templates/html-template/history/historyFrame.html +29 -0
- data/rails_generators/rx_config/templates/html-template/index.template.html +121 -0
- data/rails_generators/rx_config/templates/html-template/playerProductInstall.swf +0 -0
- data/rails_generators/rx_config/templates/index.html.erb +18 -0
- data/rails_generators/rx_config/templates/mainair-app.xml +134 -0
- data/rails_generators/rx_config/templates/mainapp-config.xml +21 -0
- data/rails_generators/rx_config/templates/mainapp.mxml +31 -0
- data/rails_generators/rx_config/templates/project-textmate.erb +52 -0
- data/rails_generators/rx_config/templates/project.properties +18 -0
- data/rails_generators/rx_config/templates/projectair.properties +24 -0
- data/rails_generators/rx_config/templates/restfulx.yml +14 -0
- data/rails_generators/rx_config/templates/restfulx_tasks.rake +6 -0
- data/rails_generators/rx_config/templates/swfobject.js +5 -0
- data/rails_generators/rx_controller/USAGE +10 -0
- data/rails_generators/rx_controller/rx_controller_generator.rb +28 -0
- data/rails_generators/rx_controller/templates/controller.as.erb +40 -0
- data/rails_generators/rx_scaffold/USAGE +35 -0
- data/rails_generators/rx_scaffold/rx_scaffold_generator.rb +179 -0
- data/rails_generators/rx_scaffold/templates/component.mxml.erb +149 -0
- data/rails_generators/rx_scaffold/templates/controller.rb.erb +97 -0
- data/rails_generators/rx_scaffold/templates/fixtures.yml.erb +35 -0
- data/rails_generators/rx_scaffold/templates/migration.rb.erb +19 -0
- data/rails_generators/rx_scaffold/templates/model.as.erb +42 -0
- data/rails_generators/rx_scaffold/templates/model.rb.erb +11 -0
- data/rails_generators/rx_yaml_scaffold/USAGE +51 -0
- data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +49 -0
- data/rdoc/generators/template/html/jamis.rb +588 -0
- data/spec/restfulx_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- data/tasks/ann.rake +80 -0
- data/tasks/bones.rake +20 -0
- data/tasks/gem.rake +201 -0
- data/tasks/git.rake +40 -0
- data/tasks/manifest.rake +48 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +50 -0
- data/tasks/rubyforge.rake +55 -0
- data/tasks/setup.rb +279 -0
- data/tasks/spec.rake +54 -0
- data/tasks/svn.rake +47 -0
- data/tasks/test.rake +40 -0
- data/test/rails/controllers/application.rb +15 -0
- data/test/rails/controllers/locations_controller.rb +93 -0
- data/test/rails/controllers/notes_controller.rb +96 -0
- data/test/rails/controllers/projects_controller.rb +93 -0
- data/test/rails/controllers/tasks_controller.rb +93 -0
- data/test/rails/controllers/users_controller.rb +93 -0
- data/test/rails/database.yml +4 -0
- data/test/rails/fixtures/locations.yml +8 -0
- data/test/rails/fixtures/notes.yml +17 -0
- data/test/rails/fixtures/projects.yml +25 -0
- data/test/rails/fixtures/simple_properties.yml +19 -0
- data/test/rails/fixtures/tasks.yml +46 -0
- data/test/rails/fixtures/users.yml +13 -0
- data/test/rails/helpers/functional_test_helper.rb +21 -0
- data/test/rails/helpers/test_helper.rb +61 -0
- data/test/rails/helpers/unit_test_helper.rb +30 -0
- data/test/rails/model.yml +35 -0
- data/test/rails/models/location.rb +4 -0
- data/test/rails/models/note.rb +3 -0
- data/test/rails/models/project.rb +4 -0
- data/test/rails/models/simple_property.rb +2 -0
- data/test/rails/models/task.rb +18 -0
- data/test/rails/models/user.rb +20 -0
- data/test/rails/playing_around_in_a_console.txt +71 -0
- data/test/rails/schema.rb +77 -0
- data/test/rails/test.swf +1 -0
- data/test/rails/test_active_foo.rb +36 -0
- data/test/rails/test_rails_integration_functional.rb +22 -0
- data/test/rails/test_to_fxml.rb +35 -0
- data/test/rails/test_to_json.rb +23 -0
- data/test/rails/views/notes/empty_params_action.html.erb +1 -0
- data/test/rails/views/notes/index.html.erb +1 -0
- metadata +227 -0
data/History.txt
ADDED
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://restfulx.org
|
|
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,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
|
|
Binary file
|
|
@@ -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)
|