ruboss4ruby 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/Generators +5 -0
  2. data/Manifest.txt +39 -41
  3. data/Rakefile +2 -1
  4. data/lib/ruboss4ruby.rb +16 -12
  5. data/lib/ruboss4ruby/active_foo.rb +39 -3
  6. data/lib/ruboss4ruby/recipes.rb +62 -0
  7. data/lib/ruboss4ruby/ruboss_helper.rb +54 -0
  8. data/lib/ruboss4ruby/ruboss_test_helpers.rb +31 -0
  9. data/lib/ruboss4ruby/tasks.rb +0 -2
  10. data/lib/ruboss4ruby/version.rb +2 -2
  11. data/merb_generators/ruboss_config.rb +19 -19
  12. data/merb_generators/ruboss_controller.rb +3 -3
  13. data/merb_generators/ruboss_flex_app.rb +3 -3
  14. data/merb_generators/ruboss_resource_controller.rb +3 -3
  15. data/merb_generators/ruboss_scaffold.rb +47 -47
  16. data/rails_generators/ruboss_config/ruboss_config_generator.rb +2 -2
  17. data/rails_generators/ruboss_config/templates/index.html.erb +2 -2
  18. data/rails_generators/ruboss_config/templates/mainapp-config.xml +21 -0
  19. data/rails_generators/ruboss_config/templates/mainapp.mxml +4 -7
  20. data/rails_generators/ruboss_config/templates/project-textmate.erb +52 -0
  21. data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +0 -2
  22. data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -2
  23. data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +4 -3
  24. data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -1
  25. data/test/controllers/application.rb +15 -0
  26. data/test/controllers/locations_controller.rb +93 -0
  27. data/test/controllers/notes_controller.rb +96 -0
  28. data/test/controllers/projects_controller.rb +93 -0
  29. data/test/controllers/tasks_controller.rb +93 -0
  30. data/test/controllers/users_controller.rb +93 -0
  31. data/test/database.yml +4 -0
  32. data/test/fixtures/locations.yml +8 -0
  33. data/test/fixtures/notes.yml +17 -0
  34. data/test/fixtures/projects.yml +25 -0
  35. data/test/fixtures/tasks.yml +46 -0
  36. data/test/fixtures/users.yml +13 -0
  37. data/test/helpers/controllers.log +8 -0
  38. data/test/helpers/functional_test_helper.rb +32 -0
  39. data/test/helpers/models.log +170 -0
  40. data/test/helpers/test_helper.rb +25 -0
  41. data/test/helpers/unit_test_helper.rb +23 -0
  42. data/test/model.yml +35 -0
  43. data/test/models/location.rb +4 -0
  44. data/test/models/note.rb +3 -0
  45. data/test/models/project.rb +6 -0
  46. data/test/models/task.rb +20 -0
  47. data/test/models/user.rb +23 -0
  48. data/test/playing_around_in_a_console.txt +71 -0
  49. data/test/schema.rb +63 -0
  50. data/test/test.sqlite3 +0 -0
  51. data/test/test.swf +1 -0
  52. data/test/test_active_foo.rb +79 -0
  53. data/test/test_ruboss_rails_integration_functional.rb +27 -0
  54. data/test/test_swfobject_helper.rb +63 -0
  55. data/test/to_fxml_test.rb +79 -0
  56. data/test/views/notes/empty_params_action.html.erb +1 -0
  57. data/test/views/notes/index.html.erb +1 -0
  58. metadata +57 -52
  59. data/merb_generators/ruboss_config/USAGE +0 -18
  60. data/merb_generators/ruboss_config/ruboss_config_generator.rb +0 -135
  61. data/merb_generators/ruboss_config/templates/actionscript.properties +0 -16
  62. data/merb_generators/ruboss_config/templates/actionscriptair.properties +0 -16
  63. data/merb_generators/ruboss_config/templates/expressInstall.swf +0 -0
  64. data/merb_generators/ruboss_config/templates/flex.properties +0 -2
  65. data/merb_generators/ruboss_config/templates/html-template/AC_OETags.js +0 -276
  66. data/merb_generators/ruboss_config/templates/html-template/history/history.css +0 -6
  67. data/merb_generators/ruboss_config/templates/html-template/history/history.js +0 -645
  68. data/merb_generators/ruboss_config/templates/html-template/history/historyFrame.html +0 -29
  69. data/merb_generators/ruboss_config/templates/html-template/index.template.html +0 -121
  70. data/merb_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
  71. data/merb_generators/ruboss_config/templates/index.html.erb +0 -18
  72. data/merb_generators/ruboss_config/templates/mainair-app.xml +0 -134
  73. data/merb_generators/ruboss_config/templates/mainapp.mxml +0 -34
  74. data/merb_generators/ruboss_config/templates/project.properties +0 -18
  75. data/merb_generators/ruboss_config/templates/projectair.properties +0 -24
  76. data/merb_generators/ruboss_config/templates/swfobject.js +0 -5
  77. data/merb_generators/ruboss_controller/USAGE +0 -11
  78. data/merb_generators/ruboss_controller/ruboss_controller_generator.rb +0 -32
  79. data/merb_generators/ruboss_resource_controller/USAGE +0 -5
  80. data/merb_generators/ruboss_resource_controller/ruboss_resource_controller_generator.rb +0 -70
  81. data/merb_generators/ruboss_resource_controller/templates/app/controllers/%controller_file_name%.rb +0 -55
  82. data/merb_generators/ruboss_resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +0 -16
  83. data/merb_generators/ruboss_scaffold/USAGE +0 -5
  84. data/merb_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -127
  85. data/merb_generators/ruboss_yaml_scaffold/USAGE +0 -5
  86. data/merb_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -53
  87. data/merb_generators/templates/ruboss_scaffold/component.mxml.erb +0 -148
  88. data/merb_generators/templates/ruboss_scaffold/fixtures.yml.erb +0 -35
  89. data/merb_generators/templates/ruboss_scaffold/migration.rb.erb +0 -19
  90. data/merb_generators/templates/ruboss_scaffold/model.as.erb +0 -42
  91. data/merb_generators/templates/ruboss_scaffold/model.rb.erb +0 -11
  92. data/test/active_foo_test.rb +0 -16
  93. data/test/test_generator_helper.rb +0 -29
  94. data/test/test_helper.rb +0 -2
  95. data/test/test_ruboss_config_generator.rb +0 -45
  96. data/test/test_ruboss_controller_generator.rb +0 -45
  97. data/test/test_ruboss_on_ruby.rb +0 -11
  98. data/test/test_ruboss_scaffold_generator.rb +0 -45
  99. data/test/test_ruboss_yaml_scaffold_generator.rb +0 -46
@@ -1,35 +0,0 @@
1
- # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
-
3
- <% unless attributes.empty? && belongs_tos.empty? -%>
4
- <%= class_name.underscore -%>_one:
5
- <% for attribute in attributes -%>
6
- <%= attribute.name %>: <%= attribute.default("#{class_name}1") %>
7
- <% end -%>
8
- <% for model in belongs_tos -%>
9
- <%= model %>: <%= model %>_one
10
- <% end -%>
11
-
12
- <%= class_name.underscore -%>_two:
13
- <% for attribute in attributes -%>
14
- <%= attribute.name %>: <%= attribute.default("#{class_name}2") %>
15
- <% end -%>
16
- <% for model in belongs_tos -%>
17
- <%= model %>: <%= model %>_two
18
- <% end -%>
19
-
20
- <%= class_name.underscore -%>_three:
21
- <% for attribute in attributes -%>
22
- <%= attribute.name %>: <%= attribute.default("#{class_name}3") %>
23
- <% end -%>
24
- <% for model in belongs_tos -%>
25
- <%= model %>: <%= model %>_three
26
- <% end -%>
27
-
28
- <%= class_name.underscore -%>_four:
29
- <% for attribute in attributes -%>
30
- <%= attribute.name %>: <%= attribute.default("#{class_name}4") %>
31
- <% end -%>
32
- <% for model in belongs_tos -%>
33
- <%= model %>: <%= model %>_four
34
- <% end -%>
35
- <% end -%>
@@ -1,19 +0,0 @@
1
- class <%= migration_name %> < ActiveRecord::Migration
2
- def self.up
3
- create_table :<%= table_name %> do |t|
4
- <% for attribute in attributes -%>
5
- t.<%= attribute.type %> :<%= attribute.name %>
6
- <% end -%>
7
- <% for model in belongs_tos -%>
8
- t.references :<%= model %>
9
- <% end -%>
10
- <% unless options[:skip_timestamps] %>
11
- t.timestamps
12
- <% end -%>
13
- end
14
- end
15
-
16
- def self.down
17
- drop_table :<%= table_name %>
18
- end
19
- end
@@ -1,42 +0,0 @@
1
- package <%= base_package %>.models {
2
- <% if has_manies.length > 0 -%>
3
- import org.ruboss.models.ModelsCollection;
4
- <% end -%>
5
- import org.ruboss.models.RubossModel;
6
-
7
- [Resource(name="<%= resource_controller_name %>")]
8
- [Bindable]
9
- public class <%= class_name %> extends RubossModel {
10
- <% if attributes && !attributes.empty? && attributes[0].flex_type != "Boolean" -%>
11
- public static const LABEL:String = "<%= attributes[0].flex_name %>";
12
- <% else -%>
13
- public static const LABEL:String = "id";
14
- <% end -%>
15
-
16
- <% for attribute in attributes -%>
17
- <% if attribute.type == :datetime || attribute.type == :time -%>
18
- [DateTime]
19
- <% end -%>
20
- public var <%= attribute.flex_name %>:<%= attribute.flex_type %>;
21
-
22
- <% end -%>
23
- <% for model in belongs_tos -%>
24
- [BelongsTo]
25
- public var <%= model.camelcase(:lower) %>:<%= model.camelcase %>;
26
-
27
- <% end -%>
28
- <% for model in has_ones -%>
29
- [HasOne]
30
- public var <%= model.camelcase(:lower) %>:<%= model.camelcase %>;
31
-
32
- <% end -%>
33
- <% for model in has_manies -%>
34
- [HasMany]
35
- public var <%= model.camelcase(:lower) %>:ModelsCollection;
36
-
37
- <% end -%>
38
- public function <%= class_name %>() {
39
- super(LABEL);
40
- }
41
- }
42
- }
@@ -1,11 +0,0 @@
1
- class <%= class_name %> < ActiveRecord::Base
2
- <% for model in belongs_tos -%>
3
- belongs_to :<%= model %>
4
- <% end -%>
5
- <% for model in has_ones -%>
6
- has_one :<%= model %>
7
- <% end -%>
8
- <% for model in has_manies -%>
9
- has_many :<%= model %>
10
- <% end -%>
11
- end
@@ -1,16 +0,0 @@
1
- require 'test/unit'
2
- require 'rubygems'
3
- require 'action_controller'
4
- require 'active_support'
5
- require 'active_record'
6
- require File.join(File.dirname(__FILE__), '..', 'lib', 'ruboss4ruby', 'active_foo')
7
-
8
- class ActiveFooTest < Test::Unit::TestCase
9
-
10
- def test_to_fxml_with_args_on_empty_array_should_not_blow_up
11
- a = ClassyEmptyArray.new(Object)
12
- assert_nothing_raised {a.to_fxml}
13
- assert_nothing_raised {a.to_fxml(:include => :test)}
14
- end
15
-
16
- end
@@ -1,29 +0,0 @@
1
- begin
2
- require File.dirname(__FILE__) + '/test_helper'
3
- rescue LoadError
4
- require 'test/unit'
5
- end
6
- require 'fileutils'
7
-
8
- # Must set before requiring generator libs.
9
- TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
10
- PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME)
11
- app_root = File.join(TMP_ROOT, PROJECT_NAME)
12
- if defined?(APP_ROOT)
13
- APP_ROOT.replace(app_root)
14
- else
15
- APP_ROOT = app_root
16
- end
17
- if defined?(RAILS_ROOT)
18
- RAILS_ROOT.replace(app_root)
19
- else
20
- RAILS_ROOT = app_root
21
- end
22
-
23
- begin
24
- require 'rubigen'
25
- rescue LoadError
26
- require 'rubygems'
27
- require 'rubigen'
28
- end
29
- require 'rubigen/helpers/generator_test_helper'
data/test/test_helper.rb DELETED
@@ -1,2 +0,0 @@
1
- require 'test/unit'
2
- require File.dirname(__FILE__) + '/../lib/ruboss4ruby'
@@ -1,45 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
-
3
- require 'rails_generator'
4
-
5
- class TestRubossConfigGenerator < Test::Unit::TestCase
6
- include RubiGen::GeneratorTestHelper
7
-
8
- def setup
9
- bare_setup
10
- end
11
-
12
- def teardown
13
- bare_teardown
14
- end
15
-
16
- # Some generator-related assertions:
17
- # assert_generated_file(name, &block) # block passed the file contents
18
- # assert_directory_exists(name)
19
- # assert_generated_class(name, &block)
20
- # assert_generated_module(name, &block)
21
- # assert_generated_test_for(name, &block)
22
- # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
23
- # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
24
- #
25
- # Other helper methods are:
26
- # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
27
- # bare_setup - place this in setup method to create the APP_ROOT folder for each test
28
- # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
29
-
30
- def test_generator_without_options
31
- name = "myapp"
32
- run_generator('ruboss_config', [name], sources)
33
- assert_generated_file("some_file")
34
- end
35
-
36
- private
37
- def sources
38
- [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
39
- ]
40
- end
41
-
42
- def generator_path
43
- "rails_generators"
44
- end
45
- end
@@ -1,45 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
-
3
- require 'rails_generator'
4
-
5
- class TestRubossControllerGenerator < Test::Unit::TestCase
6
- include RubiGen::GeneratorTestHelper
7
-
8
- def setup
9
- bare_setup
10
- end
11
-
12
- def teardown
13
- bare_teardown
14
- end
15
-
16
- # Some generator-related assertions:
17
- # assert_generated_file(name, &block) # block passed the file contents
18
- # assert_directory_exists(name)
19
- # assert_generated_class(name, &block)
20
- # assert_generated_module(name, &block)
21
- # assert_generated_test_for(name, &block)
22
- # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
23
- # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
24
- #
25
- # Other helper methods are:
26
- # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
27
- # bare_setup - place this in setup method to create the APP_ROOT folder for each test
28
- # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
29
-
30
- def test_generator_without_options
31
- name = "myapp"
32
- run_generator('ruboss_controller', [name], sources)
33
- assert_generated_file("some_file")
34
- end
35
-
36
- private
37
- def sources
38
- [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
39
- ]
40
- end
41
-
42
- def generator_path
43
- "rails_generators"
44
- end
45
- end
@@ -1,11 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
2
-
3
- class TestRuboss < Test::Unit::TestCase
4
-
5
- def setup
6
- end
7
-
8
- def test_truth
9
- assert true
10
- end
11
- end
@@ -1,45 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
-
3
- require 'rails_generator'
4
-
5
- class TestRubossScaffoldGenerator < Test::Unit::TestCase
6
- include RubiGen::GeneratorTestHelper
7
-
8
- def setup
9
- bare_setup
10
- end
11
-
12
- def teardown
13
- bare_teardown
14
- end
15
-
16
- # Some generator-related assertions:
17
- # assert_generated_file(name, &block) # block passed the file contents
18
- # assert_directory_exists(name)
19
- # assert_generated_class(name, &block)
20
- # assert_generated_module(name, &block)
21
- # assert_generated_test_for(name, &block)
22
- # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
23
- # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
24
- #
25
- # Other helper methods are:
26
- # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
27
- # bare_setup - place this in setup method to create the APP_ROOT folder for each test
28
- # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
29
-
30
- def test_generator_without_options
31
- name = "myapp"
32
- run_generator('ruboss_scaffold', [name], sources)
33
- assert_generated_file("some_file")
34
- end
35
-
36
- private
37
- def sources
38
- [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
39
- ]
40
- end
41
-
42
- def generator_path
43
- "rails_generators"
44
- end
45
- end
@@ -1,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
-
3
- require 'merb-core'
4
- require 'merb-gen'
5
-
6
- class TestRubossYamlScaffoldGenerator < Test::Unit::TestCase
7
- include RubiGen::GeneratorTestHelper
8
-
9
- def setup
10
- bare_setup
11
- end
12
-
13
- def teardown
14
- bare_teardown
15
- end
16
-
17
- # Some generator-related assertions:
18
- # assert_generated_file(name, &block) # block passed the file contents
19
- # assert_directory_exists(name)
20
- # assert_generated_class(name, &block)
21
- # assert_generated_module(name, &block)
22
- # assert_generated_test_for(name, &block)
23
- # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
24
- # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
25
- #
26
- # Other helper methods are:
27
- # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
28
- # bare_setup - place this in setup method to create the APP_ROOT folder for each test
29
- # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
30
-
31
- def test_generator_without_options
32
- name = "myapp"
33
- run_generator('ruboss_yaml_scaffold', [name], sources)
34
- assert_generated_file("some_file")
35
- end
36
-
37
- private
38
- def sources
39
- [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
40
- ]
41
- end
42
-
43
- def generator_path
44
- "merb_generators"
45
- end
46
- end