blueberry_rails 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94728753f0b19949d2b6f003de3e94a4451af30c
4
- data.tar.gz: a3d0ad6310e09ab70601f65ed839c5d4c613f8e7
3
+ metadata.gz: 6d209641bc17ceaa8a6cfeaba032ed34a03eb787
4
+ data.tar.gz: 10e1518b10d15b6d424616877147466a1e13ecbc
5
5
  SHA512:
6
- metadata.gz: dee59d3e3411747d1a69dd4c8a6c691727f66c25c187fcb4e0a9494369684ce306048a3d353cebac5668598328ab98f4798b81cfe6683e4b7806ced8addf52a5
7
- data.tar.gz: 296e9a9ce33695cf6f5580eac1b371629655f15dc62f9cb50a2cb6b3635c0309e8d945e2a8489c30cb28a6dcf3223fd3fb3fab61a4b18909e6478eeee6d5a249
6
+ metadata.gz: e33b7e2050451c2d2470b7312dfc57b7744f60b518c9094c1bbe45cafe4f5233f15bf5e789027a00c67e40e0cc1c41b755e679e6adc23f38f23b033a5ce3df0f
7
+ data.tar.gz: 67bd96aed578621549131cc469809ab43ecaf32f8903884516d711b6c2cd796559bdc4767fa3f30404e0c4c69c69a611ad2de8571498b589688c7d6de07f01e3
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  script: 'bundle exec rake'
3
3
  rvm:
4
- - 2.2.2
4
+ - 2.2.3
5
5
  before_install:
6
6
  - gem update --system
@@ -89,6 +89,7 @@ module BlueberryRails
89
89
  def setup_rspec_support_files
90
90
  copy_file 'factory_girl_syntax.rb', 'spec/support/factory_girl.rb'
91
91
  copy_file 'database_cleaner_setup.rb', 'spec/support/database_cleaner.rb'
92
+ copy_file 'mail_body_helpers.rb', 'spec/mixins/mail_body_helpers.rb'
92
93
  end
93
94
 
94
95
  def init_guard
@@ -1,7 +1,7 @@
1
1
  module BlueberryRails
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
 
4
- RUBY_VERSION = '2.2.2'
4
+ RUBY_VERSION = '2.2.3'
5
5
 
6
- RAILS_VERSION = '4.2.3'
6
+ RAILS_VERSION = '4.2.4'
7
7
  end
@@ -9,7 +9,7 @@
9
9
  coverage/*
10
10
  config/database.yml
11
11
  db/*.sqlite3
12
- log/*
12
+ log/*.log
13
13
  public/system
14
14
  rerun.txt
15
15
  tags
@@ -0,0 +1,33 @@
1
+ module MailBodyHelpers
2
+ MULTIPART_CONTENT_TYPE = /multipart/
3
+
4
+ # this will collect all parts including parts under multipart container
5
+ # and returns array of parts
6
+ def get_mail_body_parts(mail)
7
+ if mail.content_type =~ MULTIPART_CONTENT_TYPE
8
+ mail.body.parts.flat_map do |part|
9
+ part.content_type =~ MULTIPART_CONTENT_TYPE ? part.parts : part
10
+ end
11
+ else
12
+ # if mail is not multipart then whole mail is part
13
+ # (with content type, body etc.)
14
+ [mail]
15
+ end
16
+ end
17
+
18
+ # this will return content for given type body
19
+ # get_mail_body(mail, /plain/)
20
+ # get_mail_body(mail, /html/)
21
+ # get_mail_body(mail, /pdf/)
22
+ def get_mail_body(mail, type)
23
+ get_mail_body_parts(mail).detect { |p| p.content_type.match type }.decoded
24
+ end
25
+
26
+ # this will return content for given type body
27
+ # get_mail_encoded_body(mail, /plain/)
28
+ # get_mail_encoded_body(mail, /html/)
29
+ # get_mail_encoded_body(mail, /pdf/)
30
+ def get_mail_attachement_body(mail, type)
31
+ get_mail_body_parts(mail).detect { |p| p.content_type.match type }.encoded
32
+ end
33
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueberry_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlueberryApps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.2.3
33
+ version: 4.2.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.2.3
40
+ version: 4.2.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +119,7 @@ files:
119
119
  - templates/gulp/util/bundleLogger.coffee
120
120
  - templates/gulp/util/handleErrors.coffee
121
121
  - templates/layout.html.slim
122
+ - templates/mail_body_helpers.rb
122
123
  - templates/pryrc.rb
123
124
  - templates/root_controller_spec.rb
124
125
  - templates/secret_token.rb.erb
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  version: '0'
146
147
  requirements: []
147
148
  rubyforge_project:
148
- rubygems_version: 2.4.6
149
+ rubygems_version: 2.4.5.1
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: A Rails app template by BlueberryApps