heart 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +21 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/images/heart/add.png +0 -0
- data/app/assets/images/heart/bluestar.png +0 -0
- data/app/assets/images/heart/bricks.png +0 -0
- data/app/assets/images/heart/bricks_off.png +0 -0
- data/app/assets/images/heart/chart_bar.png +0 -0
- data/app/assets/images/heart/chart_bar_off.png +0 -0
- data/app/assets/images/heart/chart_curve.png +0 -0
- data/app/assets/images/heart/chart_curve_off.png +0 -0
- data/app/assets/images/heart/chart_line.png +0 -0
- data/app/assets/images/heart/chart_line_off.png +0 -0
- data/app/assets/images/heart/chart_pie.png +0 -0
- data/app/assets/images/heart/chart_pie_off.png +0 -0
- data/app/assets/images/heart/collapse.png +0 -0
- data/app/assets/images/heart/dashboard.png +0 -0
- data/app/assets/images/heart/delete.png +0 -0
- data/app/assets/images/heart/disk.png +0 -0
- data/app/assets/images/heart/expand.png +0 -0
- data/app/assets/images/heart/jp.png +0 -0
- data/app/assets/images/heart/page_white_excel.png +0 -0
- data/app/assets/images/heart/paintcan.png +0 -0
- data/app/assets/images/heart/paintcan_off.png +0 -0
- data/app/assets/images/heart/pencil.png +0 -0
- data/app/assets/images/heart/picture.png +0 -0
- data/app/assets/images/heart/table.png +0 -0
- data/app/assets/images/heart/tag.png +0 -0
- data/app/assets/images/heart/tooltip/columnBg.png +0 -0
- data/app/assets/images/heart/tooltip/columnTop.gif +0 -0
- data/app/assets/images/heart/tooltip/tipBtm.png +0 -0
- data/app/assets/images/heart/tooltip/tipBtm280.png +0 -0
- data/app/assets/images/heart/tooltip/tipBtm280b.png +0 -0
- data/app/assets/images/heart/tooltip/tipMid.png +0 -0
- data/app/assets/images/heart/tooltip/tipMid280.png +0 -0
- data/app/assets/images/heart/tooltip/tipMid280b.png +0 -0
- data/app/assets/images/heart/tooltip/tipMid280g.png +0 -0
- data/app/assets/images/heart/tooltip/tipMid280w.png +0 -0
- data/app/assets/images/heart/tooltip/tipTop.png +0 -0
- data/app/assets/images/heart/tooltip/tipTop280.png +0 -0
- data/app/assets/images/heart/tooltip/tipTop280b.png +0 -0
- data/app/assets/images/heart/us.png +0 -0
- data/app/assets/images/heart/zoom.png +0 -0
- data/app/assets/images/heart/zoom_off.png +0 -0
- data/app/assets/javascripts/heart/application.js +201 -0
- data/app/assets/javascripts/heart/flot/jquery.colorhelpers.min.js +1 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.annotate.js +136 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.crosshair.min.js +1 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.fillbetween.js +183 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.growing.js +140 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.js +2651 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.navigate.js +336 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.pie.js +751 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.resize.js +60 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.selection.min.js +1 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.stack.min.js +1 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.symbols.js +85 -0
- data/app/assets/javascripts/heart/flot/jquery.flot.threshold.min.js +1 -0
- data/app/assets/javascripts/heart/heart.js +664 -0
- data/app/assets/javascripts/heart/jquery-1-5-2.js +16 -0
- data/app/assets/javascripts/heart/jquery-ui-1.8.7.custom.min.js +781 -0
- data/app/assets/javascripts/heart/jquery.betterTooltip.js +108 -0
- data/app/assets/javascripts/heart/json2.js +480 -0
- data/app/assets/stylesheets/heart/application.css +13 -0
- data/app/assets/stylesheets/heart/bluetrip/css/ie.css +29 -0
- data/app/assets/stylesheets/heart/bluetrip/css/print.css +46 -0
- data/app/assets/stylesheets/heart/bluetrip/css/screen.css +321 -0
- data/app/assets/stylesheets/heart/bluetrip/images/grid.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/grid.psd +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/cross.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/doc.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/email.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/external.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/feed.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/im.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/information.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/key.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/pdf.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/tick.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/visited.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/icons/xls.png +0 -0
- data/app/assets/stylesheets/heart/bluetrip/images/test-small.jpg +0 -0
- data/app/assets/stylesheets/heart/buttons.css +821 -0
- data/app/assets/stylesheets/heart/heart.css.erb +480 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_flat_55_999999_40x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_flat_75_aaaaaa_40x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_glass_45_0078ae_1x400.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_glass_55_f8da4e_1x400.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_glass_75_79c9ec_1x400.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_0078ae_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_056b93_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_e0fdff_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_f5e175_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_f7a50d_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/images/ui-icons_fcd113_256x240.png +0 -0
- data/app/assets/stylesheets/heart/start/jquery-ui-1.8.7.custom.css +572 -0
- data/app/controllers/heart/annotations_controller.rb +22 -0
- data/app/controllers/heart/application_controller.rb +21 -0
- data/app/controllers/heart/dashboards_controller.rb +85 -0
- data/app/controllers/heart/images_controller.rb +19 -0
- data/app/controllers/heart/metrics_controller.rb +35 -0
- data/app/helpers/heart/application_helper.rb +13 -0
- data/app/helpers/heart/dashboards_helper.rb +106 -0
- data/app/models/heart/annotation.rb +19 -0
- data/app/models/heart/application.rb +5 -0
- data/app/models/heart/dashboard.rb +6 -0
- data/app/models/heart/image.rb +5 -0
- data/app/models/heart/isometric.rb +8 -0
- data/app/models/heart/metric.rb +138 -0
- data/app/views/heart/annotations/create.js.haml +1 -0
- data/app/views/heart/annotations/description.js.haml +2 -0
- data/app/views/heart/dashboards/_annotation.haml +13 -0
- data/app/views/heart/dashboards/_dashblock.haml +17 -0
- data/app/views/heart/dashboards/_dashboard_form.html.haml +89 -0
- data/app/views/heart/dashboards/_graph_options.html.haml +24 -0
- data/app/views/heart/dashboards/_heart_form.html.haml +100 -0
- data/app/views/heart/dashboards/default.html.haml +32 -0
- data/app/views/heart/dashboards/edit.html.haml +14 -0
- data/app/views/heart/dashboards/flotit.js.haml +6 -0
- data/app/views/heart/dashboards/index.html.haml +19 -0
- data/app/views/heart/dashboards/new.html.haml +3 -0
- data/app/views/heart/dashboards/show.html.haml +65 -0
- data/app/views/heart/metrics/cache.html.haml +3 -0
- data/app/views/heart/metrics/fetch.html.haml +2 -0
- data/app/views/heart/metrics/index.html.haml +12 -0
- data/app/views/heart/metrics/show.html.haml +25 -0
- data/app/views/layouts/heart_engine.html.haml +88 -0
- data/config/cucumber.yml +8 -0
- data/config/locales/en.yml +63 -0
- data/config/locales/ja.yml +63 -0
- data/config/routes.rb +25 -0
- data/db/migrate/20130902050854_create_heart_metrics.rb +16 -0
- data/db/migrate/20130902051427_create_heart_isometrics.rb +9 -0
- data/db/migrate/20130902080256_create_heart_dashboards.rb +13 -0
- data/db/migrate/20130902080823_create_heart_annotations.rb +10 -0
- data/db/migrate/20130902081206_create_heart_images.rb +11 -0
- data/lib/heart/engine.rb +22 -0
- data/lib/heart/version.rb +3 -0
- data/lib/heart.rb +4 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/tasks/heart_tasks.rake +85 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +21 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130902083555_create_heart_metrics.heart.rb +17 -0
- data/test/dummy/db/migrate/20130902083556_create_heart_isometrics.heart.rb +10 -0
- data/test/dummy/db/migrate/20130902083557_create_heart_dashboards.heart.rb +14 -0
- data/test/dummy/db/migrate/20130902083558_create_heart_annotations.heart.rb +11 -0
- data/test/dummy/db/migrate/20130902083559_create_heart_images.heart.rb +12 -0
- data/test/dummy/db/migrate/20130902083560_create_heart_configurations.heart.rb +12 -0
- data/test/dummy/db/migrate/20130902084029_add_posts_new_to_metrics.rb +10 -0
- data/test/dummy/db/schema.rb +76 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/features/dashboards/overview.feature +39 -0
- data/test/dummy/features/language_switching.feature +12 -0
- data/test/dummy/features/link_to_this.feature +6 -0
- data/test/dummy/features/metrics/exporting.feature +13 -0
- data/test/dummy/features/metrics/fetching.feature +0 -0
- data/test/dummy/features/metrics/graphing.feature +13 -0
- data/test/dummy/features/metrics/summing.feature +0 -0
- data/test/dummy/features/step_definitions/dashboard_steps.rb +76 -0
- data/test/dummy/features/step_definitions/exporting_steps.rb +24 -0
- data/test/dummy/features/step_definitions/generic_steps.rb.example +101 -0
- data/test/dummy/features/step_definitions/graphing_steps.rb +37 -0
- data/test/dummy/features/step_definitions/language_switching_steps.rb +26 -0
- data/test/dummy/features/step_definitions/link_to_steps.rb +12 -0
- data/test/dummy/features/support/env.rb +64 -0
- data/test/dummy/features/support/factories.rb +16 -0
- data/test/dummy/features/support/hooks.rb +3 -0
- data/test/dummy/features/support/world_extensions.rb +1 -0
- data/test/dummy/log/development.log +549 -0
- data/test/dummy/log/test.log +19866 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/tmp/cache/assets/B7A/D60/sprockets%2F12305388866122331aea456101382236 +0 -0
- data/test/dummy/tmp/cache/assets/BE3/050/sprockets%2F0421426926cdd29806245aa078142462 +0 -0
- data/test/dummy/tmp/cache/assets/C3E/2A0/sprockets%2Fe37f35746618667d995a3587734e1f14 +0 -0
- data/test/dummy/tmp/cache/assets/C4F/0C0/sprockets%2Fb0695bc459d01217161ae9028368b856 +0 -0
- data/test/dummy/tmp/cache/assets/C57/200/sprockets%2F2e442476c863f14144881e259b1b597a +0 -0
- data/test/dummy/tmp/cache/assets/C61/A80/sprockets%2F7f20dd76170d803754a3085694f669e6 +0 -0
- data/test/dummy/tmp/cache/assets/C6B/710/sprockets%2F61a084f53ca308b115c54491f5b38120 +0 -0
- data/test/dummy/tmp/cache/assets/C76/680/sprockets%2Fb72c325230e403c89a229efd94013438 +0 -0
- data/test/dummy/tmp/cache/assets/C7D/AD0/sprockets%2Fa702e8b86f4697101583ea24307b7a53 +0 -0
- data/test/dummy/tmp/cache/assets/C81/4B0/sprockets%2F115a9d464b8720982880ad4926aaf505 +0 -0
- data/test/dummy/tmp/cache/assets/C83/670/sprockets%2F125f9496da25b06ace8951e752253273 +0 -0
- data/test/dummy/tmp/cache/assets/C86/DC0/sprockets%2F26269d2349fba3c41619fe3e88363044 +0 -0
- data/test/dummy/tmp/cache/assets/CA6/170/sprockets%2F6e0bb6a54c8f40c3419b183772c73331 +0 -0
- data/test/dummy/tmp/cache/assets/CAF/B10/sprockets%2F68ee8201881a1c1d3d987490e5015ed0 +0 -0
- data/test/dummy/tmp/cache/assets/CB6/080/sprockets%2F735f5d59ce0703357780bf4a574490ca +0 -0
- data/test/dummy/tmp/cache/assets/CB6/490/sprockets%2Fc4b6a866f5d3627d2a186e2095e60717 +0 -0
- data/test/dummy/tmp/cache/assets/CB9/9E0/sprockets%2F7a20a269f11f7331c8a56908c68f18d9 +0 -0
- data/test/dummy/tmp/cache/assets/CBB/950/sprockets%2F575827e14ba8d9920284eae267874ca1 +0 -0
- data/test/dummy/tmp/cache/assets/CBE/3A0/sprockets%2F73bdae55823e56e6f3796265941b36d1 +0 -0
- data/test/dummy/tmp/cache/assets/CC2/A70/sprockets%2F99163775fcea80cf5530f8808188e40b +0 -0
- data/test/dummy/tmp/cache/assets/CCB/970/sprockets%2F472690f680dd7d91690ebf603f7685e8 +0 -0
- data/test/dummy/tmp/cache/assets/CCB/CA0/sprockets%2F9b705933be3255cfd4938a9c99146e69 +0 -0
- data/test/dummy/tmp/cache/assets/CCF/FE0/sprockets%2Fea0015147c89d0181ba9460464bbf08c +0 -0
- data/test/dummy/tmp/cache/assets/CD1/1C0/sprockets%2F675a331d19ae21eaa532b27aa7606955 +0 -0
- data/test/dummy/tmp/cache/assets/CD1/320/sprockets%2Fb09e869800e3e0a0d7805d4c1c7113d1 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/1C0/sprockets%2F9a8012934e9d2f70a66c43310e3e44ab +0 -0
- data/test/dummy/tmp/cache/assets/CD7/270/sprockets%2F3bc51cb676bca1416770598d28109fa0 +0 -0
- data/test/dummy/tmp/cache/assets/CE0/E50/sprockets%2F9814922a41a67b828e462b31accb38f8 +0 -0
- data/test/dummy/tmp/cache/assets/CE3/A70/sprockets%2F87a37405e84d5a30dd672cf6148ec119 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/050/sprockets%2F21d0ae6e0a782753af4ed2492e959671 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/D80/sprockets%2Fa98448b0f9e10bf393a552d26664d7a3 +0 -0
- data/test/dummy/tmp/cache/assets/CE7/F80/sprockets%2F7715072387d4d8e6193c2ffda13a375f +0 -0
- data/test/dummy/tmp/cache/assets/CE8/890/sprockets%2F394187006c387afef0429558db43bf4e +0 -0
- data/test/dummy/tmp/cache/assets/CE8/CE0/sprockets%2F5c698abb053124d9a5421666bf75c8f8 +0 -0
- data/test/dummy/tmp/cache/assets/CF1/7B0/sprockets%2Fa447299b5fa19244e6a281825f9e77dc +0 -0
- data/test/dummy/tmp/cache/assets/CF1/CD0/sprockets%2Fd06db0e7d91462ed5ea64694583797e2 +0 -0
- data/test/dummy/tmp/cache/assets/CF2/070/sprockets%2Fca7b20d93194b5827d9d57837578b6db +0 -0
- data/test/dummy/tmp/cache/assets/CF2/C20/sprockets%2F7b5779909f4f5440c9d0874af23d63db +0 -0
- data/test/dummy/tmp/cache/assets/CF4/B20/sprockets%2F604291e761acf24ffb2998f369b176e8 +0 -0
- data/test/dummy/tmp/cache/assets/CF6/220/sprockets%2F06bd95eb7a76f96eb2d8c54782607745 +0 -0
- data/test/dummy/tmp/cache/assets/CFD/E70/sprockets%2F6cb7d8f69c8c4e1f246868d46f017639 +0 -0
- data/test/dummy/tmp/cache/assets/D00/5C0/sprockets%2F9abbd043d031592a556306748dbaeb26 +0 -0
- data/test/dummy/tmp/cache/assets/D02/000/sprockets%2F842565584accd26c5572aa1d15b3bb35 +0 -0
- data/test/dummy/tmp/cache/assets/D02/7C0/sprockets%2Fa4900a35834e0ab16a2ae17b6887a66d +0 -0
- data/test/dummy/tmp/cache/assets/D04/920/sprockets%2F5830c0ccdb2a54d7848283d21f44e2a4 +0 -0
- data/test/dummy/tmp/cache/assets/D05/FC0/sprockets%2Fd06631201fe7c8760eea1e3ffd351191 +0 -0
- data/test/dummy/tmp/cache/assets/D06/8C0/sprockets%2Faae533655b6c51d0b999ce29015c4c03 +0 -0
- data/test/dummy/tmp/cache/assets/D0B/350/sprockets%2F58255cc783163fa49e6caa32e01af293 +0 -0
- data/test/dummy/tmp/cache/assets/D0E/560/sprockets%2Ffb853b302b8b8338911fd212f3e9d65a +0 -0
- data/test/dummy/tmp/cache/assets/D0F/340/sprockets%2F81d96cf056d0ab1856c588f181b21fe0 +0 -0
- data/test/dummy/tmp/cache/assets/D18/460/sprockets%2Fb0145de92306b4c1bedc53aa0030e522 +0 -0
- data/test/dummy/tmp/cache/assets/D19/710/sprockets%2F90db64737e5b2ef37757b1cc2e52909d +0 -0
- data/test/dummy/tmp/cache/assets/D1C/270/sprockets%2F1475adbe1d4ec03f947d379865d477b3 +0 -0
- data/test/dummy/tmp/cache/assets/D27/770/sprockets%2Fa10a1cef30d33ecec13933b36280c548 +0 -0
- data/test/dummy/tmp/cache/assets/D27/7B0/sprockets%2F6401357b67027ace91aae0cbcf5e4021 +0 -0
- data/test/dummy/tmp/cache/assets/D2B/700/sprockets%2Fe90d34a411e79a9d1b510ae04c80e04e +0 -0
- data/test/dummy/tmp/cache/assets/D34/100/sprockets%2F504aeb3e34faa21a7c9fa726264934d3 +0 -0
- data/test/dummy/tmp/cache/assets/D35/560/sprockets%2Fa79fc4b2a2293acaa002547e93d9704e +0 -0
- data/test/dummy/tmp/cache/assets/D35/F80/sprockets%2Ffb91b5a46525f11e9f6658a0daa005d4 +0 -0
- data/test/dummy/tmp/cache/assets/D38/A70/sprockets%2F56d65a0db0739f5f1a215bde93528f0a +0 -0
- data/test/dummy/tmp/cache/assets/D3A/A50/sprockets%2F1edbcb279564b5c4a85c13aa6940b279 +0 -0
- data/test/dummy/tmp/cache/assets/D3B/A10/sprockets%2F2cecd599ad2374ea47112715ae70ea49 +0 -0
- data/test/dummy/tmp/cache/assets/D3B/CF0/sprockets%2F4cac58b5d3abf581ca5857583017d3e1 +0 -0
- data/test/dummy/tmp/cache/assets/D3B/EF0/sprockets%2F996d2466d00c1bacc4351f87e2d5e62a +0 -0
- data/test/dummy/tmp/cache/assets/D3E/410/sprockets%2F4d2270e9821b7d9658df04c4adbdf214 +0 -0
- data/test/dummy/tmp/cache/assets/D43/FC0/sprockets%2F7f972ba9de00917d116bfc1c7126e8d6 +0 -0
- data/test/dummy/tmp/cache/assets/D4A/E50/sprockets%2Fa876a03aed98118f76cac6e916ff5423 +0 -0
- data/test/dummy/tmp/cache/assets/D4B/310/sprockets%2F3402fd809cbee959fdb8db9950a37342 +0 -0
- data/test/dummy/tmp/cache/assets/D4C/E60/sprockets%2Fcd389726cc723176e5547ac75cc3fbc8 +0 -0
- data/test/dummy/tmp/cache/assets/D52/590/sprockets%2Fae4195e4fc883e26b828d9c7b525ff42 +0 -0
- data/test/dummy/tmp/cache/assets/D52/730/sprockets%2Fd92d03a100128cafe40eb231c3c77ba9 +0 -0
- data/test/dummy/tmp/cache/assets/D53/4E0/sprockets%2F6b5c3667b962d3740c9de6a5b9bfc948 +0 -0
- data/test/dummy/tmp/cache/assets/D59/B40/sprockets%2F29c73ae2b2a2dcf81b5210703eeed252 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/5F0/sprockets%2Fa03a93be0c8545371de91a5cab10fe52 +0 -0
- data/test/dummy/tmp/cache/assets/D5D/820/sprockets%2F60c2f35af5ce8dc4ab2a724043fd0373 +0 -0
- data/test/dummy/tmp/cache/assets/D5D/C10/sprockets%2Fa56376015a3d663ddeb1c90e3faa901b +0 -0
- data/test/dummy/tmp/cache/assets/D5E/030/sprockets%2Fb709d4ed36a3b17b21a42a66ae0098fb +0 -0
- data/test/dummy/tmp/cache/assets/D5F/6D0/sprockets%2Ff1f0426663c9048eceaa032dc3f05b5c +0 -0
- data/test/dummy/tmp/cache/assets/D64/540/sprockets%2F8b24e4230a33d44ed39d3d4ca015f7ff +0 -0
- data/test/dummy/tmp/cache/assets/D66/7D0/sprockets%2F6d2be390800b01686b6aeb7bba686c7b +0 -0
- data/test/dummy/tmp/cache/assets/D68/7F0/sprockets%2F35b0c94f2372250feee3c76a8bad07d4 +0 -0
- data/test/dummy/tmp/cache/assets/D69/F50/sprockets%2F0fe620b4cef107c5b770d70c5bbe6839 +0 -0
- data/test/dummy/tmp/cache/assets/D6A/630/sprockets%2F0e159a9bce743e35c180d0eceac52487 +0 -0
- data/test/dummy/tmp/cache/assets/D6F/120/sprockets%2F09730b5eed71a1971eb1ed85f0cd8c28 +0 -0
- data/test/dummy/tmp/cache/assets/D73/5A0/sprockets%2F726af59d1d3774cebabf5011f2a9955f +0 -0
- data/test/dummy/tmp/cache/assets/D76/410/sprockets%2F3ba75e6fe03df5d227c7e7a54be98720 +0 -0
- data/test/dummy/tmp/cache/assets/D76/750/sprockets%2F4422ff4ebec16419ef79a9a9d3f530f0 +0 -0
- data/test/dummy/tmp/cache/assets/D78/460/sprockets%2Ff8b234b2bfb694b85d927c693aba7d54 +0 -0
- data/test/dummy/tmp/cache/assets/D79/4F0/sprockets%2F0323ebeae0a56602aa023c9bb268b3ab +0 -0
- data/test/dummy/tmp/cache/assets/D7B/AF0/sprockets%2Fe1e0818c824997cffe5e04f2bff31e26 +0 -0
- data/test/dummy/tmp/cache/assets/D94/590/sprockets%2F95f6b48a4415cb3ab8acc4e0da36750d +0 -0
- data/test/dummy/tmp/cache/assets/D99/890/sprockets%2F783e81abd4c0cf96b0642acde9b7202f +0 -0
- data/test/dummy/tmp/cache/assets/D9A/FB0/sprockets%2F4bd1e3c2f82a72a0d6f8935ed92aeb60 +0 -0
- data/test/dummy/tmp/cache/assets/D9E/A00/sprockets%2Fdb6bd6ed1be390eb760409309a6d79ad +0 -0
- data/test/dummy/tmp/cache/assets/D9F/6D0/sprockets%2F6da6b2d77e0c546c69a3bb1720f9b9cd +0 -0
- data/test/dummy/tmp/cache/assets/DA1/050/sprockets%2F082944b24f4e6533ce0ce9fa64fadf5b +0 -0
- data/test/dummy/tmp/cache/assets/DA5/3B0/sprockets%2Fc5e9c4c0d3563ae2b49bf7cd67f458b1 +0 -0
- data/test/dummy/tmp/cache/assets/DAA/300/sprockets%2Ff4ebcefbb66ce3f58d70987c6123523e +0 -0
- data/test/dummy/tmp/cache/assets/DB1/C10/sprockets%2Fddabb257ba3637433fc7729f79fe6c9e +0 -0
- data/test/dummy/tmp/cache/assets/DB1/C90/sprockets%2Fdf909d50d7a568a1bc9dd9e47baf4973 +0 -0
- data/test/dummy/tmp/cache/assets/DB9/800/sprockets%2Fbd0a2a66976fd5ef12be3ac3e22d100e +0 -0
- data/test/dummy/tmp/cache/assets/DC2/1D0/sprockets%2F548c5a2d07c2b3db2eea9a24e2e25c9c +0 -0
- data/test/dummy/tmp/cache/assets/DC3/C30/sprockets%2F45d3db961ffaa14a7acb04d139f3ae93 +0 -0
- data/test/dummy/tmp/cache/assets/DC8/180/sprockets%2F44add687b1c02f2afd55b3dc9d58a04f +0 -0
- data/test/dummy/tmp/cache/assets/DCB/0A0/sprockets%2Ffec15e165ae6e45fe4d36b903fccf103 +0 -0
- data/test/dummy/tmp/cache/assets/DCC/6C0/sprockets%2F1dd6adb3594e3cf84ce35ea45114ead9 +0 -0
- data/test/dummy/tmp/cache/assets/DCD/350/sprockets%2F0a1ad87bab5ab47f377d5f87736acdd2 +0 -0
- data/test/dummy/tmp/cache/assets/DCD/ED0/sprockets%2Fe3e1abc488563aa8c2d44c9b8b5b2f6c +0 -0
- data/test/dummy/tmp/cache/assets/DD1/620/sprockets%2F3c34c92afb93cab6ab8f1640683ee8fd +0 -0
- data/test/dummy/tmp/cache/assets/DD2/2B0/sprockets%2Fcb959dcb42fe971fef3b07705a4de60b +0 -0
- data/test/dummy/tmp/cache/assets/DD4/DB0/sprockets%2Fd16e7fa5788cebf2c0335cfb5a94d5b5 +0 -0
- data/test/dummy/tmp/cache/assets/DDA/140/sprockets%2F9dab37c1f47e99ba86bf306fbed67c23 +0 -0
- data/test/dummy/tmp/cache/assets/DF0/C50/sprockets%2Fc3dee69afa21d4462d0fda717c2f5a1b +0 -0
- data/test/dummy/tmp/cache/assets/DF3/CE0/sprockets%2Fd413b4fcbf2a3afe3a2f96fb3b22349f +0 -0
- data/test/dummy/tmp/cache/assets/DF5/020/sprockets%2Ffdbfbdaa7be9bc2fa2824455b9f36200 +0 -0
- data/test/dummy/tmp/cache/assets/DFB/120/sprockets%2F56abeace37f20e8ed908bb19c26c73ca +0 -0
- data/test/dummy/tmp/cache/assets/DFE/9D0/sprockets%2Fdfd5d12ea923dd88dd2fb5c56c2a6a73 +0 -0
- data/test/dummy/tmp/cache/assets/E04/670/sprockets%2Fe9e9c736dab1268ea76aed2ba1cf51f9 +0 -0
- data/test/dummy/tmp/cache/assets/E11/620/sprockets%2Fb79efcee1bf9f7559d26cc36bcbd6481 +0 -0
- data/test/dummy/tmp/cache/assets/E15/B10/sprockets%2F8fded28e5dfea96f7f42212ee4de8d82 +0 -0
- data/test/dummy/tmp/cache/assets/E1E/A70/sprockets%2F4a6f52c1cf40efaf040aabe5eca74c86 +0 -0
- data/test/dummy/tmp/cache/assets/E2F/B60/sprockets%2F9e9f03eab43fa8aeeb4aa97f1dff2171 +0 -0
- data/test/dummy/tmp/cache/assets/E3E/D60/sprockets%2F51bfcacbab0f9acbbcd331e31e095c40 +0 -0
- data/test/dummy/tmp/cache/assets/E4E/FE0/sprockets%2Fee2cecebeb842cdbbcfc530d13d50546 +0 -0
- data/test/dummy/tmp/cache/assets/E50/170/sprockets%2Faa1cd6441f82b0f9bfa1baffe5ce3c81 +0 -0
- data/test/dummy/tmp/cache/assets/E54/7B0/sprockets%2F7eba769afbacdcd2b019e3ae52fdb093 +0 -0
- data/test/dummy/tmp/cache/assets/E6C/5E0/sprockets%2F48dce5eee43c4ec8f9daa25a7fb847be +0 -0
- data/test/dummy/tmp/cache/assets/E86/5D0/sprockets%2Fec1c00efc9e5ebfa6c0576eb1ddfd60d +0 -0
- data/test/dummy/tmp/cache/assets/E8A/510/sprockets%2F4dcf2d4f6fbfe6af61adafbed37240a8 +0 -0
- data/test/dummy/tmp/cache/assets/E91/E50/sprockets%2F6caf6f973c4dfd0a94ca97da0cbfb8da +0 -0
- data/test/dummy/tmp/cache/assets/F0C/2E0/sprockets%2Fbcad47aa7a1eda0cc0fdc3eac6cb99fd +0 -0
- data/test/fixtures/heart/annotations.yml +11 -0
- data/test/fixtures/heart/configurations.yml +11 -0
- data/test/fixtures/heart/dashboards.yml +11 -0
- data/test/fixtures/heart/images.yml +11 -0
- data/test/fixtures/heart/isometrics.yml +11 -0
- data/test/fixtures/heart/metrics.yml +11 -0
- data/test/functional/heart/annotations_controller_test.rb +9 -0
- data/test/functional/heart/dashboards_controller_test.rb +9 -0
- data/test/functional/heart/images_controller_test.rb +9 -0
- data/test/functional/heart/metrics_controller_test.rb +9 -0
- data/test/heart_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/heart/annotation_test.rb +9 -0
- data/test/unit/heart/configuration_test.rb +9 -0
- data/test/unit/heart/dashboard_test.rb +9 -0
- data/test/unit/heart/image_test.rb +9 -0
- data/test/unit/heart/isometric_test.rb +9 -0
- data/test/unit/heart/metric_test.rb +9 -0
- data/test/unit/helpers/heart/annotations_helper_test.rb +6 -0
- data/test/unit/helpers/heart/dashboards_helper_test.rb +6 -0
- data/test/unit/helpers/heart/images_helper_test.rb +6 -0
- data/test/unit/helpers/heart/metrics_helper_test.rb +6 -0
- metadata +791 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
9
|
+
|
10
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'cucumber/rake/task'
|
15
|
+
|
16
|
+
namespace :cucumber do
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
20
|
+
t.profile = 'default'
|
21
|
+
end
|
22
|
+
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
24
|
+
t.binary = vendored_cucumber_bin
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
26
|
+
t.profile = 'wip'
|
27
|
+
end
|
28
|
+
|
29
|
+
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
30
|
+
t.binary = vendored_cucumber_bin
|
31
|
+
t.fork = true # You may get faster startup if you set this to false
|
32
|
+
t.profile = 'rerun'
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'Run all features'
|
36
|
+
task :all => [:ok, :wip]
|
37
|
+
|
38
|
+
task :statsetup do
|
39
|
+
require 'rails/code_statistics'
|
40
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
41
|
+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
desc 'Alias for cucumber:ok'
|
45
|
+
task :cucumber => 'cucumber:ok'
|
46
|
+
|
47
|
+
task :default => :cucumber
|
48
|
+
|
49
|
+
task :features => :cucumber do
|
50
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
51
|
+
end
|
52
|
+
|
53
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
54
|
+
task 'db:test:prepare' do
|
55
|
+
end
|
56
|
+
|
57
|
+
task :stats => 'cucumber:statsetup'
|
58
|
+
rescue LoadError
|
59
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
60
|
+
task :cucumber do
|
61
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
namespace :heart do
|
2
|
+
namespace :metrics do
|
3
|
+
|
4
|
+
desc "Fetches all metrics for a particular date"
|
5
|
+
task :fetch_all => :environment do
|
6
|
+
unless ENV.include?("fulldate")
|
7
|
+
raise "usage: rake metrics:fetch_all fulldate=2011-01-01"
|
8
|
+
end
|
9
|
+
fulldate = Date.parse(ENV['fulldate'])
|
10
|
+
metric = Metric.find_or_create(fulldate,0)
|
11
|
+
metric.fetch_all
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Fetch a specific metric for all days between dates"
|
15
|
+
task :fetch_between => :environment do
|
16
|
+
unless ENV.include?("fulldate") && ENV.include?("fromdate") && ENV.include?("metric")
|
17
|
+
raise "usage: rake metrics:fetch_between fulldate=2011-01-01 fromdate=2010-12-01 metric=metricName"
|
18
|
+
end
|
19
|
+
fulldate = Date.parse(ENV['fulldate'])
|
20
|
+
fromdate = Date.parse(ENV['fromdate'])
|
21
|
+
metric_name = ENV['metric']
|
22
|
+
method = "fetch_" + metric_name.to_s
|
23
|
+
|
24
|
+
fromdate.upto(fulldate) do |date|
|
25
|
+
#first for the global metrics / all users
|
26
|
+
metric = Metric.find_or_create(date,0)
|
27
|
+
isometric = Isometric.find_or_create(date,0)
|
28
|
+
|
29
|
+
metric.send(method)
|
30
|
+
|
31
|
+
metric.save
|
32
|
+
isometric.send(metric_name+"=", Time.now) unless method == "fetch_all"
|
33
|
+
isometric.save unless method == "fetch_all"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Fetch metrics that were not previously fetched between specific dates."
|
38
|
+
task :fetch_missing => :environment do
|
39
|
+
unless ENV.include?("fulldate") && ENV.include?("fromdate")
|
40
|
+
raise "usage: rake metrics:fetch_missing fulldate=2011-01-01 fromdate=2010-12-01"
|
41
|
+
end
|
42
|
+
fulldate = Date.parse(ENV['fulldate'])
|
43
|
+
fromdate = Date.parse(ENV['fromdate'])
|
44
|
+
fromdate.upto(fulldate) do |date|
|
45
|
+
missing_metrics = []
|
46
|
+
isometric = Isometric.where("fulldate = ? and movingaverage = 0", date).first
|
47
|
+
isometric.attributes.each { |key,value| missing_metrics.push(key) if value.nil? }
|
48
|
+
|
49
|
+
metric = Metric.where("fulldate = ? and movingaverage = 0", date).first
|
50
|
+
missing_metrics.each do |missing|
|
51
|
+
fetch_method = "fetch_#{missing}"
|
52
|
+
if metric.respond_to?(fetch_method)
|
53
|
+
puts "#{fetch_method} for #{date}"
|
54
|
+
begin
|
55
|
+
metric.send(fetch_method)
|
56
|
+
metric.save
|
57
|
+
isometric.send("#{missing}=", Time.now)
|
58
|
+
isometric.save
|
59
|
+
rescue e
|
60
|
+
puts "#{fetch_method} exception on #{date}"
|
61
|
+
puts e.message
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Cache a moving average for a range of dates"
|
69
|
+
task :moving_average => :environment do
|
70
|
+
unless ENV.include?("fulldate") && ENV.include?("fromdate") && ENV.include?("average")
|
71
|
+
raise "usage: rake metrics:moving_average fulldate=2011-01-01 fromdate=2010-12-01 average=30"
|
72
|
+
end
|
73
|
+
fulldate = Date.parse(ENV['fulldate'])
|
74
|
+
fromdate = Date.parse(ENV['fromdate'])
|
75
|
+
movingaverage = (ENV['average'].nil?) ? 30 : ENV['average'].to_i
|
76
|
+
fromdate.upto(fulldate) do |date|
|
77
|
+
metric = Metric.find_or_create(date,movingaverage)
|
78
|
+
metric.save!
|
79
|
+
metric.moving_averages!(movingaverage)
|
80
|
+
metric.save
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end #end metrics namespace
|
85
|
+
end #end heart namespace
|
@@ -0,0 +1,261 @@
|
|
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.
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "heart"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
15
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
16
|
+
|
17
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
18
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
19
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
20
|
+
|
21
|
+
# Activate observers that should always be running.
|
22
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
23
|
+
|
24
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
25
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
26
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
27
|
+
|
28
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
29
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
30
|
+
# config.i18n.default_locale = :de
|
31
|
+
|
32
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
33
|
+
config.encoding = "utf-8"
|
34
|
+
|
35
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
36
|
+
config.filter_parameters += [:password]
|
37
|
+
|
38
|
+
# Enable escaping HTML in JSON.
|
39
|
+
config.active_support.escape_html_entities_in_json = true
|
40
|
+
|
41
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
42
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
43
|
+
# like if you have constraints or database-specific column types
|
44
|
+
# config.active_record.schema_format = :sql
|
45
|
+
|
46
|
+
# Enforce whitelist mode for mass assignment.
|
47
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
48
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
49
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
50
|
+
config.active_record.whitelist_attributes = true
|
51
|
+
|
52
|
+
# Enable the asset pipeline
|
53
|
+
config.assets.enabled = true
|
54
|
+
|
55
|
+
# Version of your assets, change this if you want to expire all your assets
|
56
|
+
config.assets.version = '1.0'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: mysql2
|
8
|
+
database: heart_dummy
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
password: new-password
|
12
|
+
|
13
|
+
# Warning: The database defined as "test" will be erased and
|
14
|
+
# re-generated from your development database when you run "rake".
|
15
|
+
# Do not set this db to the same as development or production.
|
16
|
+
test:
|
17
|
+
adapter: mysql2
|
18
|
+
database: heart_dummy_test
|
19
|
+
pool: 5
|
20
|
+
timeout: 5000
|
21
|
+
password: new-password
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
end
|