mailcatcher-jruby 1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db3de1ac2c71a4f2527f8fc89ca04dd393c8e7dd
4
- data.tar.gz: 1d6b9017bc94386eb14694308f1557e75d388cbe
3
+ metadata.gz: ee3b2fdd291a0f4ef4bf0a7d223577cab7f90f2d
4
+ data.tar.gz: 22679dba081b3b6b08b7d03633634514067edc3e
5
5
  SHA512:
6
- metadata.gz: fd21fcae35b466de0d78d8fac33bfea6509903a8609122b8e3334ee0f018da3c3f5ec90629789f78167b14d5831f90dd1601c33e7e4da5ac4541d6cddb103290
7
- data.tar.gz: d431ef8c32c497efa82f1604f886eb9ed118125b722841641467d8e953cec27e079117ded31064f65390a153459237e853390ab0c2e11977cb9b1e391e90c691
6
+ metadata.gz: a59ff3bc7c83df67c3c4b74545fb0724ecdcf4f1e2701ea48337b5e15582e2aa8e5989a0a7761b0b782e1e4639cb2ba5c21ffc66bd9c1ec7baf9b6581d0b895a
7
+ data.tar.gz: 56340005b69b5893f443c550fe064873ad55c97625dc1bba6b1f9a93f5ac114053696cd4a2afbc35f9d336ec9376571315c238bf67673641ceeb1cd4cc3c46a6
data/README.md CHANGED
@@ -1,22 +1,32 @@
1
- # MailCatcher
1
+ # MailCatcher for JRuby
2
2
 
3
- ## JRuby Support
4
- 1. Configure rails.
5
- To set up your rails app, I recommend adding this to your `environment/development.rb`:
3
+ ## Usage for JRuby on Rails.
6
4
 
7
- config.action_mailer.delivery_method = :smtp
8
- config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
5
+ 1. `gem install mailcatcher-jruby`
9
6
 
10
- 2. Start the smpt server at port 1025
11
- `jruby server.rb`
7
+ 2. Start the smpt server at port 9000
8
+ `mailcatcher`
12
9
 
13
- 3. Start Puma rack server to host web pages of emails.
14
- `puma`
10
+ use `--smtp-port 1080` to change the port to 1080
11
+
12
+ 3. Start Puma rack server to host web pages of emails at port 9090.
13
+ `mailweb`
15
14
  add `-p 1080` to use port 1080
16
15
 
17
- Open [http://127.0.0.1:9292](http://127.0.0.1:9292) to see emails.
16
+ Open [http://127.0.0.1:9090](http://127.0.0.1:9090) to see emails.
17
+
18
18
 
19
- # Original Document
19
+ 4. Configure rails.
20
+ To set up your rails app, I recommend adding this to your `environment/development.rb`:
21
+
22
+ config.action_mailer.delivery_method = :smtp
23
+ config.action_mailer.smtp_settings = { :address => "127.0.0.1", :port =>
24
+ 9000 }
25
+
26
+
27
+ # Original Documentation
28
+
29
+ # MailCatcher
20
30
 
21
31
 
22
32
  Catches mail and serves it through a dream.
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  require 'optparse'
11
11
 
12
- options = {:smtp_ip => '127.0.0.1', :smtp_port => 1025}
12
+ options = {:smtp_ip => '127.0.0.1', :smtp_port => 9000}
13
13
 
14
14
  OptionParser.new do |parser|
15
15
  parser.banner = <<-BANNER.gsub /^ +/, ""
@@ -32,7 +32,7 @@ OptionParser.new do |parser|
32
32
  parser.on('-f FROM', 'Set the sending address') do |from|
33
33
  options[:from] = from
34
34
  end
35
-
35
+
36
36
  parser.on('-oi', 'Ignored option -oi') do |ignored|
37
37
  end
38
38
  parser.on('-t', 'Ignored option -t') do |ignored|
@@ -58,4 +58,5 @@ end
58
58
 
59
59
  message = Mail.new ARGF.read
60
60
  message.return_path = options[:from] if options[:from]
61
+ puts 'Got email input, sending...'
61
62
  message.deliver
File without changes
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'puma/cli'
4
+
5
+ rack_path = File.expand_path('../../config.ru', __FILE__)
6
+ default_params = ARGV.include?('-p') ? [rack_path] : [rack_path, '-p', '9090']
7
+ cli = Puma::CLI.new (default_params + ARGV)
8
+ cli.run
@@ -1,3 +1,3 @@
1
1
  module MailCatcher
2
- VERSION = "1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -5,30 +5,6 @@ require 'uri'
5
5
  #require 'skinny'
6
6
 
7
7
 
8
- # #-=--------------------
9
- # module MailCatcher
10
- # end
11
-
12
- # DB_CONF = { adapter: 'jdbcsqlite3', database: 'db' }
13
-
14
- # class Message < ActiveRecord::Base
15
- # establish_connection DB_CONF
16
- # has_many :message_parts, dependent: :destroy
17
- # self.inheritance_column = nil
18
-
19
- # def recipients
20
- # self[:recipients] &&= ActiveSupport::JSON.decode self[:recipients]
21
- # end
22
- # end
23
- # class MessagePart < ActiveRecord::Base
24
- # establish_connection DB_CONF
25
- # belongs_to :message
26
- # self.inheritance_column = nil
27
- # end
28
-
29
- # #---------------------------
30
-
31
-
32
8
  class Sinatra::Request
33
9
  #include Skinny::Helpers
34
10
  end
@@ -1,6 +1,6 @@
1
1
  (function() {
2
2
  var MailCatcher,
3
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
3
+ _this = this;
4
4
 
5
5
  jQuery.expr[':'].icontains = function(a, i, m) {
6
6
  var _ref, _ref1;
@@ -8,13 +8,24 @@
8
8
  };
9
9
 
10
10
  MailCatcher = (function() {
11
+
11
12
  function MailCatcher() {
12
- this.nextTab = __bind(this.nextTab, this);
13
- this.previousTab = __bind(this.previousTab, this);
14
- this.openTab = __bind(this.openTab, this);
15
- this.selectedTab = __bind(this.selectedTab, this);
16
- this.getTab = __bind(this.getTab, this);
17
13
  var _this = this;
14
+ this.nextTab = function(tab) {
15
+ return MailCatcher.prototype.nextTab.apply(_this, arguments);
16
+ };
17
+ this.previousTab = function(tab) {
18
+ return MailCatcher.prototype.previousTab.apply(_this, arguments);
19
+ };
20
+ this.openTab = function(i) {
21
+ return MailCatcher.prototype.openTab.apply(_this, arguments);
22
+ };
23
+ this.selectedTab = function() {
24
+ return MailCatcher.prototype.selectedTab.apply(_this, arguments);
25
+ };
26
+ this.getTab = function(i) {
27
+ return MailCatcher.prototype.getTab.apply(_this, arguments);
28
+ };
18
29
  $('#messages tr').live('click', function(e) {
19
30
  e.preventDefault();
20
31
  return _this.loadMessage($(e.currentTarget).attr('data-message-id'));
@@ -249,7 +260,7 @@
249
260
  };
250
261
 
251
262
  MailCatcher.prototype.addMessage = function(message) {
252
- return $('#messages tbody').prepend($('<tr />').attr('data-message-id', message.id.toString()).append($('<td/>').text(message.sender || "No sender").toggleClass("blank", !message.sender)).append($('<td/>').text((message.recipients || []).join(', ') || "No receipients").toggleClass("blank", !message.recipients.length)).append($('<td/>').text(message.subject || "No subject").toggleClass("blank", !message.subject)).append($('<td/>').text(this.formatDate(message.created_at))));
263
+ return $('#messages tbody').prepend($('<tr />').attr('data-message-id', message.id.toString()).append($('<td/>').text(message.sender || "No sender").toggleClass("blank", !message.sender)).append($('<td/>').text((message.recipients || []).join(', ') || "No recipients").toggleClass("blank", !message.recipients.length)).append($('<td/>').text(message.subject || "No subject").toggleClass("blank", !message.subject)).append($('<td/>').text(this.formatDate(message.created_at))));
253
264
  };
254
265
 
255
266
  MailCatcher.prototype.scrollToRow = function(row) {
@@ -285,12 +296,10 @@
285
296
  messageRow.addClass('selected');
286
297
  this.scrollToRow(messageRow);
287
298
  return $.getJSON("/messages/" + id + ".json", function(message) {
288
- //----- change recipients to array
289
- if(typeof message.recipients != 'undefined') {
299
+ var $ul;
300
+ if (message.recipients != null) {
290
301
  message.recipients = JSON.parse(message.recipients);
291
302
  }
292
- //--------------------------------
293
- var $ul;
294
303
  $('#message .metadata dd.created_at').text(_this.formatDate(message.created_at));
295
304
  $('#message .metadata dd.from').text(message.sender);
296
305
  $('#message .metadata dd.to').text((message.recipients || []).join(', '));
@@ -378,11 +387,9 @@
378
387
  return $.getJSON('/messages', function(messages) {
379
388
  return $.each(messages, function(i, message) {
380
389
  if (!_this.haveMessage(message)) {
381
- //----- change recipients to array
382
- if(typeof message.recipients != 'undefined') {
390
+ if (message.recipients != null) {
383
391
  message.recipients = JSON.parse(message.recipients);
384
392
  }
385
- //--------------------------------
386
393
  return _this.addMessage(message);
387
394
  }
388
395
  });
@@ -62,8 +62,10 @@ body {
62
62
  color: black;
63
63
  font-size: 12px;
64
64
  font-family: Helvetica, sans-serif; }
65
+ body * html {
66
+ font-size: 75%; }
65
67
  body html {
66
- font-size: 75%;
68
+ font-size: 12px;
67
69
  line-height: 2em; }
68
70
  body.iframe {
69
71
  background: white; }
@@ -89,7 +91,6 @@ body {
89
91
  background: -webkit-linear-gradient(#f4f4f4, #ececec), #ececec;
90
92
  background: -moz-linear-gradient(#f4f4f4, #ececec), #ececec;
91
93
  background: -o-linear-gradient(#f4f4f4, #ececec), #ececec;
92
- background: -ms-linear-gradient(#f4f4f4, #ececec), #ececec;
93
94
  background: linear-gradient(#f4f4f4, #ececec), #ececec;
94
95
  color: #666666;
95
96
  text-shadow: 1px 1px 0 white;
@@ -101,7 +102,6 @@ body {
101
102
  background: -webkit-linear-gradient(#eeeeee, #dddddd), #dddddd;
102
103
  background: -moz-linear-gradient(#eeeeee, #dddddd), #dddddd;
103
104
  background: -o-linear-gradient(#eeeeee, #dddddd), #dddddd;
104
- background: -ms-linear-gradient(#eeeeee, #dddddd), #dddddd;
105
105
  background: linear-gradient(#eeeeee, #dddddd), #dddddd;
106
106
  color: #333333;
107
107
  text-decoration: none; }
@@ -112,7 +112,6 @@ body {
112
112
  background: -webkit-linear-gradient(#dddddd, #eeeeee), #eeeeee;
113
113
  background: -moz-linear-gradient(#dddddd, #eeeeee), #eeeeee;
114
114
  background: -o-linear-gradient(#dddddd, #eeeeee), #eeeeee;
115
- background: -ms-linear-gradient(#dddddd, #eeeeee), #eeeeee;
116
115
  background: linear-gradient(#dddddd, #eeeeee), #eeeeee;
117
116
  color: #333333;
118
117
  text-decoration: none;
@@ -136,7 +135,6 @@ body > header {
136
135
  text-shadow: 0 1px 0 white;
137
136
  -webkit-transition: 0.1s ease;
138
137
  -moz-transition: 0.1s ease;
139
- -ms-transition: 0.1s ease;
140
138
  -o-transition: 0.1s ease;
141
139
  transition: 0.1s ease; }
142
140
  body > header h1 a:hover {
@@ -163,7 +161,6 @@ body > header {
163
161
  background: -webkit-linear-gradient(#f4f4f4, #ececec), #ececec;
164
162
  background: -moz-linear-gradient(#f4f4f4, #ececec), #ececec;
165
163
  background: -o-linear-gradient(#f4f4f4, #ececec), #ececec;
166
- background: -ms-linear-gradient(#f4f4f4, #ececec), #ececec;
167
164
  background: linear-gradient(#f4f4f4, #ececec), #ececec;
168
165
  color: #666666;
169
166
  text-shadow: 1px 1px 0 white;
@@ -173,7 +170,6 @@ body > header {
173
170
  background: -webkit-linear-gradient(#eeeeee, #dddddd), #dddddd;
174
171
  background: -moz-linear-gradient(#eeeeee, #dddddd), #dddddd;
175
172
  background: -o-linear-gradient(#eeeeee, #dddddd), #dddddd;
176
- background: -ms-linear-gradient(#eeeeee, #dddddd), #dddddd;
177
173
  background: linear-gradient(#eeeeee, #dddddd), #dddddd;
178
174
  color: #333333;
179
175
  text-decoration: none; }
@@ -182,7 +178,6 @@ body > header {
182
178
  background: -webkit-linear-gradient(#dddddd, #eeeeee), #eeeeee;
183
179
  background: -moz-linear-gradient(#dddddd, #eeeeee), #eeeeee;
184
180
  background: -o-linear-gradient(#dddddd, #eeeeee), #eeeeee;
185
- background: -ms-linear-gradient(#dddddd, #eeeeee), #eeeeee;
186
181
  background: linear-gradient(#dddddd, #eeeeee), #eeeeee;
187
182
  color: #333333;
188
183
  text-decoration: none;
@@ -211,7 +206,6 @@ body > header {
211
206
  cursor: pointer;
212
207
  -webkit-transition: 0.1s ease;
213
208
  -moz-transition: 0.1s ease;
214
- -ms-transition: 0.1s ease;
215
209
  -o-transition: 0.1s ease;
216
210
  transition: 0.1s ease;
217
211
  color: #333333; }
@@ -274,31 +268,30 @@ body > header {
274
268
  #message > header .metadata .attachments ul {
275
269
  display: inline; }
276
270
  #message > header .metadata .attachments ul li {
277
- display: -moz-inline-box;
278
- -moz-box-orient: vertical;
271
+ display: -moz-inline-stack;
279
272
  display: inline-block;
280
273
  vertical-align: middle;
281
274
  *vertical-align: auto;
275
+ zoom: 1;
276
+ *display: inline;
282
277
  margin-right: 0.5em; }
283
- #message > header .metadata .attachments ul li {
284
- *display: inline; }
285
278
  #message > header .views ul {
286
279
  padding: 0 0.5em;
287
280
  border-bottom: 1px solid #cccccc; }
288
281
  #message > header .views .tab {
289
- display: -moz-inline-box;
290
- -moz-box-orient: vertical;
282
+ display: -moz-inline-stack;
291
283
  display: inline-block;
292
284
  vertical-align: middle;
293
- *vertical-align: auto; }
294
- #message > header .views .tab {
295
- *display: inline; }
285
+ *vertical-align: auto;
286
+ zoom: 1;
287
+ *display: inline; }
296
288
  #message > header .views .tab a {
297
- display: -moz-inline-box;
298
- -moz-box-orient: vertical;
289
+ display: -moz-inline-stack;
299
290
  display: inline-block;
300
291
  vertical-align: middle;
301
292
  *vertical-align: auto;
293
+ zoom: 1;
294
+ *display: inline;
302
295
  padding: 0.5em;
303
296
  border: 1px solid #cccccc;
304
297
  background: #dddddd;
@@ -307,8 +300,6 @@ body > header {
307
300
  cursor: pointer;
308
301
  text-shadow: 0 1px 0 #eeeeee;
309
302
  text-decoration: none; }
310
- #message > header .views .tab a {
311
- *display: inline; }
312
303
  #message > header .views .tab:not(.selected):hover a {
313
304
  background-color: #eeeeee; }
314
305
  #message > header .views .tab.selected a {
@@ -321,15 +312,14 @@ body > header {
321
312
  margin-bottom: -2px;
322
313
  cursor: default; }
323
314
  #message > header .views .action {
324
- display: -moz-inline-box;
325
- -moz-box-orient: vertical;
315
+ display: -moz-inline-stack;
326
316
  display: inline-block;
327
317
  vertical-align: middle;
328
318
  *vertical-align: auto;
319
+ zoom: 1;
320
+ *display: inline;
329
321
  float: right;
330
322
  margin: 0 0.25em; }
331
- #message > header .views .action {
332
- *display: inline; }
333
323
 
334
324
  .fractal-analysis {
335
325
  margin: 12px 0; }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailcatcher-jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
- - Samuel Cochran
7
+ - Samuel Cochran, Cam Song
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2013-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -211,15 +211,17 @@ dependencies:
211
211
  prerelease: false
212
212
  type: :development
213
213
  description: |2
214
+ [JRuby portion] of the original MailCatcher.
214
215
  MailCatcher runs a super simple SMTP server which catches any
215
216
  message sent to it to display in a web interface. Run
216
217
  mailcatcher, set your favourite app to deliver to
217
- smtp://127.0.0.1:1025 instead of your default SMTP server,
218
- then check out http://127.0.0.1:1080 to see the mail.
219
- email: sj26@sj26.com
218
+ smtp://127.0.0.1:9000 instead of your default SMTP server,
219
+ then check out http://127.0.0.1:9090 to see the mail.
220
+ email: neosoyn@gmail.com
220
221
  executables:
221
222
  - mailcatcher
222
223
  - catchmail
224
+ - mailweb
223
225
  extensions: []
224
226
  extra_rdoc_files:
225
227
  - README.md
@@ -229,6 +231,7 @@ files:
229
231
  - LICENSE
230
232
  - bin/catchmail
231
233
  - bin/mailcatcher
234
+ - bin/mailweb
232
235
  - lib/mail_catcher.rb
233
236
  - lib/mail_catcher/events.rb
234
237
  - lib/mail_catcher/growl.rb
@@ -249,7 +252,7 @@ files:
249
252
  - public/stylesheets/application.css
250
253
  - public/stylesheets/analysis.xsl
251
254
  - views/index.haml
252
- homepage: https://github.com/camsong/mailcatcher
255
+ homepage: https://github.com/camsong/mailcatcher-jruby
253
256
  licenses:
254
257
  - MIT
255
258
  metadata: {}