blueberry_rails 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/blueberry_rails/app_builder.rb +1 -0
- data/lib/blueberry_rails/version.rb +3 -3
- data/templates/gitignore_custom.erb +1 -1
- data/templates/mail_body_helpers.rb +33 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d209641bc17ceaa8a6cfeaba032ed34a03eb787
|
4
|
+
data.tar.gz: 10e1518b10d15b6d424616877147466a1e13ecbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e33b7e2050451c2d2470b7312dfc57b7744f60b518c9094c1bbe45cafe4f5233f15bf5e789027a00c67e40e0cc1c41b755e679e6adc23f38f23b033a5ce3df0f
|
7
|
+
data.tar.gz: 67bd96aed578621549131cc469809ab43ecaf32f8903884516d711b6c2cd796559bdc4767fa3f30404e0c4c69c69a611ad2de8571498b589688c7d6de07f01e3
|
data/.travis.yml
CHANGED
@@ -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
|
@@ -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.
|
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-
|
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.
|
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.
|
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.
|
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
|