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
@@ -0,0 +1,13 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ ludwig:
4
+ login: ludwig
5
+ first_name: Ludwig
6
+ last_name: van Beethoven
7
+ email: ludwig@vienna.de
8
+
9
+ shakespeare:
10
+ login: william
11
+ first_name: William
12
+ last_name: Shakespeare
13
+ email: will@theglobetheater.com
@@ -0,0 +1,8 @@
1
+ # Logfile created on Thu Oct 16 14:02:21 -0700 2008 by /
2
+
3
+
4
+ Processing NotesController#empty_params_action (for 0.0.0.0 at 2008-10-16 14:02:22) [GET]
5
+ Session ID:
6
+ Parameters: {"action"=>"empty_params_action", "controller"=>"notes"}
7
+ Rendering notes/empty_params_action
8
+ Completed in 0.00249 (401 reqs/sec) | Rendering: 0.00061 (24%) | DB: 0.08283 (3327%) | 200 OK [http://test.host/notes/empty_params_action]
@@ -0,0 +1,32 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../..')
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ schema_file = File.join(File.dirname(__FILE__), '..', 'schema.rb')
4
+ ENV["RAILS_ENV"] = "test"
5
+
6
+ require File.join(File.dirname(__FILE__), '..', 'controllers', 'application')
7
+ require File.join(File.dirname(__FILE__), '..', 'controllers', 'notes_controller')
8
+
9
+
10
+ config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))['test']
11
+ puts "config:\n#{config.inspect}"
12
+ ActiveRecord::Base.configurations = config
13
+ ActiveRecord::Base.establish_connection(config)
14
+
15
+ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/models.log")
16
+ ActionController::Base.logger = Logger.new(File.dirname(__FILE__) + "/controllers.log")
17
+ ApplicationController.append_view_path File.join(File.dirname(__FILE__), '..', 'views')
18
+
19
+ load(schema_file) if File.exist?(schema_file)
20
+
21
+ Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
22
+ $:.unshift(Test::Unit::TestCase.fixture_path)
23
+
24
+ class Test::Unit::TestCase
25
+ # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
26
+ self.use_transactional_fixtures = true
27
+
28
+ # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
29
+ self.use_instantiated_fixtures = true
30
+
31
+ # Add more helper methods to be used by all tests here...
32
+ end
@@ -0,0 +1,170 @@
1
+ # Logfile created on Thu Oct 16 14:02:21 -0700 2008 by /
2
+ SQL (0.000136) select sqlite_version(*)
3
+ SQL (0.000544)  SELECT name
4
+ FROM sqlite_master
5
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
6
+ 
7
+ SQL (0.003489) DROP TABLE "locations"
8
+ SQL (0.003352) CREATE TABLE "locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
9
+ SQL (0.000528)  SELECT name
10
+ FROM sqlite_master
11
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
12
+ 
13
+ SQL (0.002767) DROP TABLE "notes"
14
+ SQL (0.003052) CREATE TABLE "notes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
15
+ SQL (0.000524)  SELECT name
16
+ FROM sqlite_master
17
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
18
+ 
19
+ SQL (0.002682) DROP TABLE "projects"
20
+ SQL (0.002528) CREATE TABLE "projects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "start_date" date, "end_date" date, "completed" boolean, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
21
+ SQL (0.000469)  SELECT name
22
+ FROM sqlite_master
23
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
24
+ 
25
+ SQL (0.002171) DROP TABLE "tasks"
26
+ SQL (0.002067) CREATE TABLE "tasks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "start_time" datetime, "end_time" datetime, "completed" boolean, "next_action" boolean, "project_id" integer, "location_id" integer, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
27
+ SQL (0.000519)  SELECT name
28
+ FROM sqlite_master
29
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
30
+ 
31
+ SQL (0.002239) DROP TABLE "users"
32
+ SQL (0.002673) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "login" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "email" varchar(255), "created_at" datetime, "updated_at" datetime) 
33
+ SQL (0.000588)  SELECT name
34
+ FROM sqlite_master
35
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
36
+ 
37
+ SQL (0.000243) SELECT version FROM "schema_migrations"
38
+ Unable to load location, underlying cause no such file to load -- location.rb
39
+
40
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
41
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
42
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
43
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
44
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
45
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
46
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
47
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
48
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
49
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
50
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
51
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
52
+ ./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
53
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
54
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
55
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
56
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
57
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
58
+ -e:1
59
+ Unable to load note, underlying cause no such file to load -- note.rb
60
+
61
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
62
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
63
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
64
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
65
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
66
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
67
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
68
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
69
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
70
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
71
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
72
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
73
+ ./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
74
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
75
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
76
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
77
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
78
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
79
+ -e:1
80
+ Unable to load project, underlying cause no such file to load -- project.rb
81
+
82
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
83
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
84
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
85
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
86
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
87
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
88
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
89
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
90
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
91
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
92
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
93
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
94
+ ./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
95
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
96
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
97
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
98
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
99
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
100
+ -e:1
101
+ Unable to load task, underlying cause no such file to load -- task.rb
102
+
103
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
104
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
105
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
106
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
107
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
108
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
109
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
110
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
111
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
112
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
113
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
114
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
115
+ ./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
116
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
117
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
118
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
119
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
120
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
121
+ -e:1
122
+ Unable to load user, underlying cause no such file to load -- user.rb
123
+
124
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
125
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
126
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
127
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
128
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
129
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
130
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
131
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
132
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
133
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
134
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
135
+ /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
136
+ ./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
137
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
138
+ /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
139
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
140
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
141
+ /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
142
+ -e:1
143
+ User Load (0.000228) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
144
+ User Load (0.000159) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
145
+ Project Load (0.000184) SELECT * FROM "projects" WHERE ("projects"."id" = 342996156) 
146
+ Task Load (0.000347) SELECT * FROM "tasks" WHERE ("tasks".project_id = 342996156) 
147
+ User Load (0.000156) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
148
+ Project Load (0.000179) SELECT * FROM "projects" WHERE ("projects"."id" = 342996156) 
149
+ User Load (0.000169) SELECT * FROM "users" WHERE ("users"."id" = 875057608) 
150
+ Task Load (0.000322) SELECT * FROM "tasks" WHERE ("tasks".project_id = 342996156) 
151
+ User Load (0.000159) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
152
+ Task Load (0.000216) SELECT * FROM "tasks" WHERE ("tasks"."id" = 121780552) 
153
+ User Load (0.000157) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
154
+ User Load (0.000160) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
155
+ User Load (0.000156) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
156
+ User Load (0.000168) SELECT * FROM "users" WHERE ("users"."id" = 875057608) 
157
+ Task Load (0.000728) SELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) 
158
+ Project Load (0.000314) SELECT * FROM "projects" WHERE ("projects".user_id = 875057608) 
159
+ User Load (0.000157) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
160
+ User Load (0.000161) SELECT * FROM "users" WHERE ("users"."id" = 875057608) 
161
+ Task Load (0.000514) SELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) 
162
+ Project Load (0.000296) SELECT * FROM "projects" WHERE ("projects".user_id = 875057608) 
163
+ User Load (0.000160) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
164
+ User Load (0.000163) SELECT * FROM "users" WHERE ("users"."id" = 875057608) 
165
+ Task Load (0.000504) SELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) 
166
+ Project Load (0.000280) SELECT * FROM "projects" WHERE ("projects".user_id = 875057608) 
167
+ User Load (0.000158) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
168
+ User Load (0.000158) SELECT * FROM "users" WHERE ("users"."id" = 22086222) 
169
+ Task Load (0.000346) SELECT * FROM "tasks" WHERE ("tasks".user_id = 22086222) 
170
+ Project Load (0.000295) SELECT * FROM "projects" WHERE ("projects".user_id = 22086222) 
@@ -0,0 +1,25 @@
1
+ require 'test/unit'
2
+ RAILS_ROOT = File.join(File.dirname(__FILE__), '..') unless defined? RAILS_ROOT
3
+ require 'rubygems'
4
+
5
+ require 'test/unit'
6
+ require 'active_support'
7
+ require 'active_support/test_case'
8
+ require 'active_record'
9
+ require 'active_record/fixtures'
10
+ require 'action_controller'
11
+ require 'action_controller/test_case'
12
+ require 'action_controller/assertions'
13
+ require 'action_controller/test_process'
14
+ require 'action_controller/integration'
15
+ require 'sqlite3'
16
+ require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'ruboss4ruby')
17
+ require File.join(File.dirname(__FILE__), '..', 'models', 'note')
18
+ require File.join(File.dirname(__FILE__), '..', 'models', 'user')
19
+ require File.join(File.dirname(__FILE__), '..', 'models', 'project')
20
+ require File.join(File.dirname(__FILE__), '..', 'models', 'location')
21
+ require File.join(File.dirname(__FILE__), '..', 'models', 'task')
22
+
23
+
24
+
25
+
@@ -0,0 +1,23 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../..')
2
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
3
+ schema_file = File.join(File.dirname(__FILE__), '..', 'schema.rb')
4
+
5
+
6
+ config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))[ENV['DB'] || 'test']
7
+ ActiveRecord::Base.configurations = config
8
+ ActiveRecord::Base.establish_connection(config)
9
+
10
+ load(schema_file) if File.exist?(schema_file)
11
+
12
+ Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
13
+ $:.unshift(Test::Unit::TestCase.fixture_path)
14
+
15
+ class Test::Unit::TestCase #:nodoc:
16
+ # Turn off transactional fixtures if you're working with MyISAM tables in MySQL
17
+ self.use_transactional_fixtures = true
18
+
19
+ # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
20
+ self.use_instantiated_fixtures = true
21
+
22
+ # Add more helper methods to be used by all tests here...
23
+ end
data/test/model.yml ADDED
@@ -0,0 +1,35 @@
1
+ project:
2
+ - name: string
3
+ - notes: text
4
+ - start_date: date
5
+ - end_date: date
6
+ - completed: boolean
7
+ - belongs_to: [user]
8
+ - has_many: [tasks]
9
+
10
+ location:
11
+ - name: string
12
+ - notes: text
13
+ - belongs_to: [user]
14
+ - has_many: [tasks]
15
+
16
+ task:
17
+ - name: string
18
+ - notes: text
19
+ - start_time: datetime
20
+ - end_time: datetime
21
+ - completed: boolean
22
+ - next_action: boolean
23
+ - belongs_to: [project, location, user]
24
+
25
+ note:
26
+ - content: text
27
+ - belongs_to: [user]
28
+
29
+ user:
30
+ - login: string
31
+ - first_name: string
32
+ - last_name: string
33
+ - email: string
34
+ - has_many: [tasks, projects, locations]
35
+ - has_one: [note]
@@ -0,0 +1,4 @@
1
+ class Location < ActiveRecord::Base
2
+ belongs_to :user
3
+ has_many :tasks
4
+ end
@@ -0,0 +1,3 @@
1
+ class Note < ActiveRecord::Base
2
+ belongs_to :user
3
+ end
@@ -0,0 +1,6 @@
1
+ class Project < ActiveRecord::Base
2
+ belongs_to :user
3
+ has_many :tasks
4
+
5
+ default_fxml_includes :tasks
6
+ end
@@ -0,0 +1,20 @@
1
+ class Task < ActiveRecord::Base
2
+ belongs_to :project
3
+ belongs_to :location
4
+ belongs_to :user
5
+
6
+ default_fxml_methods :is_active
7
+
8
+ def is_active
9
+ case
10
+ when start_time && end_time
11
+ (start_time .. end_time) === Time.now
12
+ when start_time && end_time.nil?
13
+ start_time <= Time.now
14
+ when start_time.nil && end_time
15
+ end_time >= Time.now
16
+ else
17
+ true
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ class User < ActiveRecord::Base
2
+ has_one :note
3
+ has_many :tasks
4
+ has_many :projects
5
+ has_many :locations
6
+
7
+ default_fxml_methods :full_name, :has_nothing_to_do
8
+ default_fxml_includes :tasks, :projects
9
+
10
+ validates_length_of :login, :maximum => 10
11
+
12
+ def full_name
13
+ "#{first_name} #{last_name}"
14
+ end
15
+
16
+ def has_nothing_to_do
17
+ tasks.all? {|task| task.completed}
18
+ end
19
+
20
+ def email_host
21
+ email.split('@').last
22
+ end
23
+ end
@@ -0,0 +1,71 @@
1
+ To play with the test models in a console, do this:
2
+
3
+ $> irb -r test/helpers/test_helper.rb -r test/helpers/unit_test_helper.rb
4
+
5
+ You can then do things like this:
6
+
7
+ $> irb -r test/helpers/test_helper.rb -r test/helpers/unit_test_helper.rb
8
+ -- create_table("locations", {:force=>true})
9
+ -> 0.0170s
10
+ -- create_table("notes", {:force=>true})
11
+ -> 0.0091s
12
+ -- create_table("projects", {:force=>true})
13
+ -> 0.0091s
14
+ -- create_table("tasks", {:force=>true})
15
+ -> 0.0098s
16
+ -- create_table("users", {:force=>true})
17
+ -> 0.0506s
18
+ -- initialize_schema_migrations_table()
19
+ -> 0.0010s
20
+ -- assume_migrated_upto_version(20080729045550)
21
+ -> 0.0009s
22
+ >> u = User.create(:login => 'spatten')
23
+ => #<User id: 1, login: "spatten", first_name: nil, last_name: nil, email: nil, created_at: "2008-10-15 17:29:36", updated_at: "2008-10-15 17:29:36">
24
+ >> u.tasks << Task.create
25
+ => [#<Task id: 1, name: nil, notes: nil, start_time: nil, end_time: nil, completed: nil, next_action: nil, project_id: nil, location_id: nil, user_id: 1, created_at: "2008-10-15 17:29:48", updated_at: "2008-10-15 17:29:48">]
26
+ >> u.projects << Project.create
27
+ => [#<Project id: 1, name: nil, notes: nil, start_date: nil, end_date: nil, completed: nil, user_id: 1, created_at: "2008-10-15 17:29:54", updated_at: "2008-10-15 17:29:54">]
28
+ >> puts u.to_fxml
29
+ <?xml version="1.0" encoding="UTF-8"?>
30
+ <user>
31
+ <created_at type="datetime">2008/10/15 17:29:36</created_at>
32
+ <email nil="true"></email>
33
+ <first_name nil="true"></first_name>
34
+ <id type="integer">1</id>
35
+ <last_name nil="true"></last_name>
36
+ <login>spatten</login>
37
+ <updated_at type="datetime">2008/10/15 17:29:36</updated_at>
38
+ <full_name> </full_name>
39
+ <has_nothing_to_do type="boolean">false</has_nothing_to_do>
40
+ <tasks type="array">
41
+ <task>
42
+ <completed type="boolean" nil="true"></completed>
43
+ <created_at type="datetime">2008/10/15 17:29:48</created_at>
44
+ <end_time type="datetime" nil="true"></end_time>
45
+ <id type="integer">1</id>
46
+ <location_id type="integer" nil="true"></location_id>
47
+ <name nil="true"></name>
48
+ <next_action type="boolean" nil="true"></next_action>
49
+ <notes nil="true"></notes>
50
+ <project_id type="integer" nil="true"></project_id>
51
+ <start_time type="datetime" nil="true"></start_time>
52
+ <updated_at type="datetime">2008/10/15 17:29:48</updated_at>
53
+ <user_id type="integer">1</user_id>
54
+ </task>
55
+ </tasks>
56
+ <projects type="array">
57
+ <project>
58
+ <completed type="boolean" nil="true"></completed>
59
+ <created_at type="datetime">2008/10/15 17:29:54</created_at>
60
+ <end_date type="date" nil="true"></end_date>
61
+ <id type="integer">1</id>
62
+ <name nil="true"></name>
63
+ <notes nil="true"></notes>
64
+ <start_date type="date" nil="true"></start_date>
65
+ <updated_at type="datetime">2008/10/15 17:29:54</updated_at>
66
+ <user_id type="integer">1</user_id>
67
+ </project>
68
+ </projects>
69
+ </user>
70
+ => nil
71
+ >>