mitamirri 0.13.8 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/Capfile +4 -0
  2. data/Gemfile +29 -0
  3. data/README.rdoc +6 -55
  4. data/Rakefile +34 -21
  5. data/VERSION +1 -1
  6. data/app/controllers/admin/tracking/reports_controller.rb +78 -0
  7. data/app/controllers/admin/tracking/trackable_sessions_controller.rb +7 -0
  8. data/app/controllers/application_controller.rb +1 -8
  9. data/app/controllers/trackable_actions_controller.rb +0 -2
  10. data/app/helpers/application_helper.rb +21 -0
  11. data/app/helpers/layout_helper.rb +18 -0
  12. data/app/models/content_report.rb +35 -0
  13. data/app/models/content_stat.rb +4 -0
  14. data/app/models/destination.rb +4 -0
  15. data/app/models/intersite_traffic_report.rb +47 -0
  16. data/app/models/keyword_stat.rb +4 -0
  17. data/app/models/lead.rb +3 -0
  18. data/app/models/lead_stat.rb +5 -0
  19. data/app/models/leads_report.rb +32 -0
  20. data/app/models/location_stat.rb +37 -0
  21. data/app/models/referrer_stat.rb +4 -0
  22. data/app/models/report.rb +83 -0
  23. data/app/models/stat_base.rb +11 -0
  24. data/app/models/trackable_action.rb +114 -91
  25. data/app/models/trackable_base.rb +12 -0
  26. data/app/models/trackable_location.rb +7 -13
  27. data/app/models/trackable_session.rb +255 -171
  28. data/app/models/trackable_stat.rb +45 -27
  29. data/app/models/traffic_explorer_report.rb +92 -0
  30. data/app/models/traffic_summary_report.rb +142 -0
  31. data/app/models/user_agent_stat.rb +4 -0
  32. data/app/models/visit.rb +6 -0
  33. data/app/models/visit_stat.rb +5 -0
  34. data/app/models/visitor.rb +4 -0
  35. data/app/models/visitor_profile_report.rb +23 -0
  36. data/app/views/admin/tracking/reports/_content.html.erb +28 -0
  37. data/app/views/admin/tracking/reports/_conversion_rate.html.erb +30 -0
  38. data/app/views/admin/tracking/reports/_criteria.html.erb +33 -0
  39. data/app/views/admin/tracking/reports/_entrance_pages.html.erb +29 -0
  40. data/app/views/admin/tracking/reports/_exit_pages.html.erb +28 -0
  41. data/app/views/admin/tracking/reports/_explorer_criteria.html.erb +22 -0
  42. data/app/views/admin/tracking/reports/_explorer_summary.html.erb +22 -0
  43. data/app/views/admin/tracking/reports/_intersite_destinations.html.erb +28 -0
  44. data/app/views/admin/tracking/reports/_intersite_referrals.html.erb +30 -0
  45. data/app/views/admin/tracking/reports/_leads.html.erb +30 -0
  46. data/app/views/admin/tracking/reports/_locations.html.erb +47 -0
  47. data/app/views/admin/tracking/reports/_recent_visits.html.erb +33 -0
  48. data/app/views/admin/tracking/reports/_referring_keywords.html.erb +28 -0
  49. data/app/views/admin/tracking/reports/_referring_sites.html.erb +28 -0
  50. data/app/views/admin/tracking/reports/_traffic_summary.html.erb +26 -0
  51. data/app/views/admin/tracking/reports/_user_agents.html.erb +28 -0
  52. data/app/views/{trackable_sessions/_visits_graph.html.erb → admin/tracking/reports/_visits_by_kind.html.erb} +3 -3
  53. data/app/views/admin/tracking/reports/content.html.erb +12 -0
  54. data/app/views/admin/tracking/reports/explorer.html.erb +13 -0
  55. data/app/views/admin/tracking/reports/index.html.erb +16 -0
  56. data/app/views/admin/tracking/reports/intersite.html.erb +11 -0
  57. data/app/views/admin/tracking/reports/leads.html.erb +11 -0
  58. data/app/views/admin/tracking/reports/summary.html.erb +16 -0
  59. data/app/views/admin/tracking/reports/visitor_profile.html.erb +11 -0
  60. data/app/views/{trackable_sessions → admin/tracking/trackable_sessions}/show.html.erb +5 -4
  61. data/app/views/layouts/application.html.erb +51 -18
  62. data/config.ru +4 -0
  63. data/config/application.rb +13 -0
  64. data/config/boot.rb +13 -110
  65. data/config/cucumber.yml +10 -0
  66. data/config/deploy.rb +40 -0
  67. data/config/environment.rb +4 -23
  68. data/config/environments/development.rb +24 -13
  69. data/config/environments/production.rb +41 -20
  70. data/config/environments/test.rb +28 -24
  71. data/config/initializers/formats.rb +19 -0
  72. data/config/initializers/metric_fu.rb +9 -0
  73. data/config/initializers/secret_token.rb +7 -0
  74. data/config/initializers/session_store.rb +3 -10
  75. data/config/locales/en.yml +1 -1
  76. data/config/mongoid.yml +19 -0
  77. data/config/routes.rb +16 -10
  78. data/features/access_reports.feature +26 -0
  79. data/features/step_definitions/reports_steps.rb +9 -0
  80. data/features/step_definitions/web_steps.rb +219 -0
  81. data/features/support/env.rb +32 -0
  82. data/features/support/hooks.rb +1 -0
  83. data/features/support/paths.rb +33 -0
  84. data/features/traffic_summary_report.feature +43 -0
  85. data/init.rb +0 -7
  86. data/lib/mitamirri.rb +9 -12
  87. data/lib/mitamirri/engine.rb +7 -0
  88. data/lib/mitamirri/helper.rb +13 -29
  89. data/lib/mitamirri/railtie.rb +10 -0
  90. data/lib/tasks/cucumber.rake +60 -0
  91. data/lib/tasks/rcov.rake +44 -0
  92. data/mitamirri.gemspec +228 -100
  93. data/public/404.html +26 -0
  94. data/public/422.html +26 -0
  95. data/public/500.html +26 -0
  96. data/{config/database.yml → public/favicon.ico} +0 -0
  97. data/public/images/icons/add.png +0 -0
  98. data/public/images/icons/collapsed.gif +0 -0
  99. data/public/images/icons/delete.png +0 -0
  100. data/public/images/icons/drag.png +0 -0
  101. data/public/images/icons/edit.png +0 -0
  102. data/public/images/icons/expanded.gif +0 -0
  103. data/public/images/icons/help_icon.png +0 -0
  104. data/public/images/icons/link_icon.png +0 -0
  105. data/public/images/icons/move.png +0 -0
  106. data/public/images/icons/move_white.png +0 -0
  107. data/public/images/icons/note.png +0 -0
  108. data/public/images/icons/note_white.png +0 -0
  109. data/public/images/icons/notification_icon_sprite.png +0 -0
  110. data/public/images/icons/spinner.gif +0 -0
  111. data/public/images/icons/view.png +0 -0
  112. data/public/images/icons/warning.png +0 -0
  113. data/public/images/icons/warning_2.png +0 -0
  114. data/public/images/icons/warning_box.png +0 -0
  115. data/public/images/icons/warning_icon.png +0 -0
  116. data/public/images/icons/warning_white.png +0 -0
  117. data/public/images/layout/arrow_asc.png +0 -0
  118. data/public/images/layout/arrow_desc.png +0 -0
  119. data/public/images/layout/back.png +0 -0
  120. data/public/images/layout/black_bar.png +0 -0
  121. data/public/images/layout/branding.png +0 -0
  122. data/public/images/layout/breadcrumb_bg.png +0 -0
  123. data/public/images/layout/button_bg.png +0 -0
  124. data/public/images/layout/content_left_bg.png +0 -0
  125. data/public/images/layout/content_right_bg.png +0 -0
  126. data/public/images/layout/footer_bg.png +0 -0
  127. data/public/images/layout/h1_bg.png +0 -0
  128. data/public/images/layout/h2_bg.png +0 -0
  129. data/public/images/layout/h2_bg_for_table.png +0 -0
  130. data/public/images/layout/header_bg_grey.png +0 -0
  131. data/public/images/layout/header_bg_purple.png +0 -0
  132. data/public/images/layout/legend_bg.png +0 -0
  133. data/public/images/layout/menu_box_bg.png +0 -0
  134. data/public/images/layout/shadow_border.png +0 -0
  135. data/public/images/layout/shadow_border_2.png +0 -0
  136. data/public/images/layout/shadow_border_3.png +0 -0
  137. data/public/images/layout/shadow_border_4.png +0 -0
  138. data/public/images/layout/tab.png +0 -0
  139. data/public/images/layout/tab_active.png +0 -0
  140. data/public/images/layout/table_header.png +0 -0
  141. data/public/images/layout/text_field_bg.jpg +0 -0
  142. data/public/images/layout/text_field_error_bg.png +0 -0
  143. data/public/images/layout/th_bg.png +0 -0
  144. data/public/images/layout/th_bg_selected.png +0 -0
  145. data/public/images/menu_icons/content_report.png +0 -0
  146. data/public/images/menu_icons/content_report_on.png +0 -0
  147. data/public/images/menu_icons/funnel.png +0 -0
  148. data/public/images/menu_icons/funnel_on.png +0 -0
  149. data/public/images/menu_icons/intersite_traffic.png +0 -0
  150. data/public/images/menu_icons/intersite_traffic_on.png +0 -0
  151. data/public/images/menu_icons/leads.png +0 -0
  152. data/public/images/menu_icons/leads_on.png +0 -0
  153. data/public/images/menu_icons/traffic_explorer.png +0 -0
  154. data/public/images/menu_icons/traffic_explorer_on.png +0 -0
  155. data/public/images/menu_icons/traffic_summary.png +0 -0
  156. data/public/images/menu_icons/traffic_summary_on.png +0 -0
  157. data/public/images/menu_icons/visitor_profile.png +0 -0
  158. data/public/images/menu_icons/visitor_profile_on.png +0 -0
  159. data/public/index.html +8 -0
  160. data/public/javascripts/application.js +2 -0
  161. data/public/javascripts/controls.js +965 -0
  162. data/public/javascripts/dragdrop.js +974 -0
  163. data/public/javascripts/effects.js +1123 -0
  164. data/public/javascripts/prototype.js +6001 -0
  165. data/public/javascripts/rails.js +175 -0
  166. data/public/robots.txt +5 -0
  167. data/public/stylesheets/.gitkeep +0 -0
  168. data/public/stylesheets/application.css +876 -0
  169. data/public/stylesheets/core.css +1146 -0
  170. data/public/stylesheets/core_ie.css +52 -0
  171. data/public/stylesheets/csshover3.htc +14 -0
  172. data/public/stylesheets/mitamirri.css +37 -724
  173. data/public/stylesheets/mitamirri_print.css +3 -0
  174. data/script/cucumber +10 -0
  175. data/script/rails +6 -0
  176. data/spec/blueprints.rb +13 -0
  177. data/spec/helpers/application_helper_spec.rb +23 -35
  178. data/spec/{lib → models}/content_report_spec.rb +12 -8
  179. data/spec/{lib → models}/intersite_traffic_report_spec.rb +6 -9
  180. data/spec/{lib → models}/leads_report_spec.rb +11 -12
  181. data/spec/models/location_stat_spec.rb +18 -0
  182. data/spec/models/trackable_action_spec.rb +46 -14
  183. data/spec/models/trackable_base_spec.rb +27 -0
  184. data/spec/models/trackable_session_spec.rb +181 -57
  185. data/spec/{lib/session_report_spec.rb → models/traffic_explorer_report_spec.rb} +8 -25
  186. data/spec/spec_helper.rb +8 -28
  187. data/{lib/mitamirri/tasks.rb → tasks/mitamirri.rake} +6 -7
  188. data/vendor/plugins/.gitkeep +0 -0
  189. metadata +316 -77
  190. data/.gitignore +0 -26
  191. data/app/controllers/trackable_sessions_controller.rb +0 -100
  192. data/app/views/trackable_sessions/_keywords_graph.html.erb +0 -24
  193. data/app/views/trackable_sessions/_print_buttons.html.erb +0 -3
  194. data/app/views/trackable_sessions/_sessions.html.erb +0 -26
  195. data/app/views/trackable_sessions/_top_referrers.html.erb +0 -24
  196. data/app/views/trackable_sessions/_traffic_summary_all.html.erb +0 -64
  197. data/app/views/trackable_sessions/_traffic_summary_by_kind.html.erb +0 -48
  198. data/app/views/trackable_sessions/content.html.erb +0 -119
  199. data/app/views/trackable_sessions/explorer.html.erb +0 -67
  200. data/app/views/trackable_sessions/export.xls.erb +0 -5
  201. data/app/views/trackable_sessions/index.html.erb +0 -47
  202. data/app/views/trackable_sessions/intersite.html.erb +0 -97
  203. data/app/views/trackable_sessions/leads.html.erb +0 -98
  204. data/app/views/trackable_sessions/visitor_profile.html.erb +0 -114
  205. data/config/initializers/backtrace_silencers.rb +0 -7
  206. data/config/initializers/database.rb +0 -1
  207. data/config/initializers/inflections.rb +0 -10
  208. data/config/initializers/mime_types.rb +0 -5
  209. data/config/initializers/new_rails_defaults.rb +0 -21
  210. data/db/development.sqlite3 +0 -0
  211. data/db/migrate/20100810173533_create_trackable_sessions.rb +0 -23
  212. data/db/migrate/20100810173605_create_trackable_actions.rb +0 -20
  213. data/db/test.sqlite3 +0 -1
  214. data/lib/mitamirri/content_report.rb +0 -75
  215. data/lib/mitamirri/intersite_traffic_report.rb +0 -122
  216. data/lib/mitamirri/leads_report.rb +0 -90
  217. data/lib/mitamirri/session_report.rb +0 -219
  218. data/lib/mitamirri/stat_report.rb +0 -216
  219. data/lib/mitamirri/visitor_profile_report.rb +0 -127
  220. data/script/about +0 -4
  221. data/script/console +0 -3
  222. data/script/dbconsole +0 -3
  223. data/script/destroy +0 -3
  224. data/script/generate +0 -3
  225. data/script/performance/benchmarker +0 -3
  226. data/script/performance/profiler +0 -3
  227. data/script/plugin +0 -3
  228. data/script/runner +0 -3
  229. data/script/server +0 -3
  230. data/spec/controllers/trackable_actions_controller_spec.rb +0 -5
  231. data/spec/controllers/trackable_sessions_controller_spec.rb +0 -5
  232. data/spec/custom_matchers.rb +0 -23
  233. data/spec/lib/stat_report_spec.rb +0 -106
  234. data/spec/rcov.opts +0 -4
  235. data/spec/schema.rb +0 -34
  236. data/spec/spec.opts +0 -4
@@ -0,0 +1,11 @@
1
+ <%- set_title 'Intersite Report' -%>
2
+ <%= Seer::init_visualization.html_safe -%>
3
+
4
+ <%= render 'criteria' -%>
5
+
6
+ <br style="clear: both;" />
7
+
8
+ <%- if @report.ready? -%>
9
+ <%= render 'intersite_referrals' -%>
10
+ <%= render 'intersite_destinations' -%>
11
+ <%- end -%>
@@ -0,0 +1,11 @@
1
+ <%- set_title 'Leads Report' -%>
2
+ <%= Seer::init_visualization.html_safe -%>
3
+
4
+ <%= render 'criteria' -%>
5
+
6
+ <br style="clear: both;" />
7
+
8
+ <%- if @report.ready? -%>
9
+ <%= render 'leads' -%>
10
+ <%= render 'conversion_rate' -%>
11
+ <%- end -%>
@@ -0,0 +1,16 @@
1
+ <%- set_title 'Traffic Summary Report' -%>
2
+ <%= Seer::init_visualization.html_safe -%>
3
+
4
+ <%= render 'criteria' -%>
5
+
6
+ <br style="clear: both;" />
7
+
8
+ <%- if @report.ready? -%>
9
+ <%= render 'traffic_summary' -%>
10
+ <%= render 'visits_by_kind' -%>
11
+ <div class="page_break" /><p>(Continued on next page)</p></div>
12
+ <%= render 'referring_keywords' -%>
13
+ <%= render 'referring_sites' -%>
14
+ <div class="page_break" /><p>(Continued on next page)</p></div>
15
+ <%= render 'recent_visits' -%>
16
+ <%- end -%>
@@ -0,0 +1,11 @@
1
+ <%- set_title 'Visitor Profile Report' -%>
2
+ <%= Seer::init_visualization.html_safe -%>
3
+
4
+ <%= render 'criteria' -%>
5
+
6
+ <br style="clear: both;" />
7
+
8
+ <%- if @report.ready? -%>
9
+ <%= render 'user_agents' -%>
10
+ <%= render 'locations' -%>
11
+ <%- end -%>
@@ -1,4 +1,4 @@
1
- <%- title 'Session Details' -%>
1
+ <%- set_title 'Session Details' -%>
2
2
 
3
3
  <fieldset class="form_container">
4
4
  <%= legend_tag "Session Details" -%>
@@ -17,7 +17,7 @@
17
17
  </fieldset>
18
18
  <fieldset>
19
19
  <label>Date:</label><br />
20
- <div class="faux_field"><%=h @trackable_session.created_at.to_s(:date_time) %></div>
20
+ <div class="faux_field"><%=h @trackable_session.created_at.to_s(:short_date_time) %></div>
21
21
  </fieldset>
22
22
  </div>
23
23
  <div class="three_column">
@@ -73,7 +73,7 @@
73
73
  </fieldset>
74
74
  <fieldset>
75
75
  <label>Last Visit:</label><br />
76
- <div class="faux_field"><%=h @trackable_session.last_visit_date ? @trackable_session.last_visit_date : "Never" %></div>
76
+ <div class="faux_field"><%=h @trackable_session.last_visit_date ? @trackable_session.last_visit_date.to_s(:short_date_time) : "Never" %></div>
77
77
  </fieldset>
78
78
  </div>
79
79
  <div class="three_column">
@@ -90,9 +90,10 @@
90
90
 
91
91
  <fieldset class="form_container">
92
92
  <%= legend_tag "User Actions" -%>
93
+ <br />
93
94
  <table class="standard">
94
95
  <thead>
95
- <th>Time</th>
96
+ <th style="width: 100px;">Time</th>
96
97
  <th>URL</th>
97
98
  <th>Action</th>
98
99
  </thead>
@@ -1,20 +1,53 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title><%= yield(:title) -%></title>
5
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
6
+ <meta name="description" content="<%= yield(:meta_description) -%>" />
7
+ <meta name="keywords" content="<%= yield(:meta_keywords) -%>" />
8
+ <link rel="canonical" href="<%= request.url -%>" />
9
+ <link rel="shortcut icon" href="/favicon.ico" />
10
+ <link href="/stylesheets/core.css" media="all" rel="stylesheet" type="text/css" />
11
+ <link href="/stylesheets/application.css" media="all" rel="stylesheet" type="text/css" />
12
+ <link href="/stylesheets/mitamirri.css" media="all" rel="stylesheet" type="text/css" />
13
+ <link href="/stylesheets/mitamirri_print.css" media="print" rel="stylesheet" type="text/css" />
14
+ <!--[if IE]>
15
+ <%= stylesheet_link_tag 'core_ie', :media => :all -%>
16
+ <![endif]-->
17
+ <%= javascript_include_tag :defaults %>
18
+ <%= csrf_meta_tag %>
19
+ </head>
20
+ <body>
21
+ <div id="container">
22
+ <div id="header">
23
+ <div id="branding"></div>
24
+ <div id="navigation">
25
+ <%= breadcrumbs -%>
26
+ </div>
27
+ </div>
28
+ <div id="page_header">
29
+ <h1><%= yield(:page_title) -%></h1>
30
+ </div>
31
+ <div id="content_area">
32
+ <div id="washout" style="display:none;"></div>
3
33
 
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
- <title>Mitamirri: <%= yield :title -%></title>
8
- <%= stylesheet_link_tag 'mitamirri' %>
9
- <%= Seer::init_visualization -%>
10
- </head>
11
- <body>
12
-
13
- <p style="color: green"><%= flash[:notice] %></p>
14
-
15
- <%= yield %>
16
-
17
- <p class="footer">Generated by <a href="http://github.com/Bantik/mitamirri/">Mitamirri</a> by <a href="http://www.idolhands.com/">Corey Ehmke</a> / <a href="http://www.seologic.com/">SEOLogic</a>.</p>
18
-
19
- </body>
34
+ <%- flash.each do |name, msg| -%>
35
+ <%- if name == :notice -%>
36
+ <%= content_tag :div, msg, :id => "flash_#{name}", :class => "flash_#{name}", :style => "display:none;" -%>
37
+ <script type="text/javascript">
38
+ $('washout').toggle();
39
+ $('flash_notice').toggle();
40
+ <%= visual_effect(:fade, 'flash_notice', :duration => 1.0, :delay => 1.0).html_safe -%>
41
+ <%= visual_effect(:fade, 'washout', :duration => 1.0, :delay => 1.0).html_safe -%>
42
+ </script>
43
+ <%- else -%>
44
+ <%= content_tag :div, msg, :id => "flash_#{name}", :class => "flash_#{name}" -%>
45
+ <%- end -%>
46
+ <%- end -%>
47
+ <%= yield -%>
48
+ <br style="clear: both;" />
49
+ </div>
50
+ <div id="footer"><p>&copy; <%= Time.zone.now.year -%> SEO Logic. All rights reserved.</p></div>
51
+ </div>
52
+ </body>
20
53
  </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Mitamirri::Application
@@ -0,0 +1,13 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "action_controller/railtie"
4
+ require "action_mailer/railtie"
5
+ require "active_resource/railtie"
6
+
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
+
9
+ module Mitamirri
10
+ class Application < Rails::Application
11
+ config.encoding = "utf-8"
12
+ end
13
+ end
@@ -1,110 +1,13 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- def preinitialize
28
- load(preinitializer_path) if File.exist?(preinitializer_path)
29
- end
30
-
31
- def preinitializer_path
32
- "#{RAILS_ROOT}/config/preinitializer.rb"
33
- end
34
- end
35
-
36
- class Boot
37
- def run
38
- load_initializer
39
- Rails::Initializer.run(:set_load_path)
40
- end
41
- end
42
-
43
- class VendorBoot < Boot
44
- def load_initializer
45
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46
- Rails::Initializer.run(:install_gem_spec_stubs)
47
- Rails::GemDependency.add_frozen_gem_path
48
- end
49
- end
50
-
51
- class GemBoot < Boot
52
- def load_initializer
53
- self.class.load_rubygems
54
- load_rails_gem
55
- require 'initializer'
56
- end
57
-
58
- def load_rails_gem
59
- if version = self.class.gem_version
60
- gem 'rails', version
61
- else
62
- gem 'rails'
63
- end
64
- rescue Gem::LoadError => load_error
65
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
66
- exit 1
67
- end
68
-
69
- class << self
70
- def rubygems_version
71
- Gem::RubyGemsVersion rescue nil
72
- end
73
-
74
- def gem_version
75
- if defined? RAILS_GEM_VERSION
76
- RAILS_GEM_VERSION
77
- elsif ENV.include?('RAILS_GEM_VERSION')
78
- ENV['RAILS_GEM_VERSION']
79
- else
80
- parse_gem_version(read_environment_rb)
81
- end
82
- end
83
-
84
- def load_rubygems
85
- min_version = '1.3.2'
86
- require 'rubygems'
87
- unless rubygems_version >= min_version
88
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
89
- exit 1
90
- end
91
-
92
- rescue LoadError
93
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
94
- exit 1
95
- end
96
-
97
- def parse_gem_version(text)
98
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
99
- end
100
-
101
- private
102
- def read_environment_rb
103
- File.read("#{RAILS_ROOT}/config/environment.rb")
104
- end
105
- end
106
- end
107
- end
108
-
109
- # All that for this:
110
- Rails.boot!
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
@@ -0,0 +1,10 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
5
+ int_opts = "#{std_opts} -o tmp/feature_results.txt"
6
+ %>
7
+ default: <%= std_opts %> features
8
+ wip: --tags @wip:3 --wip features
9
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
10
+ integration: <%= int_opts %> features
@@ -0,0 +1,40 @@
1
+ # Deploy this gem to the gem server.
2
+ #
3
+ # Usage for a gem already on the gem server:
4
+ #
5
+ # cap deploy
6
+ #
7
+ # For a new gem:
8
+ #
9
+ # cap deploy:new
10
+
11
+ # Global Variables =================================================================================
12
+ default_run_options[:pty] = true
13
+ role :app, 'jose.seologic.com'
14
+ set :deploy_to, '/home/containers/rails/system/mitamirri'
15
+ set :repository, 'git@mir.unfuddle.com:mir/mitamirri.git'
16
+ set :scm, :git
17
+ set :use_sudo, false
18
+ set :user, 'cnewton'
19
+
20
+ namespace :deploy do
21
+ desc "Clone a new gem's repository on the gem server."
22
+ task :new do
23
+ run "git clone -q #{repository} #{deploy_to}"
24
+ end
25
+
26
+ task :install do
27
+ run "cd #{deploy_to}; rm -f Gemfile.lock; sudo bundle; sudo rake install"
28
+ end
29
+
30
+ # disable default behavior
31
+ task :restart do
32
+ end
33
+
34
+ task :update do
35
+ run "cd #{deploy_to}; git pull origin master"
36
+ end
37
+ end
38
+
39
+ after 'deploy', 'deploy:install'
40
+ after 'deploy:new', 'deploy:install'
@@ -1,24 +1,5 @@
1
- # Be sure to restart your server when you modify this file
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
2
3
 
3
- # Specifies gem version of Rails to use when vendor/rails is not present
4
- # RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
5
-
6
- # Bootstrap the Rails environment, frameworks, and default configuration
7
- require File.join(File.dirname(__FILE__), 'boot')
8
-
9
- Rails::Initializer.run do |config|
10
- config.frameworks -= [:active_record]
11
- config.gem 'mitamirri'
12
- config.gem 'mongo_mapper'
13
- config.time_zone = 'Central Time (US & Canada)'
14
- config.action_controller.session = {
15
- :session_key => '_seologic_session',
16
- :secret => 'be43561c9a1980a7230fd9530aed9f4d1a29f780cd80afc9091180d01d17980308d583f59d3c8d6832c26d92d1c6d5ebc21b9d5565d1e04136b198882d01f303'
17
- }
18
- # config.action_controller.session_store = :active_record_store
19
- end
20
-
21
- if RAILS_ENV == 'test'
22
- require 'spec/spec_helper'
23
- # require 'spec/blueprints'
24
- end
4
+ # Initialize the rails application
5
+ Mitamirri::Application.initialize!
@@ -1,17 +1,28 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
1
+ Mitamirri::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
2
3
 
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
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 webserver when you make code changes.
7
+ config.cache_classes = false
7
8
 
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
10
11
 
11
- # Show full error reports and disable caching
12
- config.action_controller.consider_all_requests_local = true
13
- config.action_view.debug_rjs = true
14
- config.action_controller.perform_caching = false
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
15
16
 
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+
26
+ # Custom settings
27
+ config.feature_results_path = "#{Rails.root}/tmp/feature_results.txt"
28
+ end
@@ -1,28 +1,49 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
1
+ Mitamirri::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
2
3
 
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
6
7
 
7
- # Full error reports are disabled and caching is turned on
8
- config.action_controller.consider_all_requests_local = true # FIXME: false causes weird errors in the CMS
9
- config.action_controller.perform_caching = true
10
- config.action_view.cache_template_loading = true
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
11
 
12
- # See everything in the log (default is :info)
13
- # config.log_level = :debug
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
14
 
15
- # Use a different logger for distributed setups
16
- # config.logger = SyslogLogger.new
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
17
 
18
- # Use a different cache store in production
19
- # config.cache_store = :mem_cache_store
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
20
 
21
- # Enable serving of images, stylesheets, and javascripts from an asset server
22
- # config.action_controller.asset_host = "http://assets.example.com"
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
23
 
24
- # Disable delivery errors, bad email addresses will be ignored
25
- # config.action_mailer.raise_delivery_errors = false
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
26
 
27
- # Enable threaded mode
28
- # config.threadsafe!
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end