mir_extensions 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +18 -2
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -1
  6. data/app/controllers/foos_controller.rb +83 -0
  7. data/app/helpers/application_helper.rb +1 -0
  8. data/app/models/foo.rb +2 -0
  9. data/app/views/foos/_form.html.erb +20 -0
  10. data/app/views/foos/edit.html.erb +6 -0
  11. data/app/views/foos/index.html.erb +27 -0
  12. data/app/views/foos/new.html.erb +5 -0
  13. data/app/views/foos/show.html.erb +20 -0
  14. data/config.ru +1 -1
  15. data/config/application.rb +5 -1
  16. data/config/environment.rb +1 -1
  17. data/config/environments/development.rb +1 -1
  18. data/config/environments/test.rb +1 -1
  19. data/config/initializers/secret_token.rb +1 -1
  20. data/config/initializers/session_store.rb +1 -1
  21. data/config/routes.rb +5 -2
  22. data/db/migrate/20100801224509_create_foos.rb +16 -0
  23. data/db/mir_ext_development.sqlite3 +0 -0
  24. data/db/mir_ext_test.sqlite3 +0 -0
  25. data/db/schema.rb +11 -1
  26. data/lib/core_ext/core_ext.rb +1 -2
  27. data/lib/mir_extensions.rb +386 -2
  28. data/lib/mir_form_builder.rb +166 -0
  29. data/mir_extensions.gemspec +29 -7
  30. data/public/stylesheets/scaffold.css +56 -0
  31. data/spec/controllers/foos_controller_spec.rb +125 -0
  32. data/spec/routing/foos_routing_spec.rb +35 -0
  33. data/spec/support/integration_example_group.rb +35 -0
  34. data/spec/views/foos/edit.html.erb_spec.rb +61 -0
  35. data/spec/views/foos/index.html.erb_spec.rb +25 -0
  36. data/spec/views/foos/new.html.erb_spec.rb +22 -0
  37. data/spec/views/foos/show.html.erb_spec.rb +18 -0
  38. metadata +29 -7
  39. data/lib/core_ext/helper_extensions.rb +0 -383
  40. data/log/development.log +0 -151
  41. data/log/test.log +0 -27
  42. data/public/index.html +0 -262
@@ -1,151 +0,0 @@
1
- SQL (0.4ms)  SELECT name
2
- FROM sqlite_master
3
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
4
- 
5
- SQL (0.1ms) select sqlite_version(*)
6
- SQL (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
7
- SQL (0.1ms) PRAGMA index_list("schema_migrations")
8
- SQL (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
- SQL (0.1ms) SELECT name
10
- FROM sqlite_master
11
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
12
- SQL (0.2ms)  SELECT name
13
- FROM sqlite_master
14
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
15
- 
16
- SQL (0.2ms) SELECT name
17
- FROM sqlite_master
18
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
19
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
20
- SQL (0.1ms) SELECT name
21
- FROM sqlite_master
22
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
23
- SQL (0.3ms) select sqlite_version(*)
24
- SQL (0.3ms) SELECT name
25
- FROM sqlite_master
26
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
27
- SQL (0.1ms)  SELECT name
28
- FROM sqlite_master
29
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
30
- 
31
- SQL (0.3ms) SELECT name
32
- FROM sqlite_master
33
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
34
- SQL (0.1ms) select sqlite_version(*)
35
- SQL (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
36
- SQL (0.1ms) PRAGMA index_list("schema_migrations")
37
- SQL (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
38
- SQL (0.2ms)  SELECT name
39
- FROM sqlite_master
40
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
41
- 
42
- SQL (0.1ms) SELECT version FROM "schema_migrations"
43
- SQL (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
44
- SQL (1.2ms) select sqlite_version(*)
45
- SQL (0.3ms) SELECT name
46
- FROM sqlite_master
47
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
48
- SQL (0.1ms)  SELECT name
49
- FROM sqlite_master
50
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
51
- 
52
- SQL (0.2ms) SELECT name
53
- FROM sqlite_master
54
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
55
- SQL (0.1ms) select sqlite_version(*)
56
- SQL (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
57
- SQL (0.0ms) PRAGMA index_list("schema_migrations")
58
- SQL (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
59
- SQL (0.1ms)  SELECT name
60
- FROM sqlite_master
61
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
62
- 
63
- SQL (0.1ms) SELECT version FROM "schema_migrations"
64
- SQL (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
65
- SQL (0.4ms) select sqlite_version(*)
66
- SQL (0.3ms) SELECT name
67
- FROM sqlite_master
68
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
69
- SQL (0.1ms)  SELECT name
70
- FROM sqlite_master
71
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
72
- 
73
- SQL (0.2ms) SELECT name
74
- FROM sqlite_master
75
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
76
- SQL (0.1ms) select sqlite_version(*)
77
- SQL (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
78
- SQL (0.1ms) PRAGMA index_list("schema_migrations")
79
- SQL (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
80
- SQL (0.2ms)  SELECT name
81
- FROM sqlite_master
82
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
83
- 
84
- SQL (0.1ms) SELECT version FROM "schema_migrations"
85
- SQL (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
86
- SQL (0.4ms)  SELECT name
87
- FROM sqlite_master
88
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
89
- 
90
- SQL (0.1ms) select sqlite_version(*)
91
- SQL (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
92
- SQL (0.0ms) PRAGMA index_list("schema_migrations")
93
- SQL (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
94
- SQL (0.1ms) SELECT name
95
- FROM sqlite_master
96
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
97
- SQL (0.1ms) SELECT version FROM "schema_migrations"
98
- SQL (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
99
- SQL (0.3ms) select sqlite_version(*)
100
- SQL (0.3ms) SELECT name
101
- FROM sqlite_master
102
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
103
- SQL (2.6ms) CREATE TABLE "primaries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255)) 
104
- SQL (0.2ms) SELECT name
105
- FROM sqlite_master
106
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
107
- SQL (1.8ms) CREATE TABLE "secondaries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "primary_id" integer) 
108
- SQL (0.1ms) PRAGMA index_list("secondaries")
109
- SQL (1.8ms) CREATE INDEX "index_roles_on_name" ON "secondaries" ("primary_id")
110
- SQL (0.1ms) SELECT name
111
- FROM sqlite_master
112
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
113
- SQL (0.1ms) SELECT version FROM "schema_migrations"
114
- SQL (0.4ms) select sqlite_version(*)
115
- SQL (0.5ms) SELECT name
116
- FROM sqlite_master
117
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
118
- SQL (0.1ms)  SELECT name
119
- FROM sqlite_master
120
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
121
- 
122
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
123
- SQL (0.1ms)  SELECT name
124
- FROM sqlite_master
125
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
126
- 
127
- SQL (0.0ms) PRAGMA index_list("primaries")
128
- SQL (0.1ms) PRAGMA index_list("secondaries")
129
- SQL (0.1ms) PRAGMA index_info('index_roles_on_name')
130
- SQL (0.1ms) select sqlite_version(*)
131
- SQL (0.2ms) SELECT name
132
- FROM sqlite_master
133
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
134
- SQL (2.5ms) CREATE TABLE "primaries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255)) 
135
- SQL (0.3ms) SELECT name
136
- FROM sqlite_master
137
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
138
- SQL (1.5ms) CREATE TABLE "secondaries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "primary_id" integer) 
139
- SQL (0.1ms) PRAGMA index_list("secondaries")
140
- SQL (1.4ms) CREATE INDEX "index_roles_on_name" ON "secondaries" ("primary_id")
141
- SQL (0.2ms) SELECT name
142
- FROM sqlite_master
143
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
144
- SQL (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
145
- SQL (0.0ms) PRAGMA index_list("schema_migrations")
146
- SQL (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
147
- SQL (0.2ms) SELECT name
148
- FROM sqlite_master
149
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
150
- SQL (0.1ms) SELECT version FROM "schema_migrations"
151
- SQL (6.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
@@ -1,27 +0,0 @@
1
- SQL (0.2ms)  SELECT name
2
- FROM sqlite_master
3
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
4
- 
5
- SQL (0.1ms) SELECT name
6
- FROM sqlite_master
7
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
8
- SQL (0.2ms)  SELECT name
9
- FROM sqlite_master
10
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
11
- 
12
- SQL (0.2ms)  SELECT name
13
- FROM sqlite_master
14
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
15
- 
16
- SQL (0.3ms)  SELECT name
17
- FROM sqlite_master
18
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
19
- 
20
- Primary Load (0.2ms) SELECT "primaries".* FROM "primaries"
21
- SQLite3::SQLException: no such table: primaries: SELECT "primaries".* FROM "primaries"
22
- SQL (0.3ms)  SELECT name
23
- FROM sqlite_master
24
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
25
- 
26
- Primary Load (0.2ms) SELECT "primaries".* FROM "primaries"
27
- SQLite3::SQLException: no such table: primaries: SELECT "primaries".* FROM "primaries"
@@ -1,262 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Ruby on Rails: Welcome aboard</title>
5
- <style type="text/css" media="screen">
6
- body {
7
- margin: 0;
8
- margin-bottom: 25px;
9
- padding: 0;
10
- background-color: #f0f0f0;
11
- font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
12
- font-size: 13px;
13
- color: #333;
14
- }
15
-
16
- h1 {
17
- font-size: 28px;
18
- color: #000;
19
- }
20
-
21
- a {color: #03c}
22
- a:hover {
23
- background-color: #03c;
24
- color: white;
25
- text-decoration: none;
26
- }
27
-
28
-
29
- #page {
30
- background-color: #f0f0f0;
31
- width: 750px;
32
- margin: 0;
33
- margin-left: auto;
34
- margin-right: auto;
35
- }
36
-
37
- #content {
38
- float: left;
39
- background-color: white;
40
- border: 3px solid #aaa;
41
- border-top: none;
42
- padding: 25px;
43
- width: 500px;
44
- }
45
-
46
- #sidebar {
47
- float: right;
48
- width: 175px;
49
- }
50
-
51
- #footer {
52
- clear: both;
53
- }
54
-
55
-
56
- #header, #about, #getting-started {
57
- padding-left: 75px;
58
- padding-right: 30px;
59
- }
60
-
61
-
62
- #header {
63
- background-image: url("images/rails.png");
64
- background-repeat: no-repeat;
65
- background-position: top left;
66
- height: 64px;
67
- }
68
- #header h1, #header h2 {margin: 0}
69
- #header h2 {
70
- color: #888;
71
- font-weight: normal;
72
- font-size: 16px;
73
- }
74
-
75
-
76
- #about h3 {
77
- margin: 0;
78
- margin-bottom: 10px;
79
- font-size: 14px;
80
- }
81
-
82
- #about-content {
83
- background-color: #ffd;
84
- border: 1px solid #fc0;
85
- margin-left: -55px;
86
- margin-right: -10px;
87
- }
88
- #about-content table {
89
- margin-top: 10px;
90
- margin-bottom: 10px;
91
- font-size: 11px;
92
- border-collapse: collapse;
93
- }
94
- #about-content td {
95
- padding: 10px;
96
- padding-top: 3px;
97
- padding-bottom: 3px;
98
- }
99
- #about-content td.name {color: #555}
100
- #about-content td.value {color: #000}
101
-
102
- #about-content ul {
103
- padding: 0;
104
- list-style-type: none;
105
- }
106
-
107
- #about-content.failure {
108
- background-color: #fcc;
109
- border: 1px solid #f00;
110
- }
111
- #about-content.failure p {
112
- margin: 0;
113
- padding: 10px;
114
- }
115
-
116
-
117
- #getting-started {
118
- border-top: 1px solid #ccc;
119
- margin-top: 25px;
120
- padding-top: 15px;
121
- }
122
- #getting-started h1 {
123
- margin: 0;
124
- font-size: 20px;
125
- }
126
- #getting-started h2 {
127
- margin: 0;
128
- font-size: 14px;
129
- font-weight: normal;
130
- color: #333;
131
- margin-bottom: 25px;
132
- }
133
- #getting-started ol {
134
- margin-left: 0;
135
- padding-left: 0;
136
- }
137
- #getting-started li {
138
- font-size: 18px;
139
- color: #888;
140
- margin-bottom: 25px;
141
- }
142
- #getting-started li h2 {
143
- margin: 0;
144
- font-weight: normal;
145
- font-size: 18px;
146
- color: #333;
147
- }
148
- #getting-started li p {
149
- color: #555;
150
- font-size: 13px;
151
- }
152
-
153
-
154
- #search {
155
- margin: 0;
156
- padding-top: 10px;
157
- padding-bottom: 10px;
158
- font-size: 11px;
159
- }
160
- #search input {
161
- font-size: 11px;
162
- margin: 2px;
163
- }
164
- #search-text {width: 170px}
165
-
166
-
167
- #sidebar ul {
168
- margin-left: 0;
169
- padding-left: 0;
170
- }
171
- #sidebar ul h3 {
172
- margin-top: 25px;
173
- font-size: 16px;
174
- padding-bottom: 10px;
175
- border-bottom: 1px solid #ccc;
176
- }
177
- #sidebar li {
178
- list-style-type: none;
179
- }
180
- #sidebar ul.links li {
181
- margin-bottom: 5px;
182
- }
183
-
184
- </style>
185
- <script type="text/javascript">
186
- function about() {
187
- info = document.getElementById('about-content');
188
- if (window.XMLHttpRequest)
189
- { xhr = new XMLHttpRequest(); }
190
- else
191
- { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
192
- xhr.open("GET","rails/info/properties",false);
193
- xhr.send("");
194
- info.innerHTML = xhr.responseText;
195
- info.style.display = 'block'
196
- }
197
-
198
- function prepend() {
199
- search = document.getElementById('search-text');
200
- text = search.value;
201
- search.value = 'site:rubyonrails.org ' + text;
202
- }
203
-
204
- window.onload = function() {
205
- document.getElementById('search-text').value = '';
206
- }
207
- </script>
208
- </head>
209
- <body>
210
- <div id="page">
211
- <div id="sidebar">
212
- <ul id="sidebar-items">
213
- <li>
214
- <h3>Browse the documentation</h3>
215
- <ul class="links">
216
- <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
217
- <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
218
- <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
219
- <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
220
- </ul>
221
- </li>
222
- </ul>
223
- </div>
224
-
225
- <div id="content">
226
- <div id="header">
227
- <h1>Welcome aboard</h1>
228
- <h2>You&rsquo;re riding Ruby on Rails!</h2>
229
- </div>
230
-
231
- <div id="about">
232
- <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
233
- <div id="about-content" style="display: none"></div>
234
- </div>
235
-
236
- <div id="getting-started">
237
- <h1>Getting started</h1>
238
- <h2>Here&rsquo;s how to get rolling:</h2>
239
-
240
- <ol>
241
- <li>
242
- <h2>Use <code>rails generate</code> to create your models and controllers</h2>
243
- <p>To see all available options, run it without parameters.</p>
244
- </li>
245
-
246
- <li>
247
- <h2>Set up a default route and remove or rename this file</h2>
248
- <p>Routes are set up in config/routes.rb.</p>
249
- </li>
250
-
251
- <li>
252
- <h2>Create your database</h2>
253
- <p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
254
- </li>
255
- </ol>
256
- </div>
257
- </div>
258
-
259
- <div id="footer">&nbsp;</div>
260
- </div>
261
- </body>
262
- </html>