dima-ruboss4ruby 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/History.txt +2 -3
  2. data/Manifest.txt +46 -37
  3. data/README.rdoc +12 -10
  4. data/Rakefile +37 -0
  5. data/app_generators/ruboss_app/USAGE +13 -0
  6. data/app_generators/ruboss_app/ruboss_app_generator.rb +88 -0
  7. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/actionscript.properties +1 -1
  8. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/actionscriptair.properties +0 -0
  9. data/app_generators/ruboss_app/templates/default_tasks.rake +51 -0
  10. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/expressInstall.swf +0 -0
  11. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/flex.properties +0 -0
  12. data/app_generators/ruboss_app/templates/generate.rb +21 -0
  13. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/AC_OETags.js +0 -0
  14. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.css +0 -0
  15. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/history.js +0 -0
  16. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/history/historyFrame.html +0 -0
  17. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/index.template.html +0 -0
  18. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/html-template/playerProductInstall.swf +0 -0
  19. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/index.html.erb +2 -2
  20. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/mainair-app.xml +3 -3
  21. data/app_generators/ruboss_app/templates/mainapp-config.xml +21 -0
  22. data/{merb_generators/templates/ruboss_flex_app → app_generators/ruboss_app/templates}/mainapp.mxml +6 -9
  23. data/app_generators/ruboss_app/templates/project-textmate.erb +52 -0
  24. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/project.properties +0 -0
  25. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/projectair.properties +0 -0
  26. data/{merb_generators/templates/ruboss_config → app_generators/ruboss_app/templates}/swfobject.js +0 -0
  27. data/bin/ruboss-gen +17 -0
  28. data/generators/ruboss_config/USAGE +5 -0
  29. data/generators/ruboss_config/ruboss_config_generator.rb +24 -0
  30. data/generators/ruboss_controller/USAGE +10 -0
  31. data/generators/ruboss_controller/ruboss_controller_generator.rb +34 -0
  32. data/{merb_generators/templates/ruboss_controller → generators/ruboss_controller/templates}/controller.as.erb +0 -4
  33. data/generators/ruboss_main_app/USAGE +8 -0
  34. data/generators/ruboss_main_app/ruboss_main_app_generator.rb +46 -0
  35. data/generators/ruboss_main_app/templates/mainapp.mxml +31 -0
  36. data/generators/ruboss_scaffold/USAGE +29 -0
  37. data/generators/ruboss_scaffold/ruboss_scaffold_generator.rb +117 -0
  38. data/generators/ruboss_scaffold/templates/component.mxml.erb +149 -0
  39. data/generators/ruboss_scaffold/templates/model.as.erb +42 -0
  40. data/generators/ruboss_yaml_scaffold/USAGE +7 -0
  41. data/generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +43 -0
  42. data/lib/ruboss4ruby/active_foo.rb +0 -64
  43. data/lib/ruboss4ruby/active_record_default_methods.rb +54 -0
  44. data/lib/ruboss4ruby/configuration.rb +13 -28
  45. data/lib/ruboss4ruby/datamapper_foo.rb +1 -1
  46. data/lib/ruboss4ruby/rails/recipes.rb +58 -0
  47. data/lib/ruboss4ruby/rails/swf_helper.rb +59 -0
  48. data/lib/ruboss4ruby/tasks.rb +1 -1
  49. data/lib/ruboss4ruby.rb +35 -15
  50. data/rails_generators/ruboss_config/ruboss_config_generator.rb +2 -2
  51. data/rails_generators/ruboss_config/templates/mainair-app.xml +2 -2
  52. data/rails_generators/ruboss_controller/USAGE +1 -2
  53. data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +1 -1
  54. data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +1 -1
  55. data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +69 -69
  56. data/rails_generators/ruboss_scaffold/templates/model.as.erb +1 -1
  57. data/ruboss4ruby.gemspec +43 -0
  58. data/spec/ruboss4ruby_spec.rb +7 -0
  59. data/spec/spec_helper.rb +16 -0
  60. data/test/rails/controllers/application.rb +15 -0
  61. data/test/rails/controllers/locations_controller.rb +93 -0
  62. data/test/rails/controllers/notes_controller.rb +96 -0
  63. data/test/rails/controllers/projects_controller.rb +93 -0
  64. data/test/rails/controllers/tasks_controller.rb +93 -0
  65. data/test/rails/controllers/users_controller.rb +93 -0
  66. data/test/rails/database.yml +4 -0
  67. data/test/rails/fixtures/locations.yml +8 -0
  68. data/test/rails/fixtures/notes.yml +17 -0
  69. data/test/rails/fixtures/projects.yml +25 -0
  70. data/test/rails/fixtures/simple_properties.yml +19 -0
  71. data/test/rails/fixtures/tasks.yml +46 -0
  72. data/test/rails/fixtures/users.yml +13 -0
  73. data/test/rails/helpers/functional_test_helper.rb +21 -0
  74. data/test/rails/helpers/test_helper.rb +61 -0
  75. data/test/rails/helpers/unit_test_helper.rb +30 -0
  76. data/test/rails/model.yml +35 -0
  77. data/test/rails/models/location.rb +4 -0
  78. data/test/rails/models/note.rb +3 -0
  79. data/test/rails/models/project.rb +4 -0
  80. data/test/rails/models/simple_property.rb +2 -0
  81. data/test/rails/models/task.rb +20 -0
  82. data/test/rails/models/user.rb +22 -0
  83. data/test/rails/playing_around_in_a_console.txt +71 -0
  84. data/test/rails/schema.rb +77 -0
  85. data/test/rails/test.swf +1 -0
  86. data/test/rails/test_active_foo.rb +81 -0
  87. data/test/rails/test_ruboss_rails_integration_functional.rb +22 -0
  88. data/test/rails/test_to_fxml.rb +77 -0
  89. data/test/rails/test_to_json.rb +23 -0
  90. data/test/rails/views/notes/empty_params_action.html.erb +1 -0
  91. data/test/rails/views/notes/index.html.erb +1 -0
  92. metadata +121 -92
  93. data/Generators +0 -7
  94. data/lib/ruboss4ruby/generated_attribute.rb +0 -61
  95. data/merb_generators/ruboss_config.rb +0 -103
  96. data/merb_generators/ruboss_controller.rb +0 -59
  97. data/merb_generators/ruboss_flex_app.rb +0 -67
  98. data/merb_generators/ruboss_resource.rb +0 -37
  99. data/merb_generators/ruboss_resource_controller.rb +0 -80
  100. data/merb_generators/ruboss_scaffold.rb +0 -157
  101. data/merb_generators/templates/ruboss_config/ruboss.yml +0 -16
  102. data/merb_generators/templates/ruboss_resource_controller/controller_ar.rb.erb +0 -49
  103. data/merb_generators/templates/ruboss_resource_controller/controller_dm.rb.erb +0 -46
  104. data/merb_generators/templates/ruboss_resource_controller/spec/controllers/%file_name%_spec.rb +0 -7
  105. data/merb_generators/templates/ruboss_resource_controller/spec/requests/%file_name%_spec.rb +0 -1
  106. data/merb_generators/templates/ruboss_resource_controller/test/controllers/%file_name%_test.rb +0 -17
@@ -0,0 +1,16 @@
1
+
2
+ require File.expand_path(
3
+ File.join(File.dirname(__FILE__), %w[.. lib ruboss4ruby]))
4
+
5
+ Spec::Runner.configure do |config|
6
+ # == Mock Framework
7
+ #
8
+ # RSpec uses it's own mocking framework by default. If you prefer to
9
+ # use mocha, flexmock or RR, uncomment the appropriate line:
10
+ #
11
+ # config.mock_with :mocha
12
+ # config.mock_with :flexmock
13
+ # config.mock_with :rr
14
+ end
15
+
16
+ # EOF
@@ -0,0 +1,15 @@
1
+ # Filters added to this controller apply to all controllers in the application.
2
+ # Likewise, all the methods added will be available for all controllers.
3
+
4
+ class ApplicationController < ActionController::Base
5
+ helper :all # include all helpers, all the time
6
+
7
+ # See ActionController::RequestForgeryProtection for details
8
+ # Uncomment the :secret if you're not using the cookie session store
9
+ protect_from_forgery # :secret => 'c83e3ff98f15718c4544ca8821f2b6d4'
10
+
11
+ # See ActionController::Base for details
12
+ # Uncomment this to filter the contents of submitted sensitive data parameters
13
+ # from your application log (in this case, all fields with names like "password").
14
+ # filter_parameter_logging :password
15
+ end
@@ -0,0 +1,93 @@
1
+ class LocationsController < ApplicationController
2
+ # GET /locations
3
+ # GET /locations.xml
4
+ def index
5
+ @locations = Location.find(:all)
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.xml { render :xml => @locations }
10
+ format.fxml { render :fxml => @locations }
11
+ end
12
+ end
13
+
14
+ # GET /locations/1
15
+ # GET /locations/1.xml
16
+ def show
17
+ @location = Location.find(params[:id])
18
+
19
+ respond_to do |format|
20
+ format.html # show.html.erb
21
+ format.xml { render :xml => @location }
22
+ format.fxml { render :fxml => @location }
23
+ end
24
+ end
25
+
26
+ # GET /locations/new
27
+ # GET /locations/new.xml
28
+ def new
29
+ @location = Location.new
30
+
31
+ respond_to do |format|
32
+ format.html # new.html.erb
33
+ format.xml { render :xml => @location }
34
+ format.fxml { render :fxml => @location }
35
+ end
36
+ end
37
+
38
+ # GET /locations/1/edit
39
+ def edit
40
+ @location = Location.find(params[:id])
41
+ end
42
+
43
+ # POST /locations
44
+ # POST /locations.xml
45
+ def create
46
+ @location = Location.new(params[:location])
47
+
48
+ respond_to do |format|
49
+ if @location.save
50
+ flash[:notice] = 'Location was successfully created.'
51
+ format.html { redirect_to(@location) }
52
+ format.xml { render :xml => @location, :status => :created, :location => @location }
53
+ format.fxml { render :fxml => @location }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
57
+ format.fxml { render :fxml => @location.errors }
58
+ end
59
+ end
60
+ end
61
+
62
+ # PUT /locations/1
63
+ # PUT /locations/1.xml
64
+ def update
65
+ @location = Location.find(params[:id])
66
+
67
+ respond_to do |format|
68
+ if @location.update_attributes(params[:location])
69
+ flash[:notice] = 'Location was successfully updated.'
70
+ format.html { redirect_to(@location) }
71
+ format.xml { head :ok }
72
+ format.fxml { render :fxml => @location }
73
+ else
74
+ format.html { render :action => "edit" }
75
+ format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
76
+ format.fxml { render :fxml => @location.errors }
77
+ end
78
+ end
79
+ end
80
+
81
+ # DELETE /locations/1
82
+ # DELETE /locations/1.xml
83
+ def destroy
84
+ @location = Location.find(params[:id])
85
+ @location.destroy
86
+
87
+ respond_to do |format|
88
+ format.html { redirect_to(locations_url) }
89
+ format.xml { head :ok }
90
+ format.fxml { render :fxml => @location }
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,96 @@
1
+ class NotesController < ApplicationController
2
+ # GET /notes
3
+ # GET /notes.xml
4
+ def index
5
+ @notes = Note.find(:all)
6
+ respond_to do |format|
7
+ format.html
8
+ format.xml { render :xml => @notes }
9
+ format.fxml { render :fxml => @notes }
10
+ end
11
+ end
12
+
13
+ # GET /notes/1
14
+ # GET /notes/1.xml
15
+ def show
16
+ @note = Note.find(params[:id])
17
+
18
+ respond_to do |format|
19
+ format.html # show.html.erb
20
+ format.xml { render :xml => @note }
21
+ format.fxml { render :fxml => @note }
22
+ end
23
+ end
24
+
25
+ # GET /notes/new
26
+ # GET /notes/new.xml
27
+ def new
28
+ @note = Note.new
29
+
30
+ respond_to do |format|
31
+ format.html # new.html.erb
32
+ format.xml { render :xml => @note }
33
+ format.fxml { render :fxml => @note }
34
+ end
35
+ end
36
+
37
+ # GET /notes/1/edit
38
+ def edit
39
+ @note = Note.find(params[:id])
40
+ end
41
+
42
+ # POST /notes
43
+ # POST /notes.xml
44
+ def create
45
+ @note = Note.new(params[:note])
46
+
47
+ respond_to do |format|
48
+ if @note.save
49
+ flash[:notice] = 'Note was successfully created.'
50
+ format.html { redirect_to(@note) }
51
+ format.xml { render :xml => @note, :status => :created, :location => @note }
52
+ format.fxml { render :fxml => @note }
53
+ else
54
+ format.html { render :action => "new" }
55
+ format.xml { render :xml => @note.errors, :status => :unprocessable_entity }
56
+ format.fxml { render :fxml => @note.errors }
57
+ end
58
+ end
59
+ end
60
+
61
+ # PUT /notes/1
62
+ # PUT /notes/1.xml
63
+ def update
64
+ @note = Note.find(params[:id])
65
+
66
+ respond_to do |format|
67
+ if @note.update_attributes(params[:note])
68
+ flash[:notice] = 'Note was successfully updated.'
69
+ format.html { redirect_to(@note) }
70
+ format.xml { head :ok }
71
+ format.fxml { render :fxml => @note }
72
+ else
73
+ format.html { render :action => "edit" }
74
+ format.xml { render :xml => @note.errors, :status => :unprocessable_entity }
75
+ format.fxml { render :fxml => @note.errors }
76
+ end
77
+ end
78
+ end
79
+
80
+ # DELETE /notes/1
81
+ # DELETE /notes/1.xml
82
+ def destroy
83
+ @note = Note.find(params[:id])
84
+ @note.destroy
85
+
86
+ respond_to do |format|
87
+ format.html { redirect_to(notes_url) }
88
+ format.xml { head :ok }
89
+ format.fxml { render :fxml => @note }
90
+ end
91
+ end
92
+
93
+ def empty_params_action
94
+ params = {}
95
+ end
96
+ end
@@ -0,0 +1,93 @@
1
+ class ProjectsController < ApplicationController
2
+ # GET /projects
3
+ # GET /projects.xml
4
+ def index
5
+ @projects = Project.find(:all)
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.xml { render :xml => @projects }
10
+ format.fxml { render :fxml => @projects }
11
+ end
12
+ end
13
+
14
+ # GET /projects/1
15
+ # GET /projects/1.xml
16
+ def show
17
+ @project = Project.find(params[:id])
18
+
19
+ respond_to do |format|
20
+ format.html # show.html.erb
21
+ format.xml { render :xml => @project }
22
+ format.fxml { render :fxml => @project }
23
+ end
24
+ end
25
+
26
+ # GET /projects/new
27
+ # GET /projects/new.xml
28
+ def new
29
+ @project = Project.new
30
+
31
+ respond_to do |format|
32
+ format.html # new.html.erb
33
+ format.xml { render :xml => @project }
34
+ format.fxml { render :fxml => @project }
35
+ end
36
+ end
37
+
38
+ # GET /projects/1/edit
39
+ def edit
40
+ @project = Project.find(params[:id])
41
+ end
42
+
43
+ # POST /projects
44
+ # POST /projects.xml
45
+ def create
46
+ @project = Project.new(params[:project])
47
+
48
+ respond_to do |format|
49
+ if @project.save
50
+ flash[:notice] = 'Project was successfully created.'
51
+ format.html { redirect_to(@project) }
52
+ format.xml { render :xml => @project, :status => :created, :location => @project }
53
+ format.fxml { render :fxml => @project }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
57
+ format.fxml { render :fxml => @project.errors }
58
+ end
59
+ end
60
+ end
61
+
62
+ # PUT /projects/1
63
+ # PUT /projects/1.xml
64
+ def update
65
+ @project = Project.find(params[:id])
66
+
67
+ respond_to do |format|
68
+ if @project.update_attributes(params[:project])
69
+ flash[:notice] = 'Project was successfully updated.'
70
+ format.html { redirect_to(@project) }
71
+ format.xml { head :ok }
72
+ format.fxml { render :fxml => @project }
73
+ else
74
+ format.html { render :action => "edit" }
75
+ format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
76
+ format.fxml { render :fxml => @project.errors }
77
+ end
78
+ end
79
+ end
80
+
81
+ # DELETE /projects/1
82
+ # DELETE /projects/1.xml
83
+ def destroy
84
+ @project = Project.find(params[:id])
85
+ @project.destroy
86
+
87
+ respond_to do |format|
88
+ format.html { redirect_to(projects_url) }
89
+ format.xml { head :ok }
90
+ format.fxml { render :fxml => @project }
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,93 @@
1
+ class TasksController < ApplicationController
2
+ # GET /tasks
3
+ # GET /tasks.xml
4
+ def index
5
+ @tasks = Task.find(:all)
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.xml { render :xml => @tasks }
10
+ format.fxml { render :fxml => @tasks }
11
+ end
12
+ end
13
+
14
+ # GET /tasks/1
15
+ # GET /tasks/1.xml
16
+ def show
17
+ @task = Task.find(params[:id])
18
+
19
+ respond_to do |format|
20
+ format.html # show.html.erb
21
+ format.xml { render :xml => @task }
22
+ format.fxml { render :fxml => @task }
23
+ end
24
+ end
25
+
26
+ # GET /tasks/new
27
+ # GET /tasks/new.xml
28
+ def new
29
+ @task = Task.new
30
+
31
+ respond_to do |format|
32
+ format.html # new.html.erb
33
+ format.xml { render :xml => @task }
34
+ format.fxml { render :fxml => @task }
35
+ end
36
+ end
37
+
38
+ # GET /tasks/1/edit
39
+ def edit
40
+ @task = Task.find(params[:id])
41
+ end
42
+
43
+ # POST /tasks
44
+ # POST /tasks.xml
45
+ def create
46
+ @task = Task.new(params[:task])
47
+
48
+ respond_to do |format|
49
+ if @task.save
50
+ flash[:notice] = 'Task was successfully created.'
51
+ format.html { redirect_to(@task) }
52
+ format.xml { render :xml => @task, :status => :created, :location => @task }
53
+ format.fxml { render :fxml => @task }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.xml { render :xml => @task.errors, :status => :unprocessable_entity }
57
+ format.fxml { render :fxml => @task.errors }
58
+ end
59
+ end
60
+ end
61
+
62
+ # PUT /tasks/1
63
+ # PUT /tasks/1.xml
64
+ def update
65
+ @task = Task.find(params[:id])
66
+
67
+ respond_to do |format|
68
+ if @task.update_attributes(params[:task])
69
+ flash[:notice] = 'Task was successfully updated.'
70
+ format.html { redirect_to(@task) }
71
+ format.xml { head :ok }
72
+ format.fxml { render :fxml => @task }
73
+ else
74
+ format.html { render :action => "edit" }
75
+ format.xml { render :xml => @task.errors, :status => :unprocessable_entity }
76
+ format.fxml { render :fxml => @task.errors }
77
+ end
78
+ end
79
+ end
80
+
81
+ # DELETE /tasks/1
82
+ # DELETE /tasks/1.xml
83
+ def destroy
84
+ @task = Task.find(params[:id])
85
+ @task.destroy
86
+
87
+ respond_to do |format|
88
+ format.html { redirect_to(tasks_url) }
89
+ format.xml { head :ok }
90
+ format.fxml { render :fxml => @task }
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,93 @@
1
+ class UsersController < ApplicationController
2
+ # GET /users
3
+ # GET /users.xml
4
+ def index
5
+ @users = User.find(:all)
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.xml { render :xml => @users }
10
+ format.fxml { render :fxml => @users }
11
+ end
12
+ end
13
+
14
+ # GET /users/1
15
+ # GET /users/1.xml
16
+ def show
17
+ @user = User.find(params[:id])
18
+
19
+ respond_to do |format|
20
+ format.html # show.html.erb
21
+ format.xml { render :xml => @user }
22
+ format.fxml { render :fxml => @user }
23
+ end
24
+ end
25
+
26
+ # GET /users/new
27
+ # GET /users/new.xml
28
+ def new
29
+ @user = User.new
30
+
31
+ respond_to do |format|
32
+ format.html # new.html.erb
33
+ format.xml { render :xml => @user }
34
+ format.fxml { render :fxml => @user }
35
+ end
36
+ end
37
+
38
+ # GET /users/1/edit
39
+ def edit
40
+ @user = User.find(params[:id])
41
+ end
42
+
43
+ # POST /users
44
+ # POST /users.xml
45
+ def create
46
+ @user = User.new(params[:user])
47
+
48
+ respond_to do |format|
49
+ if @user.save
50
+ flash[:notice] = 'User was successfully created.'
51
+ format.html { redirect_to(@user) }
52
+ format.xml { render :xml => @user, :status => :created, :location => @user }
53
+ format.fxml { render :fxml => @user }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
57
+ format.fxml { render :fxml => @user.errors }
58
+ end
59
+ end
60
+ end
61
+
62
+ # PUT /users/1
63
+ # PUT /users/1.xml
64
+ def update
65
+ @user = User.find(params[:id])
66
+
67
+ respond_to do |format|
68
+ if @user.update_attributes(params[:user])
69
+ flash[:notice] = 'User was successfully updated.'
70
+ format.html { redirect_to(@user) }
71
+ format.xml { head :ok }
72
+ format.fxml { render :fxml => @user }
73
+ else
74
+ format.html { render :action => "edit" }
75
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
76
+ format.fxml { render :fxml => @user.errors }
77
+ end
78
+ end
79
+ end
80
+
81
+ # DELETE /users/1
82
+ # DELETE /users/1.xml
83
+ def destroy
84
+ @user = User.find(params[:id])
85
+ @user.destroy
86
+
87
+ respond_to do |format|
88
+ format.html { redirect_to(users_url) }
89
+ format.xml { head :ok }
90
+ format.fxml { render :fxml => @user }
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,4 @@
1
+ test:
2
+ adapter: sqlite3
3
+ database: 'test.sqlite3'
4
+ timeout: 5000
@@ -0,0 +1,8 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+ vienna:
3
+ name: Vienna
4
+ user: ludwig
5
+
6
+ stratford:
7
+ name: Stratford Upon Avon
8
+ user: shakespeare
@@ -0,0 +1,17 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ note_one:
4
+ content: Note1ContentText
5
+ user: user_one
6
+
7
+ note_two:
8
+ content: Note2ContentText
9
+ user: user_two
10
+
11
+ note_three:
12
+ content: Note3ContentText
13
+ user: user_three
14
+
15
+ note_four:
16
+ content: Note4ContentText
17
+ user: user_four
@@ -0,0 +1,25 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ health:
4
+ name: Health
5
+ start_date: <%= 20.days.ago %>
6
+ completed: false
7
+ user: ludwig
8
+
9
+ music:
10
+ name: Music
11
+ start_date: <%= 20.days.ago %>
12
+ completed: false
13
+ user: ludwig
14
+
15
+ hamlet:
16
+ name: Hamlet
17
+ start_date: <%= 2.years.ago %>
18
+ completed: false
19
+ user: shakespeare
20
+
21
+ othello:
22
+ name: Othello
23
+ start_date: <%= 20.days.ago %>
24
+ completed: false
25
+ user: shakespeare
@@ -0,0 +1,19 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ apple:
4
+ name: Apple
5
+ amount: 12
6
+ price: 10.50
7
+ quantity: 12
8
+ available: true
9
+ delivered_on: <%= 2.days.ago %>
10
+ sold_on: <%= 2.hours.ago %>
11
+
12
+ orange:
13
+ name: Orange
14
+ amount: 15
15
+ price: 15.50
16
+ quantity: 15
17
+ available: false
18
+ delivered_on: <%= 2.days.ago %>
19
+ sold_on: <%= 2.hours.ago %>
@@ -0,0 +1,46 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ haydn:
4
+ name: Get piano lessons from Haydn
5
+ location: vienna
6
+ user: ludwig
7
+ project: music
8
+ start_time: <%= 30.days.ago %>
9
+ end_time: <%= 100.days.from_now %>
10
+
11
+ salieri:
12
+ name: Arrange lessions with Antonio Salieri
13
+ location: vienna
14
+ user: ludwig
15
+ project: music
16
+ start_time: <%= 30.days.ago %>
17
+
18
+ hearing:
19
+ name: See doctor about hearing again
20
+ location: vienna
21
+ user: ludwig
22
+ project: health
23
+ start_time: <%= 30.days.ago %>
24
+
25
+ sound_board:
26
+ name: Get a new sound board made
27
+ location: vienna
28
+ user: ludwig
29
+ project: health
30
+ start_time: <%= 30.days.ago %>
31
+
32
+ hamlet_soliloquy:
33
+ name: "Edit Hamlet's soliloquy"
34
+ notes: "'That is the question' or 'is that the question?'"
35
+ location: stratford
36
+ user: shakespeare
37
+ project: hamlet
38
+ start_time: <%= 30.days.ago %>
39
+
40
+ othello_outline:
41
+ name: Outline Othello
42
+ location: stratford
43
+ user: shakespeare
44
+ project: othello
45
+ start_time: <%= 30.days.ago %>
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,21 @@
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
+ config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))['test']
10
+ puts "config:\n#{config.inspect}"
11
+ ActiveRecord::Base.configurations = config
12
+ ActiveRecord::Base.establish_connection(config)
13
+
14
+ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/models.log")
15
+ ActionController::Base.logger = Logger.new(File.dirname(__FILE__) + "/controllers.log")
16
+ ApplicationController.append_view_path File.join(File.dirname(__FILE__), '..', 'views')
17
+
18
+ load(schema_file) if File.exist?(schema_file)
19
+
20
+ Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
21
+ $:.unshift(Test::Unit::TestCase.fixture_path)