meta_reports 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +1 -0
- data/README.md +65 -12
- data/lib/generators/meta_reports/install_engine_generator.rb +4 -0
- data/{app/controllers/meta_reports → lib/generators/meta_reports/templates/controllers}/reports_controller.rb +0 -0
- data/lib/generators/meta_reports/templates/models/report.rb +19 -2
- data/lib/generators/meta_reports/templates/models/report_non_activerecord.rb +19 -2
- data/lib/meta_reports/version.rb +1 -1
- data/lib/tasks/meta_reports_tasks.rake +59 -4
- data/spec/dummy/app/assets/stylesheets/lib/metareports_color_variables.scss +9 -0
- data/spec/dummy/app/assets/stylesheets/lib/metareports_colors.scss +10 -0
- data/spec/dummy/app/controllers/meta_reports/reports_controller.rb +91 -0
- data/spec/dummy/app/models/meta_reports/report.rb +19 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/{20130801071213_create_meta_reports_reports.rb → 20130801071213_for_testing_only.rb} +1 -1
- data/spec/dummy/db/schema.rb +5 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1285 -0
- data/spec/dummy/log/test.log +781 -0
- data/spec/dummy/tmp/cache/assets/CD1/A80/sprockets%2F25be813f3840b407d514e03973fbac40 +0 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/CDC/FB0/sprockets%2F16b037c6f739184fc67a82dc140a3b83 +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/340/sprockets%2F8ad88a197ff3462ea8dd3ad7b1e2b7e9 +0 -0
- data/spec/dummy/tmp/cache/assets/DF1/CD0/sprockets%2F3b66bd14b91d4fb176ce0a30ab5fd9bf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_color_variables.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_colors.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/16b037c6f739184fc67a82dc140a3b83 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/25be813f3840b407d514e03973fbac40 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2e7ca7e84b7c22471bbca0e4504a2597 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/34d1d79bff5dc36e7f78550df20eec85 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3b66bd14b91d4fb176ce0a30ab5fd9bf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7d10cf1420e7efe789dd0a850b92fe72 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/89b49044c6f7d85bbb660b73a9a4e181 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8ad88a197ff3462ea8dd3ad7b1e2b7e9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/generators/install_engine_spec.rb +13 -3
- data/spec/tasks/meta_reports_rake_spec.rb +58 -0
- metadata +55 -7
- data/spec/dummy/README.rdoc +0 -261
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -14,12 +14,22 @@ describe 'meta_reports:install_engine', disabled: false do
|
|
14
14
|
after :all do
|
15
15
|
Dir.chdir(Rails.root) do
|
16
16
|
FileUtils.cp "config/routes_original.rb", "config/routes.rb"
|
17
|
-
|
18
|
-
migrations.length.should == 1
|
19
|
-
migrations.each {|m| File.unlink(m) }
|
17
|
+
Dir.glob("db/migrate/*create_meta_reports_reports.meta_reports.rb").each {|m| File.unlink(m) }
|
20
18
|
end
|
21
19
|
end
|
22
20
|
|
21
|
+
#TODO: Find out why this is failing. Is it just timing?
|
22
|
+
it "should create migration", disabled: true do
|
23
|
+
Dir.chdir(Rails.root) do
|
24
|
+
puts Dir.glob("db/migrate/*").inspect
|
25
|
+
Dir.glob("db/migrate/*create_meta_reports_reports.meta_reports.rb").length.should == 1
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should generate controller" do
|
30
|
+
subject.should generate("app/controllers/meta_reports/reports_controller.rb")
|
31
|
+
end
|
32
|
+
|
23
33
|
it "should generate model" do
|
24
34
|
subject.should generate("app/models/meta_reports/report.rb")
|
25
35
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rake'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
describe 'rake tasks' do
|
6
|
+
describe 'meta_reports:export_colors' do
|
7
|
+
before :all do
|
8
|
+
Rake.application.rake_require 'tasks/meta_reports_tasks'
|
9
|
+
Rake::Task.define_task(:environment)
|
10
|
+
Dir.chdir(Rails.root) do
|
11
|
+
Dir.glob("app/assets/stylesheets/lib/*").map {|f| File.unlink(f)}
|
12
|
+
Rake::Task["meta_reports:export_colors"].reenable
|
13
|
+
Rake.application.invoke_task "meta_reports:export_colors"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
# FileUtils.rm_r("app/assets/stylesheets/lib")
|
17
|
+
|
18
|
+
it "exports two files" do
|
19
|
+
Dir.chdir(Rails.root) do
|
20
|
+
Dir.glob("app/assets/stylesheets/lib/*").length.should == 2
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "exports colors" do
|
25
|
+
Dir.chdir(Rails.root) do
|
26
|
+
puts Dir.pwd
|
27
|
+
css = File.open("app/assets/stylesheets/lib/metareports_colors.scss",'rb') {|f| f.read }
|
28
|
+
css.should == "@import 'metareports_color_variables.scss';
|
29
|
+
.even { background: $_even; }
|
30
|
+
.odd { background: $_odd; }
|
31
|
+
.yellow:nth-child(4n+0) { background: $_yellow_0; }
|
32
|
+
.yellow:nth-child(4n+1) { background: $_yellow_1; }
|
33
|
+
.yellow:nth-child(4n+2) { background: $_yellow_2; }
|
34
|
+
.yellow:nth-child(4n+3) { background: $_yellow_3; }
|
35
|
+
tr .highlight { background: $_yellow_1 !important; }
|
36
|
+
a:hover:nth-child(2n+0) { background: $a--hover_0; }
|
37
|
+
a:hover:nth-child(2n+1) { background: $a--hover_1; }
|
38
|
+
"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "exports variables" do
|
43
|
+
Dir.chdir(Rails.root) do
|
44
|
+
variables = File.open("app/assets/stylesheets/lib/metareports_color_variables.scss",'rb') {|f| f.read}
|
45
|
+
variables.should == "$_even: #efefef;
|
46
|
+
$_odd: #ffffff;
|
47
|
+
$_yellow_0: #ffffaa;
|
48
|
+
$_yellow_1: #ffffcc;
|
49
|
+
$_yellow_2: #f9f9a4;
|
50
|
+
$_yellow_3: #f9f9c6;
|
51
|
+
$tr____highlight: $_yellow_1;
|
52
|
+
$a--hover_0: #ffcccc;
|
53
|
+
$a--hover_1: #ffc5c5;
|
54
|
+
"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_reports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Peden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -234,6 +234,20 @@ dependencies:
|
|
234
234
|
- - '>='
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: sass-rails
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - '>='
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
237
251
|
description: Meta Reports provides a meta language and data structure to create a
|
238
252
|
'meta' report. This report can then be exported into any format desired. MR provides
|
239
253
|
HTML, PDF, and XLSX exports built in.
|
@@ -247,7 +261,6 @@ files:
|
|
247
261
|
- app/assets/images/meta_reports/spreadsheet.png
|
248
262
|
- app/assets/javascripts/meta_reports/reports.js
|
249
263
|
- app/controllers/meta_reports/application_controller.rb
|
250
|
-
- app/controllers/meta_reports/reports_controller.rb
|
251
264
|
- app/helpers/meta_reports/reports_helper.rb
|
252
265
|
- app/models/meta_reports/base.rb
|
253
266
|
- app/models/meta_reports/data.rb
|
@@ -256,6 +269,7 @@ files:
|
|
256
269
|
- db/migrate/20130801071213_create_meta_reports_reports.rb
|
257
270
|
- lib/generators/meta_reports/install_engine_generator.rb
|
258
271
|
- lib/generators/meta_reports/install_templates_generator.rb
|
272
|
+
- lib/generators/meta_reports/templates/controllers/reports_controller.rb
|
259
273
|
- lib/generators/meta_reports/templates/models/report.rb
|
260
274
|
- lib/generators/meta_reports/templates/models/report_non_activerecord.rb
|
261
275
|
- lib/generators/meta_reports/templates/views/_form.html.erb
|
@@ -283,8 +297,11 @@ files:
|
|
283
297
|
- spec/ci.sh
|
284
298
|
- spec/dummy/app/assets/javascripts/application.js
|
285
299
|
- spec/dummy/app/assets/stylesheets/application.css
|
300
|
+
- spec/dummy/app/assets/stylesheets/lib/metareports_color_variables.scss
|
301
|
+
- spec/dummy/app/assets/stylesheets/lib/metareports_colors.scss
|
286
302
|
- spec/dummy/app/controllers/application_controller.rb
|
287
303
|
- spec/dummy/app/controllers/home_controller.rb
|
304
|
+
- spec/dummy/app/controllers/meta_reports/reports_controller.rb
|
288
305
|
- spec/dummy/app/helpers/application_helper.rb
|
289
306
|
- spec/dummy/app/models/meta_reports/report.rb
|
290
307
|
- spec/dummy/app/views/home/index.html.erb
|
@@ -323,7 +340,7 @@ files:
|
|
323
340
|
- spec/dummy/config/routes_original.rb
|
324
341
|
- spec/dummy/config.ru
|
325
342
|
- spec/dummy/db/development.sqlite3
|
326
|
-
- spec/dummy/db/migrate/
|
343
|
+
- spec/dummy/db/migrate/20130801071213_for_testing_only.rb
|
327
344
|
- spec/dummy/db/schema.rb
|
328
345
|
- spec/dummy/db/test.sqlite3
|
329
346
|
- spec/dummy/log/development.log
|
@@ -333,13 +350,14 @@ files:
|
|
333
350
|
- spec/dummy/public/500.html
|
334
351
|
- spec/dummy/public/favicon.ico
|
335
352
|
- spec/dummy/Rakefile
|
336
|
-
- spec/dummy/README.rdoc
|
337
353
|
- spec/dummy/script/rails
|
338
354
|
- spec/dummy/tmp/cache/assets/C9B/140/sprockets%2F805babf865ce32228222420a522c7b36
|
339
355
|
- spec/dummy/tmp/cache/assets/CBD/2B0/sprockets%2F9e22e937dd267c81a146665f15471b8e
|
340
356
|
- spec/dummy/tmp/cache/assets/CD0/810/sprockets%2Fe858c95fa595e319dac0065d49982967
|
341
357
|
- spec/dummy/tmp/cache/assets/CD0/AC0/sprockets%2F1d341d7a2fc1328567d4b23e0809b2e2
|
358
|
+
- spec/dummy/tmp/cache/assets/CD1/A80/sprockets%2F25be813f3840b407d514e03973fbac40
|
342
359
|
- spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
360
|
+
- spec/dummy/tmp/cache/assets/CDC/FB0/sprockets%2F16b037c6f739184fc67a82dc140a3b83
|
343
361
|
- spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
344
362
|
- spec/dummy/tmp/cache/assets/D3D/EB0/sprockets%2F2d47bd3108d9abbb12c0497e36d9674d
|
345
363
|
- spec/dummy/tmp/cache/assets/D40/8F0/sprockets%2F290aea2004dfecfc76f42e48970f1484
|
@@ -348,17 +366,29 @@ files:
|
|
348
366
|
- spec/dummy/tmp/cache/assets/D61/310/sprockets%2Fc168b1c9be3e38ac1c8403a3074b5b8c
|
349
367
|
- spec/dummy/tmp/cache/assets/D74/AE0/sprockets%2F9ad0425db5cfa16a9426f7b1a7958d7d
|
350
368
|
- spec/dummy/tmp/cache/assets/D98/270/sprockets%2F0b7ba158ff62bbbb378d6bea80680c63
|
369
|
+
- spec/dummy/tmp/cache/assets/DDC/340/sprockets%2F8ad88a197ff3462ea8dd3ad7b1e2b7e9
|
351
370
|
- spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
371
|
+
- spec/dummy/tmp/cache/assets/DF1/CD0/sprockets%2F3b66bd14b91d4fb176ce0a30ab5fd9bf
|
352
372
|
- spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
353
373
|
- spec/dummy/tmp/cache/assets/E5A/EF0/sprockets%2Fb0d5af721ea37c98fd4bccd8e1e5c6ab
|
374
|
+
- spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_color_variables.scssc
|
375
|
+
- spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_colors.scssc
|
354
376
|
- spec/dummy/tmp/cache/assets/test/sprockets/0b7ba158ff62bbbb378d6bea80680c63
|
355
377
|
- spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
378
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/16b037c6f739184fc67a82dc140a3b83
|
356
379
|
- spec/dummy/tmp/cache/assets/test/sprockets/1d341d7a2fc1328567d4b23e0809b2e2
|
380
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/25be813f3840b407d514e03973fbac40
|
357
381
|
- spec/dummy/tmp/cache/assets/test/sprockets/290aea2004dfecfc76f42e48970f1484
|
358
382
|
- spec/dummy/tmp/cache/assets/test/sprockets/2d47bd3108d9abbb12c0497e36d9674d
|
383
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/2e7ca7e84b7c22471bbca0e4504a2597
|
359
384
|
- spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
385
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/34d1d79bff5dc36e7f78550df20eec85
|
360
386
|
- spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
|
387
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/3b66bd14b91d4fb176ce0a30ab5fd9bf
|
388
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/7d10cf1420e7efe789dd0a850b92fe72
|
361
389
|
- spec/dummy/tmp/cache/assets/test/sprockets/805babf865ce32228222420a522c7b36
|
390
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/89b49044c6f7d85bbb660b73a9a4e181
|
391
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/8ad88a197ff3462ea8dd3ad7b1e2b7e9
|
362
392
|
- spec/dummy/tmp/cache/assets/test/sprockets/9e22e937dd267c81a146665f15471b8e
|
363
393
|
- spec/dummy/tmp/cache/assets/test/sprockets/b0d5af721ea37c98fd4bccd8e1e5c6ab
|
364
394
|
- spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
@@ -371,6 +401,7 @@ files:
|
|
371
401
|
- spec/models/data_spec.rb
|
372
402
|
- spec/models/table_spec.rb
|
373
403
|
- spec/spec_helper.rb
|
404
|
+
- spec/tasks/meta_reports_rake_spec.rb
|
374
405
|
- spec/test_3.2.sh
|
375
406
|
- spec/test_4.0.sh
|
376
407
|
- Guardfile
|
@@ -403,8 +434,11 @@ test_files:
|
|
403
434
|
- spec/ci.sh
|
404
435
|
- spec/dummy/app/assets/javascripts/application.js
|
405
436
|
- spec/dummy/app/assets/stylesheets/application.css
|
437
|
+
- spec/dummy/app/assets/stylesheets/lib/metareports_color_variables.scss
|
438
|
+
- spec/dummy/app/assets/stylesheets/lib/metareports_colors.scss
|
406
439
|
- spec/dummy/app/controllers/application_controller.rb
|
407
440
|
- spec/dummy/app/controllers/home_controller.rb
|
441
|
+
- spec/dummy/app/controllers/meta_reports/reports_controller.rb
|
408
442
|
- spec/dummy/app/helpers/application_helper.rb
|
409
443
|
- spec/dummy/app/models/meta_reports/report.rb
|
410
444
|
- spec/dummy/app/views/home/index.html.erb
|
@@ -443,7 +477,7 @@ test_files:
|
|
443
477
|
- spec/dummy/config/routes_original.rb
|
444
478
|
- spec/dummy/config.ru
|
445
479
|
- spec/dummy/db/development.sqlite3
|
446
|
-
- spec/dummy/db/migrate/
|
480
|
+
- spec/dummy/db/migrate/20130801071213_for_testing_only.rb
|
447
481
|
- spec/dummy/db/schema.rb
|
448
482
|
- spec/dummy/db/test.sqlite3
|
449
483
|
- spec/dummy/log/development.log
|
@@ -453,13 +487,14 @@ test_files:
|
|
453
487
|
- spec/dummy/public/500.html
|
454
488
|
- spec/dummy/public/favicon.ico
|
455
489
|
- spec/dummy/Rakefile
|
456
|
-
- spec/dummy/README.rdoc
|
457
490
|
- spec/dummy/script/rails
|
458
491
|
- spec/dummy/tmp/cache/assets/C9B/140/sprockets%2F805babf865ce32228222420a522c7b36
|
459
492
|
- spec/dummy/tmp/cache/assets/CBD/2B0/sprockets%2F9e22e937dd267c81a146665f15471b8e
|
460
493
|
- spec/dummy/tmp/cache/assets/CD0/810/sprockets%2Fe858c95fa595e319dac0065d49982967
|
461
494
|
- spec/dummy/tmp/cache/assets/CD0/AC0/sprockets%2F1d341d7a2fc1328567d4b23e0809b2e2
|
495
|
+
- spec/dummy/tmp/cache/assets/CD1/A80/sprockets%2F25be813f3840b407d514e03973fbac40
|
462
496
|
- spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
497
|
+
- spec/dummy/tmp/cache/assets/CDC/FB0/sprockets%2F16b037c6f739184fc67a82dc140a3b83
|
463
498
|
- spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
464
499
|
- spec/dummy/tmp/cache/assets/D3D/EB0/sprockets%2F2d47bd3108d9abbb12c0497e36d9674d
|
465
500
|
- spec/dummy/tmp/cache/assets/D40/8F0/sprockets%2F290aea2004dfecfc76f42e48970f1484
|
@@ -468,17 +503,29 @@ test_files:
|
|
468
503
|
- spec/dummy/tmp/cache/assets/D61/310/sprockets%2Fc168b1c9be3e38ac1c8403a3074b5b8c
|
469
504
|
- spec/dummy/tmp/cache/assets/D74/AE0/sprockets%2F9ad0425db5cfa16a9426f7b1a7958d7d
|
470
505
|
- spec/dummy/tmp/cache/assets/D98/270/sprockets%2F0b7ba158ff62bbbb378d6bea80680c63
|
506
|
+
- spec/dummy/tmp/cache/assets/DDC/340/sprockets%2F8ad88a197ff3462ea8dd3ad7b1e2b7e9
|
471
507
|
- spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
508
|
+
- spec/dummy/tmp/cache/assets/DF1/CD0/sprockets%2F3b66bd14b91d4fb176ce0a30ab5fd9bf
|
472
509
|
- spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
473
510
|
- spec/dummy/tmp/cache/assets/E5A/EF0/sprockets%2Fb0d5af721ea37c98fd4bccd8e1e5c6ab
|
511
|
+
- spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_color_variables.scssc
|
512
|
+
- spec/dummy/tmp/cache/assets/test/sass/cd99a83fa417594c8715ee09005855a11886141c/metareports_colors.scssc
|
474
513
|
- spec/dummy/tmp/cache/assets/test/sprockets/0b7ba158ff62bbbb378d6bea80680c63
|
475
514
|
- spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
515
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/16b037c6f739184fc67a82dc140a3b83
|
476
516
|
- spec/dummy/tmp/cache/assets/test/sprockets/1d341d7a2fc1328567d4b23e0809b2e2
|
517
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/25be813f3840b407d514e03973fbac40
|
477
518
|
- spec/dummy/tmp/cache/assets/test/sprockets/290aea2004dfecfc76f42e48970f1484
|
478
519
|
- spec/dummy/tmp/cache/assets/test/sprockets/2d47bd3108d9abbb12c0497e36d9674d
|
520
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/2e7ca7e84b7c22471bbca0e4504a2597
|
479
521
|
- spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
522
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/34d1d79bff5dc36e7f78550df20eec85
|
480
523
|
- spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
|
524
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/3b66bd14b91d4fb176ce0a30ab5fd9bf
|
525
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/7d10cf1420e7efe789dd0a850b92fe72
|
481
526
|
- spec/dummy/tmp/cache/assets/test/sprockets/805babf865ce32228222420a522c7b36
|
527
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/89b49044c6f7d85bbb660b73a9a4e181
|
528
|
+
- spec/dummy/tmp/cache/assets/test/sprockets/8ad88a197ff3462ea8dd3ad7b1e2b7e9
|
482
529
|
- spec/dummy/tmp/cache/assets/test/sprockets/9e22e937dd267c81a146665f15471b8e
|
483
530
|
- spec/dummy/tmp/cache/assets/test/sprockets/b0d5af721ea37c98fd4bccd8e1e5c6ab
|
484
531
|
- spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
@@ -491,6 +538,7 @@ test_files:
|
|
491
538
|
- spec/models/data_spec.rb
|
492
539
|
- spec/models/table_spec.rb
|
493
540
|
- spec/spec_helper.rb
|
541
|
+
- spec/tasks/meta_reports_rake_spec.rb
|
494
542
|
- spec/test_3.2.sh
|
495
543
|
- spec/test_4.0.sh
|
496
544
|
- Guardfile
|
data/spec/dummy/README.rdoc
DELETED
@@ -1,261 +0,0 @@
|
|
1
|
-
== Welcome to Rails
|
2
|
-
|
3
|
-
Rails is a web-application framework that includes everything needed to create
|
4
|
-
database-backed web applications according to the Model-View-Control pattern.
|
5
|
-
|
6
|
-
This pattern splits the view (also called the presentation) into "dumb"
|
7
|
-
templates that are primarily responsible for inserting pre-built data in between
|
8
|
-
HTML tags. The model contains the "smart" domain objects (such as Account,
|
9
|
-
Product, Person, Post) that holds all the business logic and knows how to
|
10
|
-
persist themselves to a database. The controller handles the incoming requests
|
11
|
-
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
12
|
-
and directing data to the view.
|
13
|
-
|
14
|
-
In Rails, the model is handled by what's called an object-relational mapping
|
15
|
-
layer entitled Active Record. This layer allows you to present the data from
|
16
|
-
database rows as objects and embellish these data objects with business logic
|
17
|
-
methods. You can read more about Active Record in
|
18
|
-
link:files/vendor/rails/activerecord/README.html.
|
19
|
-
|
20
|
-
The controller and view are handled by the Action Pack, which handles both
|
21
|
-
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
-
are bundled in a single package due to their heavy interdependence. This is
|
23
|
-
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
-
more separate. Each of these packages can be used independently outside of
|
25
|
-
Rails. You can read more about Action Pack in
|
26
|
-
link:files/vendor/rails/actionpack/README.html.
|
27
|
-
|
28
|
-
|
29
|
-
== Getting Started
|
30
|
-
|
31
|
-
1. At the command prompt, create a new Rails application:
|
32
|
-
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
|
33
|
-
|
34
|
-
2. Change directory to <tt>myapp</tt> and start the web server:
|
35
|
-
<tt>cd myapp; rails server</tt> (run with --help for options)
|
36
|
-
|
37
|
-
3. Go to http://localhost:3000/ and you'll see:
|
38
|
-
"Welcome aboard: You're riding Ruby on Rails!"
|
39
|
-
|
40
|
-
4. Follow the guidelines to start developing your application. You can find
|
41
|
-
the following resources handy:
|
42
|
-
|
43
|
-
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
|
44
|
-
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
|
45
|
-
|
46
|
-
|
47
|
-
== Debugging Rails
|
48
|
-
|
49
|
-
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
50
|
-
will help you debug it and get it back on the rails.
|
51
|
-
|
52
|
-
First area to check is the application log files. Have "tail -f" commands
|
53
|
-
running on the server.log and development.log. Rails will automatically display
|
54
|
-
debugging and runtime information to these files. Debugging info will also be
|
55
|
-
shown in the browser on requests from 127.0.0.1.
|
56
|
-
|
57
|
-
You can also log your own messages directly into the log file from your code
|
58
|
-
using the Ruby logger class from inside your controllers. Example:
|
59
|
-
|
60
|
-
class WeblogController < ActionController::Base
|
61
|
-
def destroy
|
62
|
-
@weblog = Weblog.find(params[:id])
|
63
|
-
@weblog.destroy
|
64
|
-
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
The result will be a message in your log file along the lines of:
|
69
|
-
|
70
|
-
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
|
71
|
-
|
72
|
-
More information on how to use the logger is at http://www.ruby-doc.org/core/
|
73
|
-
|
74
|
-
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
|
75
|
-
several books available online as well:
|
76
|
-
|
77
|
-
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
|
78
|
-
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
|
79
|
-
|
80
|
-
These two books will bring you up to speed on the Ruby language and also on
|
81
|
-
programming in general.
|
82
|
-
|
83
|
-
|
84
|
-
== Debugger
|
85
|
-
|
86
|
-
Debugger support is available through the debugger command when you start your
|
87
|
-
Mongrel or WEBrick server with --debugger. This means that you can break out of
|
88
|
-
execution at any point in the code, investigate and change the model, and then,
|
89
|
-
resume execution! You need to install ruby-debug to run the server in debugging
|
90
|
-
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
91
|
-
|
92
|
-
class WeblogController < ActionController::Base
|
93
|
-
def index
|
94
|
-
@posts = Post.all
|
95
|
-
debugger
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
So the controller will accept the action, run the first line, then present you
|
100
|
-
with a IRB prompt in the server window. Here you can do things like:
|
101
|
-
|
102
|
-
>> @posts.inspect
|
103
|
-
=> "[#<Post:0x14a6be8
|
104
|
-
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
|
105
|
-
#<Post:0x14a6620
|
106
|
-
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
|
107
|
-
>> @posts.first.title = "hello from a debugger"
|
108
|
-
=> "hello from a debugger"
|
109
|
-
|
110
|
-
...and even better, you can examine how your runtime objects actually work:
|
111
|
-
|
112
|
-
>> f = @posts.first
|
113
|
-
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
114
|
-
>> f.
|
115
|
-
Display all 152 possibilities? (y or n)
|
116
|
-
|
117
|
-
Finally, when you're ready to resume execution, you can enter "cont".
|
118
|
-
|
119
|
-
|
120
|
-
== Console
|
121
|
-
|
122
|
-
The console is a Ruby shell, which allows you to interact with your
|
123
|
-
application's domain model. Here you'll have all parts of the application
|
124
|
-
configured, just like it is when the application is running. You can inspect
|
125
|
-
domain models, change values, and save to the database. Starting the script
|
126
|
-
without arguments will launch it in the development environment.
|
127
|
-
|
128
|
-
To start the console, run <tt>rails console</tt> from the application
|
129
|
-
directory.
|
130
|
-
|
131
|
-
Options:
|
132
|
-
|
133
|
-
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
|
134
|
-
made to the database.
|
135
|
-
* Passing an environment name as an argument will load the corresponding
|
136
|
-
environment. Example: <tt>rails console production</tt>.
|
137
|
-
|
138
|
-
To reload your controllers and models after launching the console run
|
139
|
-
<tt>reload!</tt>
|
140
|
-
|
141
|
-
More information about irb can be found at:
|
142
|
-
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
|
-
|
144
|
-
|
145
|
-
== dbconsole
|
146
|
-
|
147
|
-
You can go to the command line of your database directly through <tt>rails
|
148
|
-
dbconsole</tt>. You would be connected to the database with the credentials
|
149
|
-
defined in database.yml. Starting the script without arguments will connect you
|
150
|
-
to the development database. Passing an argument will connect you to a different
|
151
|
-
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
|
152
|
-
PostgreSQL and SQLite 3.
|
153
|
-
|
154
|
-
== Description of Contents
|
155
|
-
|
156
|
-
The default directory structure of a generated Ruby on Rails application:
|
157
|
-
|
158
|
-
|-- app
|
159
|
-
| |-- assets
|
160
|
-
| | |-- images
|
161
|
-
| | |-- javascripts
|
162
|
-
| | `-- stylesheets
|
163
|
-
| |-- controllers
|
164
|
-
| |-- helpers
|
165
|
-
| |-- mailers
|
166
|
-
| |-- models
|
167
|
-
| `-- views
|
168
|
-
| `-- layouts
|
169
|
-
|-- config
|
170
|
-
| |-- environments
|
171
|
-
| |-- initializers
|
172
|
-
| `-- locales
|
173
|
-
|-- db
|
174
|
-
|-- doc
|
175
|
-
|-- lib
|
176
|
-
| |-- assets
|
177
|
-
| `-- tasks
|
178
|
-
|-- log
|
179
|
-
|-- public
|
180
|
-
|-- script
|
181
|
-
|-- test
|
182
|
-
| |-- fixtures
|
183
|
-
| |-- functional
|
184
|
-
| |-- integration
|
185
|
-
| |-- performance
|
186
|
-
| `-- unit
|
187
|
-
|-- tmp
|
188
|
-
| `-- cache
|
189
|
-
| `-- assets
|
190
|
-
`-- vendor
|
191
|
-
|-- assets
|
192
|
-
| |-- javascripts
|
193
|
-
| `-- stylesheets
|
194
|
-
`-- plugins
|
195
|
-
|
196
|
-
app
|
197
|
-
Holds all the code that's specific to this particular application.
|
198
|
-
|
199
|
-
app/assets
|
200
|
-
Contains subdirectories for images, stylesheets, and JavaScript files.
|
201
|
-
|
202
|
-
app/controllers
|
203
|
-
Holds controllers that should be named like weblogs_controller.rb for
|
204
|
-
automated URL mapping. All controllers should descend from
|
205
|
-
ApplicationController which itself descends from ActionController::Base.
|
206
|
-
|
207
|
-
app/models
|
208
|
-
Holds models that should be named like post.rb. Models descend from
|
209
|
-
ActiveRecord::Base by default.
|
210
|
-
|
211
|
-
app/views
|
212
|
-
Holds the template files for the view that should be named like
|
213
|
-
weblogs/index.html.erb for the WeblogsController#index action. All views use
|
214
|
-
eRuby syntax by default.
|
215
|
-
|
216
|
-
app/views/layouts
|
217
|
-
Holds the template files for layouts to be used with views. This models the
|
218
|
-
common header/footer method of wrapping views. In your views, define a layout
|
219
|
-
using the <tt>layout :default</tt> and create a file named default.html.erb.
|
220
|
-
Inside default.html.erb, call <% yield %> to render the view using this
|
221
|
-
layout.
|
222
|
-
|
223
|
-
app/helpers
|
224
|
-
Holds view helpers that should be named like weblogs_helper.rb. These are
|
225
|
-
generated for you automatically when using generators for controllers.
|
226
|
-
Helpers can be used to wrap functionality for your views into methods.
|
227
|
-
|
228
|
-
config
|
229
|
-
Configuration files for the Rails environment, the routing map, the database,
|
230
|
-
and other dependencies.
|
231
|
-
|
232
|
-
db
|
233
|
-
Contains the database schema in schema.rb. db/migrate contains all the
|
234
|
-
sequence of Migrations for your schema.
|
235
|
-
|
236
|
-
doc
|
237
|
-
This directory is where your application documentation will be stored when
|
238
|
-
generated using <tt>rake doc:app</tt>
|
239
|
-
|
240
|
-
lib
|
241
|
-
Application specific libraries. Basically, any kind of custom code that
|
242
|
-
doesn't belong under controllers, models, or helpers. This directory is in
|
243
|
-
the load path.
|
244
|
-
|
245
|
-
public
|
246
|
-
The directory available for the web server. Also contains the dispatchers and the
|
247
|
-
default HTML files. This should be set as the DOCUMENT_ROOT of your web
|
248
|
-
server.
|
249
|
-
|
250
|
-
script
|
251
|
-
Helper scripts for automation and generation.
|
252
|
-
|
253
|
-
test
|
254
|
-
Unit and functional tests along with fixtures. When using the rails generate
|
255
|
-
command, template test files will be generated for you and placed in this
|
256
|
-
directory.
|
257
|
-
|
258
|
-
vendor
|
259
|
-
External libraries that the application depends on. Also includes the plugins
|
260
|
-
subdirectory. If the app has frozen rails, those gems also go here, under
|
261
|
-
vendor/rails/. This directory is in the load path.
|