mail_engine 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.14
1
+ 0.1.15
@@ -1,7 +1,7 @@
1
1
  class MailEngine::DashboardController < MailEngine::ApplicationController
2
2
  def index
3
3
  @pie_chart_columns = ["bounces", "unique_opens", "spamreports", "blocks", "unopened"]
4
- @data_of_today = MailEngine::Sendgrid::RestApi.stats
4
+ @data_of_today = MailEngine::Sendgrid::RestApi.stats || {}
5
5
  # unopened data needs you calculate by yourself.
6
6
  @data_of_today.merge!("unopened" => (@data_of_today["delivered"].to_i - @data_of_today["unique_opens"].to_i))
7
7
  end
@@ -22,6 +22,7 @@ class MailEngine::ReportsController < MailEngine::ApplicationController
22
22
  else
23
23
  MailEngine::Sendgrid::RestApi.stats(:days => 7)
24
24
  end
25
+ @stats_data ||= {}
25
26
  end
26
27
 
27
28
  def chart
@@ -12,7 +12,7 @@
12
12
 
13
13
  <% @pie_chart_columns.each_with_index do |col, i| %>
14
14
  data.setValue(<%= i %>, 0, "<%= col %>");
15
- data.setValue(<%= i %>, 1, <%= @data_of_today[col] %>);
15
+ data.setValue(<%= i %>, 1, <%= @data_of_today[col]||0 %>);
16
16
  <% end %>
17
17
 
18
18
  var chart = new google.visualization.PieChart(document.getElementById('pie_chart'));
@@ -15,7 +15,7 @@
15
15
  <% @stats_data.each_with_index do |stat, i| %>
16
16
  data.setValue(<%= i %>, 0, "<%= stat["date"] %>");
17
17
  <% @stat_columns.each_with_index do |col, j| %>
18
- data.setValue(<%= i %>, <%= j + 1 %>, <%= stat[col] %>);
18
+ data.setValue(<%= i %>, <%= j + 1 %>, <%= stat[col]||0 %>);
19
19
  <% end %>
20
20
  <% end %>
21
21
 
@@ -15,16 +15,16 @@ module MailEngine
15
15
  ### Need check below config options
16
16
  #
17
17
  # log_mail: true
18
- # user_class_name: "User"
19
- # user_locale_column: "locale"
20
- # mount_at: "/admin/mail_engine"
21
- # intercept_email: "hlxwell@gmail.com"
22
- # default_from: "hlxwell@gmail.com"
23
- # access_check_method: "logged_in?"
18
+ # user_class_name: 'User'
19
+ # user_locale_column: 'locale'
20
+ # mount_at: '/admin/mail_engine'
21
+ # intercept_email: 'your email'
22
+ # default_from: 'you email'
23
+ # access_check_method: 'logged_in?'
24
24
  # sendgrid:
25
- # sendgrid_user: "a@theplant.jp"
26
- # sendgrid_key: "plant^o^"
27
- # sendgrid_category: "development"
25
+ # sendgrid_user: 'you send grid user'
26
+ # sendgrid_key: 'you send grid password'
27
+ # sendgrid_category: 'your send grid category'
28
28
  #
29
29
  def config_check
30
30
  if MailEngine::Base.current_config.blank?
@@ -51,17 +51,15 @@ module MailEngine
51
51
  user_class_name: 'User'
52
52
  user_locale_column: 'locale'
53
53
  mount_at: '/admin/mail_engine'
54
- intercept_email: 'hlxwell@gmail.com'
55
- default_from: 'hlxwell@gmail.com'
54
+ intercept_email: 'your email'
55
+ default_from: 'you email'
56
56
  access_check_method: 'logged_in?'
57
57
  sendgrid:
58
- sendgrid_user: 'a@theplant.jp'
59
- sendgrid_key: 'plant^o^'
60
- sendgrid_category: 'development'
58
+ sendgrid_user: 'you send grid user'
59
+ sendgrid_key: 'you send grid password'
60
+ sendgrid_category: 'your send grid category'
61
61
  ===============================================
62
62
  NOTE
63
-
64
- raise e
65
63
  end
66
64
 
67
65
  end
@@ -44,7 +44,9 @@ module MailEngine
44
44
  # load config
45
45
  MailEngine::Configuration.load_and_check
46
46
 
47
- MailEngine::USER_MODEL = MailEngine::Base.current_config["user_class_name"].constantize unless defined?(MailEngine::USER_MODEL)
47
+ if MailEngine::Base.current_config.present? and !defined?(MailEngine::USER_MODEL)
48
+ MailEngine::USER_MODEL = MailEngine::Base.current_config["user_class_name"].constantize
49
+ end
48
50
  end
49
51
  end
50
52
  end
@@ -10,6 +10,7 @@ module MailEngine
10
10
  include HTTParty
11
11
  base_uri "https://sendgrid.com/api"
12
12
  default_params :api_key => MailEngine::Base.current_config["sendgrid"]["sendgrid_key"], :api_user => MailEngine::Base.current_config["sendgrid"]["sendgrid_user"]
13
+ format :xml
13
14
 
14
15
  class << self
15
16
  # <stats>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mail_engine}
8
- s.version = "0.1.14"
8
+ s.version = "0.1.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["michael he"]
12
- s.date = %q{2011-03-25}
12
+ s.date = %q{2012-01-25}
13
13
  s.description = %q{Rails system mail management solution.}
14
14
  s.email = %q{hlxwell@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -576,51 +576,8 @@ Gem::Specification.new do |s|
576
576
  s.homepage = %q{http://github.com/hlxwell/mail-engine}
577
577
  s.licenses = ["MIT"]
578
578
  s.require_paths = ["lib"]
579
- s.rubygems_version = %q{1.4.1}
579
+ s.rubygems_version = %q{1.6.2}
580
580
  s.summary = %q{Mail Management Solution}
581
- s.test_files = [
582
- "test/dummy/app/controllers/application_controller.rb",
583
- "test/dummy/app/helpers/application_helper.rb",
584
- "test/dummy/app/mailers/test/test_mailer.rb",
585
- "test/dummy/app/mailers/user_mailer.rb",
586
- "test/dummy/app/models/user.rb",
587
- "test/dummy/config/application.rb",
588
- "test/dummy/config/boot.rb",
589
- "test/dummy/config/environment.rb",
590
- "test/dummy/config/environments/development.rb",
591
- "test/dummy/config/environments/production.rb",
592
- "test/dummy/config/environments/test.rb",
593
- "test/dummy/config/initializers/backtrace_silencers.rb",
594
- "test/dummy/config/initializers/inflections.rb",
595
- "test/dummy/config/initializers/mime_types.rb",
596
- "test/dummy/config/initializers/secret_token.rb",
597
- "test/dummy/config/initializers/session_store.rb",
598
- "test/dummy/config/routes.rb",
599
- "test/dummy/db/migrate/20110114030841_create_table_mail_template.rb",
600
- "test/dummy/db/migrate/20110125094530_create_users.rb",
601
- "test/dummy/db/migrate/20110126030525_create_mail_schedules.rb",
602
- "test/dummy/db/migrate/20110204114145_create_template_partials.rb",
603
- "test/dummy/db/migrate/20110206025002_create_mail_logs.rb",
604
- "test/dummy/db/migrate/20110217062316_create_mail_template_files.rb",
605
- "test/dummy/db/schema.rb",
606
- "test/factories.rb",
607
- "test/functional/mail_engine/dashboard_controller_test.rb",
608
- "test/functional/mail_engine/mail_dispatcher_test.rb",
609
- "test/functional/mail_engine/mail_logs_controller_test.rb",
610
- "test/functional/mail_engine/mail_schedules_controller_test.rb",
611
- "test/functional/mail_engine/mail_template_files_controller_test.rb",
612
- "test/functional/mail_engine/mail_templates_controller_test.rb",
613
- "test/functional/mail_engine/reports_controller_test.rb",
614
- "test/functional/user_mailer_test.rb",
615
- "test/support/integration_case.rb",
616
- "test/test_helper.rb",
617
- "test/unit/mail_engine/mail_log_test.rb",
618
- "test/unit/mail_engine/mail_schedule_test.rb",
619
- "test/unit/mail_engine/mail_template_file_test.rb",
620
- "test/unit/mail_engine/mail_template_test.rb",
621
- "test/unit/mail_engine/template_partial_test.rb",
622
- "test/unit/user_test.rb"
623
- ]
624
581
 
625
582
  if s.respond_to? :specification_version then
626
583
  s.specification_version = 3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_engine
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 14
10
- version: 0.1.14
9
+ - 15
10
+ version: 0.1.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - michael he
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-25 00:00:00 +08:00
18
+ date: 2012-01-25 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -32,8 +32,8 @@ dependencies:
32
32
  version: 3.0.0
33
33
  requirement: *id001
34
34
  prerelease: false
35
- name: activesupport
36
35
  type: :runtime
36
+ name: activesupport
37
37
  - !ruby/object:Gem::Dependency
38
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -46,8 +46,8 @@ dependencies:
46
46
  version: "0"
47
47
  requirement: *id002
48
48
  prerelease: false
49
- name: httparty
50
49
  type: :runtime
50
+ name: httparty
51
51
  - !ruby/object:Gem::Dependency
52
52
  version_requirements: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
@@ -60,8 +60,8 @@ dependencies:
60
60
  version: "0"
61
61
  requirement: *id003
62
62
  prerelease: false
63
- name: nokogiri
64
63
  type: :runtime
64
+ name: nokogiri
65
65
  - !ruby/object:Gem::Dependency
66
66
  version_requirements: &id004 !ruby/object:Gem::Requirement
67
67
  none: false
@@ -74,8 +74,8 @@ dependencies:
74
74
  version: "0"
75
75
  requirement: *id004
76
76
  prerelease: false
77
- name: deep_cloneable
78
77
  type: :runtime
78
+ name: deep_cloneable
79
79
  - !ruby/object:Gem::Dependency
80
80
  version_requirements: &id005 !ruby/object:Gem::Requirement
81
81
  none: false
@@ -88,8 +88,8 @@ dependencies:
88
88
  version: "0"
89
89
  requirement: *id005
90
90
  prerelease: false
91
- name: rack
92
91
  type: :runtime
92
+ name: rack
93
93
  - !ruby/object:Gem::Dependency
94
94
  version_requirements: &id006 !ruby/object:Gem::Requirement
95
95
  none: false
@@ -102,8 +102,8 @@ dependencies:
102
102
  version: "0"
103
103
  requirement: *id006
104
104
  prerelease: false
105
- name: liquid
106
105
  type: :runtime
106
+ name: liquid
107
107
  - !ruby/object:Gem::Dependency
108
108
  version_requirements: &id007 !ruby/object:Gem::Requirement
109
109
  none: false
@@ -116,8 +116,8 @@ dependencies:
116
116
  version: "0"
117
117
  requirement: *id007
118
118
  prerelease: false
119
- name: kaminari
120
119
  type: :runtime
120
+ name: kaminari
121
121
  - !ruby/object:Gem::Dependency
122
122
  version_requirements: &id008 !ruby/object:Gem::Requirement
123
123
  none: false
@@ -130,8 +130,8 @@ dependencies:
130
130
  version: "0"
131
131
  requirement: *id008
132
132
  prerelease: false
133
- name: carrierwave
134
133
  type: :runtime
134
+ name: carrierwave
135
135
  - !ruby/object:Gem::Dependency
136
136
  version_requirements: &id009 !ruby/object:Gem::Requirement
137
137
  none: false
@@ -144,8 +144,8 @@ dependencies:
144
144
  version: "0"
145
145
  requirement: *id009
146
146
  prerelease: false
147
- name: sqlite3-ruby
148
147
  type: :development
148
+ name: sqlite3-ruby
149
149
  - !ruby/object:Gem::Dependency
150
150
  version_requirements: &id010 !ruby/object:Gem::Requirement
151
151
  none: false
@@ -158,8 +158,8 @@ dependencies:
158
158
  version: "0"
159
159
  requirement: *id010
160
160
  prerelease: false
161
- name: annotate
162
161
  type: :development
162
+ name: annotate
163
163
  - !ruby/object:Gem::Dependency
164
164
  version_requirements: &id011 !ruby/object:Gem::Requirement
165
165
  none: false
@@ -172,8 +172,8 @@ dependencies:
172
172
  version: "0"
173
173
  requirement: *id011
174
174
  prerelease: false
175
- name: bluecloth
176
175
  type: :development
176
+ name: bluecloth
177
177
  - !ruby/object:Gem::Dependency
178
178
  version_requirements: &id012 !ruby/object:Gem::Requirement
179
179
  none: false
@@ -186,8 +186,8 @@ dependencies:
186
186
  version: "0"
187
187
  requirement: *id012
188
188
  prerelease: false
189
- name: yard
190
189
  type: :development
190
+ name: yard
191
191
  - !ruby/object:Gem::Dependency
192
192
  version_requirements: &id013 !ruby/object:Gem::Requirement
193
193
  none: false
@@ -200,8 +200,8 @@ dependencies:
200
200
  version: "0"
201
201
  requirement: *id013
202
202
  prerelease: false
203
- name: bundler
204
203
  type: :development
204
+ name: bundler
205
205
  - !ruby/object:Gem::Dependency
206
206
  version_requirements: &id014 !ruby/object:Gem::Requirement
207
207
  none: false
@@ -214,8 +214,8 @@ dependencies:
214
214
  version: "0"
215
215
  requirement: *id014
216
216
  prerelease: false
217
- name: jeweler
218
217
  type: :development
218
+ name: jeweler
219
219
  - !ruby/object:Gem::Dependency
220
220
  version_requirements: &id015 !ruby/object:Gem::Requirement
221
221
  none: false
@@ -228,8 +228,8 @@ dependencies:
228
228
  version: "0"
229
229
  requirement: *id015
230
230
  prerelease: false
231
- name: rcov
232
231
  type: :development
232
+ name: rcov
233
233
  - !ruby/object:Gem::Dependency
234
234
  version_requirements: &id016 !ruby/object:Gem::Requirement
235
235
  none: false
@@ -242,8 +242,8 @@ dependencies:
242
242
  version: "0"
243
243
  requirement: *id016
244
244
  prerelease: false
245
- name: reek
246
245
  type: :development
246
+ name: reek
247
247
  description: Rails system mail management solution.
248
248
  email: hlxwell@gmail.com
249
249
  executables: []
@@ -839,49 +839,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
839
839
  requirements: []
840
840
 
841
841
  rubyforge_project:
842
- rubygems_version: 1.4.1
842
+ rubygems_version: 1.6.2
843
843
  signing_key:
844
844
  specification_version: 3
845
845
  summary: Mail Management Solution
846
- test_files:
847
- - test/dummy/app/controllers/application_controller.rb
848
- - test/dummy/app/helpers/application_helper.rb
849
- - test/dummy/app/mailers/test/test_mailer.rb
850
- - test/dummy/app/mailers/user_mailer.rb
851
- - test/dummy/app/models/user.rb
852
- - test/dummy/config/application.rb
853
- - test/dummy/config/boot.rb
854
- - test/dummy/config/environment.rb
855
- - test/dummy/config/environments/development.rb
856
- - test/dummy/config/environments/production.rb
857
- - test/dummy/config/environments/test.rb
858
- - test/dummy/config/initializers/backtrace_silencers.rb
859
- - test/dummy/config/initializers/inflections.rb
860
- - test/dummy/config/initializers/mime_types.rb
861
- - test/dummy/config/initializers/secret_token.rb
862
- - test/dummy/config/initializers/session_store.rb
863
- - test/dummy/config/routes.rb
864
- - test/dummy/db/migrate/20110114030841_create_table_mail_template.rb
865
- - test/dummy/db/migrate/20110125094530_create_users.rb
866
- - test/dummy/db/migrate/20110126030525_create_mail_schedules.rb
867
- - test/dummy/db/migrate/20110204114145_create_template_partials.rb
868
- - test/dummy/db/migrate/20110206025002_create_mail_logs.rb
869
- - test/dummy/db/migrate/20110217062316_create_mail_template_files.rb
870
- - test/dummy/db/schema.rb
871
- - test/factories.rb
872
- - test/functional/mail_engine/dashboard_controller_test.rb
873
- - test/functional/mail_engine/mail_dispatcher_test.rb
874
- - test/functional/mail_engine/mail_logs_controller_test.rb
875
- - test/functional/mail_engine/mail_schedules_controller_test.rb
876
- - test/functional/mail_engine/mail_template_files_controller_test.rb
877
- - test/functional/mail_engine/mail_templates_controller_test.rb
878
- - test/functional/mail_engine/reports_controller_test.rb
879
- - test/functional/user_mailer_test.rb
880
- - test/support/integration_case.rb
881
- - test/test_helper.rb
882
- - test/unit/mail_engine/mail_log_test.rb
883
- - test/unit/mail_engine/mail_schedule_test.rb
884
- - test/unit/mail_engine/mail_template_file_test.rb
885
- - test/unit/mail_engine/mail_template_test.rb
886
- - test/unit/mail_engine/template_partial_test.rb
887
- - test/unit/user_test.rb
846
+ test_files: []
847
+