mountain-goat 0.1.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/README.md +119 -48
  2. data/generators/mg/mg_generator.rb +17 -9
  3. data/generators/mg/templates/create_mountain_goat_tables.rb +61 -25
  4. data/generators/mg/templates/mg.rb +1 -0
  5. data/generators/mg/templates/mountain-goat.yml +22 -3
  6. data/generators/mg/templates/mountain_goat_reports.rake +17 -0
  7. data/generators/mg/templates/update_mountain_goat_tables.rb +104 -0
  8. data/lib/mountain-goat.rb +21 -12
  9. data/lib/mountain-goat/analytics.rb +134 -0
  10. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_converts_controller.rb → mg/converts_controller.rb} +12 -11
  11. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_metric_variants_controller.rb → mg/metric_variants_controller.rb} +6 -5
  12. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_metrics_controller.rb → mg/metrics_controller.rb} +8 -6
  13. data/lib/mountain-goat/controllers/mg/mg.rb +47 -0
  14. data/lib/mountain-goat/controllers/{mountain_goat → mg}/mountain_goat_controller.rb +5 -42
  15. data/lib/mountain-goat/controllers/mg/playground_controller.rb +8 -0
  16. data/lib/mountain-goat/controllers/{mountain_goat/mountain_goat_rallies_controller.rb → mg/rallies_controller.rb} +4 -26
  17. data/lib/mountain-goat/controllers/mg/report_items_controller.rb +82 -0
  18. data/lib/mountain-goat/controllers/mg/reports_controller.rb +90 -0
  19. data/lib/mountain-goat/m_g.rb +64 -0
  20. data/lib/mountain-goat/metric_tracking.rb +192 -74
  21. data/lib/mountain-goat/models/mg/ci_meta.rb +10 -0
  22. data/lib/mountain-goat/models/mg/convert.rb +147 -0
  23. data/lib/mountain-goat/models/mg/convert_meta_type.rb +20 -0
  24. data/lib/mountain-goat/models/mg/cs_meta.rb +10 -0
  25. data/lib/mountain-goat/models/{metric.rb → mg/metric.rb} +3 -5
  26. data/lib/mountain-goat/models/mg/metric_variant.rb +25 -0
  27. data/lib/mountain-goat/models/mg/mountain_goat.rb +3 -0
  28. data/lib/mountain-goat/models/{rally.rb → mg/rally.rb} +4 -3
  29. data/lib/mountain-goat/models/mg/report.rb +11 -0
  30. data/lib/mountain-goat/models/mg/report_item.rb +24 -0
  31. data/lib/mountain-goat/models/mg/report_mailer.rb +18 -0
  32. data/lib/mountain-goat/public/g-bar-min.js +7 -0
  33. data/lib/mountain-goat/public/g-dot-min.js +7 -0
  34. data/lib/mountain-goat/public/g-line-min.js +7 -0
  35. data/lib/mountain-goat/public/g-pie-min.js +1 -0
  36. data/lib/mountain-goat/public/g-raphael-min.js +7 -0
  37. data/lib/mountain-goat/public/jqModel.css +41 -0
  38. data/lib/mountain-goat/public/jqModel.js +69 -0
  39. data/lib/mountain-goat/public/jquery.raphael.js +208 -0
  40. data/lib/mountain-goat/public/mg.css +135 -26
  41. data/lib/mountain-goat/public/mg.js +53 -1
  42. data/lib/mountain-goat/public/raphael-min.js +7 -0
  43. data/lib/mountain-goat/public/utils.js +520 -0
  44. data/lib/mountain-goat/switch_variant.rb +4 -4
  45. data/lib/mountain-goat/version.rb +1 -1
  46. data/lib/mountain-goat/views/mountain_goat/layouts/_pdf.html.erb +15 -0
  47. data/lib/mountain-goat/views/mountain_goat/layouts/mountain_goat.html.erb +17 -5
  48. data/lib/mountain-goat/views/mountain_goat/layouts/xhr.html.erb +2 -0
  49. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/.tmp_show.html.erb.4433~ +0 -0
  50. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/_convert_form.html.erb +0 -0
  51. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/_convert_meta_type_form.html.erb +0 -0
  52. data/lib/mountain-goat/views/mountain_goat/mg/converts/edit.html.erb +13 -0
  53. data/lib/mountain-goat/views/mountain_goat/mg/converts/index.html.erb +25 -0
  54. data/lib/mountain-goat/views/mountain_goat/mg/converts/new.html.erb +13 -0
  55. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_converts → mg/converts}/show.html.erb +3 -28
  56. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/_metric_variant_form.html.erb +0 -4
  57. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/edit.html.erb +13 -0
  58. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/index.html.erb +3 -3
  59. data/lib/mountain-goat/views/mountain_goat/mg/metric_variants/new.html.erb +15 -0
  60. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metric_variants → mg/metric_variants}/show.html.erb +4 -5
  61. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/.tmp_show.html.erb.21270~ +0 -0
  62. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/_metric_form.html.erb +0 -2
  63. data/lib/mountain-goat/views/mountain_goat/mg/metrics/edit.html.erb +13 -0
  64. data/lib/mountain-goat/views/mountain_goat/mg/metrics/index.html.erb +14 -0
  65. data/lib/mountain-goat/views/mountain_goat/mg/metrics/new.html.erb +14 -0
  66. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_metrics → mg/metrics}/show.html.erb +7 -8
  67. data/lib/mountain-goat/views/mountain_goat/{mountain_goat → mg/mountain_goat}/login.html.erb +0 -0
  68. data/lib/mountain-goat/views/mountain_goat/mg/playground/test.html.erb +14 -0
  69. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/.tmp__rally.html.erb.40484~ +0 -0
  70. data/lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies.html.erb +5 -0
  71. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/_rallies_form.html.erb +0 -0
  72. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/_rally.html.erb +0 -0
  73. data/lib/mountain-goat/views/mountain_goat/mg/rallies/edit.html.erb +13 -0
  74. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/index.html.erb +1 -1
  75. data/lib/mountain-goat/views/mountain_goat/mg/rallies/new.html.erb +13 -0
  76. data/lib/mountain-goat/views/mountain_goat/{mountain_goat_rallies → mg/rallies}/show.html.erb +1 -1
  77. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_chart.html.erb +18 -0
  78. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_form.html.erb +10 -0
  79. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_pivot_form.html.erb +14 -0
  80. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_show.html.erb +29 -0
  81. data/lib/mountain-goat/views/mountain_goat/mg/report_items/_svg_chart.html.erb +4 -0
  82. data/lib/mountain-goat/views/mountain_goat/mg/report_items/edit.html.erb +19 -0
  83. data/lib/mountain-goat/views/mountain_goat/mg/report_items/new.html.erb +17 -0
  84. data/lib/mountain-goat/views/mountain_goat/mg/report_mailer/report.html.erb +27 -0
  85. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report.html.erb +22 -0
  86. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb +21 -0
  87. data/lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb +5 -0
  88. data/lib/mountain-goat/views/mountain_goat/mg/reports/edit.html.erb +36 -0
  89. data/lib/mountain-goat/views/mountain_goat/mg/reports/index.html.erb +26 -0
  90. data/lib/mountain-goat/views/mountain_goat/mg/reports/new.html.erb +17 -0
  91. data/lib/mountain-goat/views/mountain_goat/mg/reports/show.html.erb +21 -0
  92. data/test/fixtures/{ci_metas.yml → mg_ci_metas.yml} +0 -0
  93. data/test/fixtures/{convert_meta_types.yml → mg_convert_meta_types.yml} +0 -0
  94. data/test/fixtures/{converts.yml → mg_converts.yml} +5 -0
  95. data/test/fixtures/{cs_metas.yml → mg_cs_metas.yml} +0 -0
  96. data/test/fixtures/mg_deliveries.yml +9 -0
  97. data/test/fixtures/{metric_variants.yml → mg_metric_variants.yml} +0 -0
  98. data/test/fixtures/{metrics.yml → mg_metrics.yml} +2 -3
  99. data/test/fixtures/{rallies.yml → mg_rallies.yml} +6 -2
  100. data/test/fixtures/mg_report_items.yml +13 -0
  101. data/test/fixtures/mg_reports.yml +15 -0
  102. data/test/mg_convert_test.rb +32 -0
  103. data/test/mg_converts_controller_test.rb +47 -0
  104. data/test/mg_metric_variants_controller_test.rb +46 -0
  105. data/test/mg_metrics_controller_test.rb +52 -0
  106. data/test/mg_mountain_goat_controller_test.rb +45 -0
  107. data/test/mg_mountain_goat_test.rb +392 -0
  108. data/test/mg_playground_controller_test.rb +11 -0
  109. data/test/mg_rallies_controller_test.rb +36 -0
  110. data/test/mg_report_item_test.rb +7 -0
  111. data/test/mg_report_items_controller_test.rb +31 -0
  112. data/test/mg_report_test.rb +18 -0
  113. data/test/mg_reports_controller_test.rb +50 -0
  114. data/test/test_helper.rb +203 -0
  115. metadata +108 -55
  116. data/lib/mountain-goat/models/ci_meta.rb +0 -9
  117. data/lib/mountain-goat/models/convert.rb +0 -70
  118. data/lib/mountain-goat/models/convert_meta_type.rb +0 -19
  119. data/lib/mountain-goat/models/cs_meta.rb +0 -9
  120. data/lib/mountain-goat/models/metric_variant.rb +0 -22
  121. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/edit.html.erb +0 -13
  122. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/index.html.erb +0 -48
  123. data/lib/mountain-goat/views/mountain_goat/mountain_goat_converts/new.html.erb +0 -13
  124. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/edit.html.erb +0 -13
  125. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/new.html.erb +0 -15
  126. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/edit.html.erb +0 -13
  127. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/index.html.erb +0 -14
  128. data/lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/new.html.erb +0 -14
  129. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/_rallies.html.erb +0 -5
  130. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/edit.html.erb +0 -13
  131. data/lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/new.html.erb +0 -13
  132. data/test/ocelot_converts_controller_test.rb +0 -45
  133. data/test/ocelot_metric_variants_controller_test.rb +0 -45
  134. data/test/ocelot_metrics_controller_test.rb +0 -45
  135. data/test/ocelot_rallies_controller_test.rb +0 -8
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::PlaygroundControllerTest < ActionController::TestCase
4
+
5
+ #This is going to be a start for testing our in-page drops
6
+ test "should get test" do
7
+ get :test, {}, logged_in
8
+ assert_response :success
9
+ end
10
+
11
+ end
@@ -0,0 +1,36 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::RalliesControllerTest < ActionController::TestCase
4
+
5
+ #index, new_rallies, show
6
+
7
+ test "get index" do
8
+ get :index, {}, logged_in
9
+ assert_response :success
10
+ assert_not_nil assigns(:rallies)
11
+
12
+ get :index, { :convert_id => mg_converts(:two).id }, logged_in
13
+ assert_response :success
14
+ assert_not_nil assigns(:rallies)
15
+ assert_equal mg_converts(:two).id, assigns(:rallies).first.convert_id
16
+ end
17
+
18
+ test "get new rallies" do
19
+ get :new_rallies, {}, logged_in #should get everything
20
+ assert_response :success
21
+ assert_not_nil assigns(:rallies)
22
+ assert_equal Mg::Rally.count, assigns(:rallies).count
23
+
24
+ #should get nothing (we are up to date)
25
+ get :new_rallies, { :recent_rally => Mg::Rally.last.id }, logged_in
26
+ assert_response :success
27
+ assert_not_nil assigns(:rallies)
28
+ assert_equal 0, assigns(:rallies).count
29
+ end
30
+
31
+ test "get show" do
32
+ get :show, { :id => mg_rallies(:one).id }, logged_in
33
+ assert_response :success
34
+ assert_not_nil assigns(:rally)
35
+ end
36
+ end
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::ReportItemTest < ActiveSupport::TestCase
4
+
5
+ #TODO: Test cases
6
+
7
+ end
@@ -0,0 +1,31 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::ReportItemsControllerTest < ActionController::TestCase
4
+
5
+ test "new" do
6
+ get :new, { :report_id => mg_reports(:one).id }, logged_in
7
+ assert_response :success
8
+ assert_not_nil assigns(:report_item)
9
+ end
10
+
11
+ test "create" do
12
+ get :create, { :report_id => mg_reports(:one).id , :report_item => { :reportable => "#{mg_converts(:one).id}-#{mg_converts(:one).class}" } }, logged_in
13
+ assert_response :success
14
+ assert_not_nil assigns(:report_item)
15
+ assert_equal mg_converts(:one), assigns(:report_item).reportable
16
+ end
17
+
18
+ test "edit" do
19
+ get :edit, { :id => mg_report_items(:one).id }, logged_in
20
+ assert_response :success
21
+ assert_not_nil assigns(:report_item)
22
+ end
23
+
24
+ test "update" do
25
+ get :update, { :id => mg_report_items(:one).id, :report_item => { :reportable => "#{mg_converts(:two).id}-#{mg_converts(:two).class}" } }, logged_in
26
+ assert_response :success
27
+ assert_not_nil assigns(:report_item)
28
+ assert_equal mg_converts(:two), assigns(:report_item).reportable
29
+ end
30
+
31
+ end
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::ReportTest < ActiveSupport::TestCase
4
+
5
+ test "delivery" do
6
+ assert_difference 'ActionMailer::Base.deliveries.size', 2 do
7
+ MG.deliver(nil)
8
+ end
9
+
10
+ assert_difference 'ActionMailer::Base.deliveries.size' do
11
+ MG.deliver("daily")
12
+ end
13
+
14
+ assert_difference 'ActionMailer::Base.deliveries.size' do
15
+ MG.deliver("weekly")
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,50 @@
1
+ require File.join(File.dirname(__FILE__), 'test_helper')
2
+
3
+ class Mg::ReportsControllerTest < ActionController::TestCase
4
+ test "should get index" do
5
+ get :index, {}, logged_in
6
+ assert_response :success
7
+ assert_not_nil assigns(:reports)
8
+ end
9
+
10
+ test "should get new" do
11
+ get :new, {}, logged_in
12
+ assert_response :success
13
+ end
14
+
15
+ test "should create report" do
16
+ assert_difference('Mg::Report.count') do
17
+ post :create, { :report => { :title => 'abc', :delivery_set => "hi", :recipients => "aaa@bbb.com" } }, logged_in
18
+ end
19
+
20
+ assert_redirected_to edit_mg_report_path(assigns(:report))
21
+ end
22
+
23
+ test "should show report" do
24
+ get :show, { :id => mg_reports(:one).to_param }, logged_in
25
+ assert_response :success
26
+ end
27
+
28
+ test "should show svg report" do
29
+ get :show_svg, { :id => mg_reports(:one).to_param }, logged_in
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, { :id => mg_reports(:one).to_param }, logged_in
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update report" do
39
+ put :update, { :id => mg_reports(:one).to_param, :report => { :title => 'abc', :delivery_set => "hi", :recipients => "aaa@bbb.com" } }, logged_in
40
+ assert_redirected_to mg_report_path(assigns(:report))
41
+ end
42
+
43
+ test "should destroy report" do
44
+ assert_difference('Mg::Report.count', -1) do
45
+ delete :destroy, { :id => mg_reports(:one).to_param }, logged_in
46
+ end
47
+
48
+ assert_redirected_to mg_reports_path
49
+ end
50
+ end
@@ -0,0 +1,203 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
2
+
3
+ require 'rubygems'
4
+ gem 'actionpack', '=2.3.11'
5
+ gem 'actionmailer', '=2.3.11'
6
+ gem 'activesupport', '=2.3.11'
7
+ gem 'activerecord', '=2.3.11'
8
+ require 'active_support'
9
+ require 'action_controller'
10
+ require 'action_controller/routing'
11
+ require 'action_mailer'
12
+ require 'active_record'
13
+ require 'active_record/fixtures'
14
+ #require 'test_help'
15
+ require 'active_support/core_ext/kernel/requires'
16
+ require 'active_support/test_case'
17
+ require 'action_controller/test_case'
18
+ #require 'action_dispatch/testing/integration'
19
+ require 'active_record/test_case'
20
+ require 'active_support/values/time_zone'
21
+ require 'test/unit'
22
+
23
+ require 'mountain-goat'
24
+
25
+ MOUNTAIN_GOAT_TEST = true
26
+ RAILS_ROOT = File.join(File.dirname(__FILE__), '..', '..', '..', '..')
27
+ RAILS_ENV = 'test'
28
+
29
+ #Fake a lot of RAILS junk
30
+ ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
31
+ ActiveRecord::Base.configurations = { 'me' => { 'adapter' => 'sqlite3', 'database' => ":memory:" } }
32
+ LOGGER = Logger.new('log/mountain-goat-test.log')
33
+ ActiveRecord::Base.logger = LOGGER
34
+ ActionController::Base.logger = LOGGER
35
+ Time.zone_default = Time.__send__(:get_zone, 'Central Time (US & Canada)')
36
+ ActionMailer::Base.delivery_method = :test
37
+
38
+ ActiveRecord::Schema.define(:version => 1) do
39
+ create_table "mg_ci_metas", :force => true do |t|
40
+ t.integer "rally_id"
41
+ t.integer "convert_meta_type_id"
42
+ t.integer "data"
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ end
46
+
47
+ add_index "mg_ci_metas", ["convert_meta_type_id", "data"], :name => "ci_metas_cmt_data_index"
48
+ add_index "mg_ci_metas", ["convert_meta_type_id"], :name => "ci_metas_cmt_index"
49
+ add_index "mg_ci_metas", ["rally_id"], :name => "ci_metas_rally_index"
50
+
51
+ create_table "mg_convert_meta_types", :force => true do |t|
52
+ t.integer "convert_id"
53
+ t.string "name"
54
+ t.string "var"
55
+ t.string "meta_type"
56
+ t.datetime "created_at"
57
+ t.datetime "updated_at"
58
+ end
59
+
60
+ create_table "mg_converts", :force => true do |t|
61
+ t.string "convert_type"
62
+ t.datetime "created_at"
63
+ t.datetime "updated_at"
64
+ t.string "name"
65
+ t.float "reward", :default => 1.0
66
+ t.datetime "deleted_at"
67
+ end
68
+
69
+ create_table "mg_cs_metas", :force => true do |t|
70
+ t.integer "rally_id"
71
+ t.integer "convert_meta_type_id"
72
+ t.string "data"
73
+ t.datetime "created_at"
74
+ t.datetime "updated_at"
75
+ end
76
+
77
+ add_index "mg_cs_metas", ["convert_meta_type_id", "data"], :name => "cs_metas_cmt_data_index"
78
+ add_index "mg_cs_metas", ["convert_meta_type_id"], :name => "cs_metas_cmt_index"
79
+ add_index "mg_cs_metas", ["rally_id"], :name => "cs_metas_rally_index"
80
+
81
+ create_table "mg_metric_variants", :force => true do |t|
82
+ t.integer "metric_id"
83
+ t.text "value"
84
+ t.text "opt1"
85
+ t.text "opt2"
86
+ t.integer "served", :default => 0
87
+ t.integer "conversions", :default => 0
88
+ t.datetime "created_at"
89
+ t.datetime "updated_at"
90
+ t.string "name"
91
+ t.string "switch_type"
92
+ t.float "reward"
93
+ t.datetime "deleted_at"
94
+ end
95
+
96
+ create_table "mg_metrics", :force => true do |t|
97
+ t.string "metric_type"
98
+ t.string "title"
99
+ t.datetime "created_at"
100
+ t.datetime "updated_at"
101
+ t.boolean "tally_each_serve", :default => true
102
+ t.boolean "is_switch", :default => false
103
+ t.datetime "deleted_at"
104
+ end
105
+
106
+ create_table "mg_rallies", :force => true do |t|
107
+ t.integer "convert_id"
108
+ t.datetime "created_at"
109
+ t.datetime "updated_at"
110
+ end
111
+
112
+ create_table "mg_report_items", :force => true do |t|
113
+ t.integer "report_id"
114
+ t.integer "reportable_id"
115
+ t.string "reportable_type"
116
+ t.integer "order"
117
+ t.datetime "created_at"
118
+ t.datetime "updated_at"
119
+ t.string "pivot_type"
120
+ t.integer "pivot_id"
121
+ t.string "filter"
122
+ t.string "meta_type"
123
+ t.integer "meta_id"
124
+ t.string "extra"
125
+ t.integer "variant"
126
+ t.integer "subvariant"
127
+ t.datetime "start"
128
+ t.datetime "end"
129
+ t.integer "size"
130
+ end
131
+
132
+ create_table "mg_reports", :force => true do |t|
133
+ t.string "title"
134
+ t.text "description"
135
+ t.datetime "created_at"
136
+ t.datetime "updated_at"
137
+ t.string "delivery_set"
138
+ t.string "recipients"
139
+ t.datetime "deleted_at"
140
+ t.string "theme"
141
+ end
142
+ end
143
+
144
+ #ActiveSupport::TestCase.fixture_path = File.join(File.dirname(__FILE__), 'fixtures')
145
+ #tables = Dir["#{fixture_dir}/*.yml"]
146
+ #tables.collect! {|t| File.basename(t, '.yml')}
147
+ #Fixtures.create_fixtures(fixture_dir, tables)
148
+
149
+ class ActiveSupport::TestCase
150
+ include ActiveRecord::TestFixtures
151
+
152
+ # Transactional fixtures accelerate your tests by wrapping each test method
153
+ # in a transaction that's rolled back on completion. This ensures that the
154
+ # test database remains unchanged so your fixtures don't have to be reloaded
155
+ # between every test method. Fewer database queries means faster tests.
156
+ #
157
+ # Read Mike Clark's excellent walkthrough at
158
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
159
+ #
160
+ # Every Active Record database supports transactions except MyISAM tables
161
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
162
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
163
+ # is recommended.
164
+ #
165
+ # The only drawback to using transactional fixtures is when you actually
166
+ # need to test transactions. Since your test is bracketed by a transaction,
167
+ # any transactions started in your code will be automatically rolled back.
168
+ self.use_transactional_fixtures = true
169
+
170
+ # Instantiated fixtures are slow, but give you @david where otherwise you
171
+ # would need people(:david). If you don't want to migrate your existing
172
+ # test cases which use the @david style and don't mind the speed hit (each
173
+ # instantiated fixtures translates to a database query per test method),
174
+ # then set this back to true.
175
+ #self.use_instantiated_fixtures = false
176
+
177
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
178
+ #
179
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
180
+ # -- they do not yet inherit this setting
181
+ self.fixture_path = File.join(File.dirname(__FILE__), 'fixtures')
182
+ fixtures :mg_ci_metas, :mg_convert_meta_types, :mg_converts, :mg_cs_metas, :mg_metric_variants, :mg_metrics, :mg_rallies, :mg_report_items, :mg_reports
183
+ set_fixture_class( { :mg_ci_metas => Mg::CiMeta, :mg_convert_meta_types => Mg::ConvertMetaType, :mg_converts => Mg::Convert, :mg_cs_metas => Mg::CsMeta, :mg_metric_variants => Mg::MetricVariant, :mg_metrics => Mg::Metric, :mg_rallies => Mg::Rally, :mg_report_items => Mg::ReportItem, :mg_reports => Mg::Report } )
184
+
185
+ def logger
186
+ LOGGER
187
+ end
188
+
189
+ # Add more helper methods to be used by all tests here...
190
+ def logged_in
191
+ { :mg_access => true }
192
+ end
193
+
194
+ def get_file_as_string(filename)
195
+ data = ''
196
+ f = File.open(filename, "r")
197
+ f.each_line do |line|
198
+ data += line
199
+ end
200
+ return data
201
+ end
202
+
203
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mountain-goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
- - 0
8
7
  - 1
9
- - 8
10
- version: 0.1.8
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Geoffrey Hayes
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-03 00:00:00 -05:00
19
+ date: 2011-09-07 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -71,76 +71,129 @@ files:
71
71
  - generators/mg/mg_generator.rb
72
72
  - generators/mg/templates/create_mountain_goat_tables.rb
73
73
  - generators/mg/templates/initializer.rb
74
+ - generators/mg/templates/mg.rb
74
75
  - generators/mg/templates/mountain-goat.yml
76
+ - generators/mg/templates/mountain_goat_reports.rake
77
+ - generators/mg/templates/update_mountain_goat_tables.rb
75
78
  - init.rb
76
79
  - install.rb
77
80
  - lib/mgflotilla.rb
78
81
  - lib/mountain-goat.rb
79
- - lib/mountain-goat/controllers/mountain_goat/mountain_goat_controller.rb
80
- - lib/mountain-goat/controllers/mountain_goat/mountain_goat_converts_controller.rb
81
- - lib/mountain-goat/controllers/mountain_goat/mountain_goat_metric_variants_controller.rb
82
- - lib/mountain-goat/controllers/mountain_goat/mountain_goat_metrics_controller.rb
83
- - lib/mountain-goat/controllers/mountain_goat/mountain_goat_rallies_controller.rb
82
+ - lib/mountain-goat/analytics.rb
83
+ - lib/mountain-goat/controllers/mg/converts_controller.rb
84
+ - lib/mountain-goat/controllers/mg/metric_variants_controller.rb
85
+ - lib/mountain-goat/controllers/mg/metrics_controller.rb
86
+ - lib/mountain-goat/controllers/mg/mg.rb
87
+ - lib/mountain-goat/controllers/mg/mountain_goat_controller.rb
88
+ - lib/mountain-goat/controllers/mg/playground_controller.rb
89
+ - lib/mountain-goat/controllers/mg/rallies_controller.rb
90
+ - lib/mountain-goat/controllers/mg/report_items_controller.rb
91
+ - lib/mountain-goat/controllers/mg/reports_controller.rb
92
+ - lib/mountain-goat/m_g.rb
84
93
  - lib/mountain-goat/metric_tracking.rb
85
- - lib/mountain-goat/models/ci_meta.rb
86
- - lib/mountain-goat/models/convert.rb
87
- - lib/mountain-goat/models/convert_meta_type.rb
88
- - lib/mountain-goat/models/cs_meta.rb
89
- - lib/mountain-goat/models/metric.rb
90
- - lib/mountain-goat/models/metric_variant.rb
91
- - lib/mountain-goat/models/rally.rb
94
+ - lib/mountain-goat/models/mg/ci_meta.rb
95
+ - lib/mountain-goat/models/mg/convert.rb
96
+ - lib/mountain-goat/models/mg/convert_meta_type.rb
97
+ - lib/mountain-goat/models/mg/cs_meta.rb
98
+ - lib/mountain-goat/models/mg/metric.rb
99
+ - lib/mountain-goat/models/mg/metric_variant.rb
100
+ - lib/mountain-goat/models/mg/mountain_goat.rb
101
+ - lib/mountain-goat/models/mg/rally.rb
102
+ - lib/mountain-goat/models/mg/report.rb
103
+ - lib/mountain-goat/models/mg/report_item.rb
104
+ - lib/mountain-goat/models/mg/report_mailer.rb
92
105
  - lib/mountain-goat/public/containerbg.png
93
106
  - lib/mountain-goat/public/dirtyred.png
94
107
  - lib/mountain-goat/public/dottedblack.png
95
108
  - lib/mountain-goat/public/dottedblue.png
109
+ - lib/mountain-goat/public/g-bar-min.js
110
+ - lib/mountain-goat/public/g-dot-min.js
111
+ - lib/mountain-goat/public/g-line-min.js
112
+ - lib/mountain-goat/public/g-pie-min.js
113
+ - lib/mountain-goat/public/g-raphael-min.js
114
+ - lib/mountain-goat/public/jqModel.css
115
+ - lib/mountain-goat/public/jqModel.js
96
116
  - lib/mountain-goat/public/jquery.flot.js
117
+ - lib/mountain-goat/public/jquery.raphael.js
97
118
  - lib/mountain-goat/public/jquery.timeago.js
98
119
  - lib/mountain-goat/public/mg.css
99
120
  - lib/mountain-goat/public/mg.js
100
121
  - lib/mountain-goat/public/mg.png
122
+ - lib/mountain-goat/public/raphael-min.js
101
123
  - lib/mountain-goat/public/raster.png
124
+ - lib/mountain-goat/public/utils.js
102
125
  - lib/mountain-goat/switch_variant.rb
103
126
  - lib/mountain-goat/version.rb
127
+ - lib/mountain-goat/views/mountain_goat/layouts/_pdf.html.erb
104
128
  - lib/mountain-goat/views/mountain_goat/layouts/mountain_goat.html.erb
105
- - lib/mountain-goat/views/mountain_goat/mountain_goat/login.html.erb
106
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/.tmp_show.html.erb.4433~
107
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/_convert_form.html.erb
108
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/_convert_meta_type_form.html.erb
109
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/edit.html.erb
110
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/index.html.erb
111
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/new.html.erb
112
- - lib/mountain-goat/views/mountain_goat/mountain_goat_converts/show.html.erb
113
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/_metric_variant_form.html.erb
114
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/edit.html.erb
115
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/index.html.erb
116
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/new.html.erb
117
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metric_variants/show.html.erb
118
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/.tmp_show.html.erb.21270~
119
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/_metric_form.html.erb
120
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/edit.html.erb
121
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/index.html.erb
122
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/new.html.erb
123
- - lib/mountain-goat/views/mountain_goat/mountain_goat_metrics/show.html.erb
124
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/.tmp__rally.html.erb.40484~
125
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/_rallies.html.erb
126
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/_rallies_form.html.erb
127
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/_rally.html.erb
128
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/edit.html.erb
129
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/index.html.erb
130
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/new.html.erb
131
- - lib/mountain-goat/views/mountain_goat/mountain_goat_rallies/show.html.erb
129
+ - lib/mountain-goat/views/mountain_goat/layouts/xhr.html.erb
130
+ - lib/mountain-goat/views/mountain_goat/mg/converts/.tmp_show.html.erb.4433~
131
+ - lib/mountain-goat/views/mountain_goat/mg/converts/_convert_form.html.erb
132
+ - lib/mountain-goat/views/mountain_goat/mg/converts/_convert_meta_type_form.html.erb
133
+ - lib/mountain-goat/views/mountain_goat/mg/converts/edit.html.erb
134
+ - lib/mountain-goat/views/mountain_goat/mg/converts/index.html.erb
135
+ - lib/mountain-goat/views/mountain_goat/mg/converts/new.html.erb
136
+ - lib/mountain-goat/views/mountain_goat/mg/converts/show.html.erb
137
+ - lib/mountain-goat/views/mountain_goat/mg/metric_variants/_metric_variant_form.html.erb
138
+ - lib/mountain-goat/views/mountain_goat/mg/metric_variants/edit.html.erb
139
+ - lib/mountain-goat/views/mountain_goat/mg/metric_variants/index.html.erb
140
+ - lib/mountain-goat/views/mountain_goat/mg/metric_variants/new.html.erb
141
+ - lib/mountain-goat/views/mountain_goat/mg/metric_variants/show.html.erb
142
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/.tmp_show.html.erb.21270~
143
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/_metric_form.html.erb
144
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/edit.html.erb
145
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/index.html.erb
146
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/new.html.erb
147
+ - lib/mountain-goat/views/mountain_goat/mg/metrics/show.html.erb
148
+ - lib/mountain-goat/views/mountain_goat/mg/mountain_goat/login.html.erb
149
+ - lib/mountain-goat/views/mountain_goat/mg/playground/test.html.erb
150
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/.tmp__rally.html.erb.40484~
151
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies.html.erb
152
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/_rallies_form.html.erb
153
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/_rally.html.erb
154
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/edit.html.erb
155
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/index.html.erb
156
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/new.html.erb
157
+ - lib/mountain-goat/views/mountain_goat/mg/rallies/show.html.erb
158
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/_chart.html.erb
159
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_form.html.erb
160
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/_report_item_pivot_form.html.erb
161
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/_show.html.erb
162
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/_svg_chart.html.erb
163
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/edit.html.erb
164
+ - lib/mountain-goat/views/mountain_goat/mg/report_items/new.html.erb
165
+ - lib/mountain-goat/views/mountain_goat/mg/report_mailer/report.html.erb
166
+ - lib/mountain-goat/views/mountain_goat/mg/reports/_report.html.erb
167
+ - lib/mountain-goat/views/mountain_goat/mg/reports/_report_form.html.erb
168
+ - lib/mountain-goat/views/mountain_goat/mg/reports/_report_report_items.html.erb
169
+ - lib/mountain-goat/views/mountain_goat/mg/reports/edit.html.erb
170
+ - lib/mountain-goat/views/mountain_goat/mg/reports/index.html.erb
171
+ - lib/mountain-goat/views/mountain_goat/mg/reports/new.html.erb
172
+ - lib/mountain-goat/views/mountain_goat/mg/reports/show.html.erb
132
173
  - mountain-goat.gemspec
133
- - test/fixtures/ci_metas.yml
134
- - test/fixtures/convert_meta_types.yml
135
- - test/fixtures/converts.yml
136
- - test/fixtures/cs_metas.yml
137
- - test/fixtures/metric_variants.yml
138
- - test/fixtures/metrics.yml
139
- - test/fixtures/rallies.yml
140
- - test/ocelot_converts_controller_test.rb
141
- - test/ocelot_metric_variants_controller_test.rb
142
- - test/ocelot_metrics_controller_test.rb
143
- - test/ocelot_rallies_controller_test.rb
174
+ - test/fixtures/mg_ci_metas.yml
175
+ - test/fixtures/mg_convert_meta_types.yml
176
+ - test/fixtures/mg_converts.yml
177
+ - test/fixtures/mg_cs_metas.yml
178
+ - test/fixtures/mg_deliveries.yml
179
+ - test/fixtures/mg_metric_variants.yml
180
+ - test/fixtures/mg_metrics.yml
181
+ - test/fixtures/mg_rallies.yml
182
+ - test/fixtures/mg_report_items.yml
183
+ - test/fixtures/mg_reports.yml
184
+ - test/mg_convert_test.rb
185
+ - test/mg_converts_controller_test.rb
186
+ - test/mg_metric_variants_controller_test.rb
187
+ - test/mg_metrics_controller_test.rb
188
+ - test/mg_mountain_goat_controller_test.rb
189
+ - test/mg_mountain_goat_test.rb
190
+ - test/mg_playground_controller_test.rb
191
+ - test/mg_rallies_controller_test.rb
192
+ - test/mg_report_item_test.rb
193
+ - test/mg_report_items_controller_test.rb
194
+ - test/mg_report_test.rb
195
+ - test/mg_reports_controller_test.rb
196
+ - test/test_helper.rb
144
197
  has_rdoc: true
145
198
  homepage: http://github.com/hayesgm/mountain_goat
146
199
  licenses: []