ish_models 0.0.33.294 → 0.0.33.296

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
  SHA256:
3
- metadata.gz: d49853fb1fe44d6dc77f3e32b8bb9d9b5bc1777158785bfbdba0b5bd45074f34
4
- data.tar.gz: 25c79791fd54335cfe0fa875566fdaf2ac222182b49c6942505fca2d4ae9eb5d
3
+ metadata.gz: d06c52c4c68b449a8416eedfeb0da3aa210cc2e097bbbfc63a6436b9f1923522
4
+ data.tar.gz: 6b44f5a057acc1b6e47ac749e0019aacd482735a530d34265c5dd112cb7b47da
5
5
  SHA512:
6
- metadata.gz: d6d5b56e6b552517ccad036d1e0f40513574dec7b392fb1616830b09b1429137e238fb2ad377abc062509a96896cab6dd7fe740cca0470fc01669501012610b4
7
- data.tar.gz: e989897eb0919b53a52fa53001123881a2a0d3ab447d8b62741e84de876aef5a86bcd0630c65cf3c537444798cb0c21c7bdee69c0c1abf81c9ab89f0d440ec83
6
+ metadata.gz: 5b9564338cf5c8897e5fae2ffb0d053f6b3308edd080cb19f6ddd56ef92422db7984745cea0b141d9d76f82691437078251e7a92b50776854d41aeb2add8ce2a
7
+ data.tar.gz: 958c4ab9ae95202a172496651ba9ea5f8b6a0992cd3809a8a5e2f8827a3944cbf8edb8025a72ea3f8c2d5a9e40e7e2677735cdefc87b8473fb4518c86be0ff0a
@@ -40,6 +40,8 @@ class ::Ish::EmailTemplate
40
40
  'DemmiTV <hello@demmi.tv>',
41
41
  'DemmiTV <no-reply@demmi.tv>',
42
42
 
43
+ 'Victor Pudeyev <victor@fedfis.com>',
44
+
43
45
  'Infinite Shelter <hello@infiniteshelter.com>',
44
46
  'Infinite Shelter <no-reply@infiniteshelter.com>',
45
47
 
@@ -84,7 +86,7 @@ class ::Ish::EmailTemplate
84
86
  <div><br></div>
85
87
  <div>Regards,</div>
86
88
  <div>-=----- &gt;8 --</div>
87
- <div>Victor Pudeyev<br>Director of Engineering<br><a href="mailto:victor@piousbox.com" target="_blank">victor@piousbox.com</a> | <a href="https://tidycal.com/wasya-co/30min" target="_blank">Book a chat</a><br></div>
89
+ <div>Victor Pudeyev<br>Director of Engineering<br><a href="mailto:victor@wasya.co" target="_blank">victor@wasya.co</a> | <a href="https://tidycal.com/wasya-co/30min" target="_blank">Book a chat</a><br></div>
88
90
  </div><hr /><br /><br /><br />
89
91
  AOL
90
92
 
@@ -26,7 +26,6 @@ class Office::EmailMessage
26
26
  field :preamble
27
27
  field :epilogue
28
28
 
29
- has_many :attachments, class_name: 'Photo'
30
29
 
31
30
  def lead
32
31
  Lead.find_by email: from
@@ -41,6 +40,8 @@ class Office::EmailMessage
41
40
  field :bcc, type: :string
42
41
  field :bccs, type: Array, default: []
43
42
 
43
+ field :logs, type: Array, default: []
44
+
44
45
  field :date, type: DateTime
45
46
  def received_at
46
47
  date
@@ -52,6 +53,7 @@ class Office::EmailMessage
52
53
  end
53
54
 
54
55
  has_many :email_attachments, class_name: 'Office::EmailAttachment', inverse_of: :email_message
56
+ has_many :attachments, class_name: 'Photo'
55
57
 
56
58
  def preview_str
57
59
  body = part_html || part_html || 'Neither part_html nor part_txt!'
@@ -100,6 +102,82 @@ class Office::EmailMessage
100
102
  end
101
103
  end
102
104
 
105
+ ## From: https://stackoverflow.com/questions/24672834/how-do-i-remove-emoji-from-string/24673322
106
+ def self.strip_emoji(text)
107
+ text = text.force_encoding('utf-8').encode
108
+ clean = ""
109
+
110
+ # symbols & pics
111
+ regex = /[\u{1f300}-\u{1f5ff}]/
112
+ clean = text.gsub regex, ""
113
+
114
+ # enclosed chars
115
+ regex = /[\u{2500}-\u{2BEF}]/ # I changed this to exclude chinese char
116
+ clean = clean.gsub regex, ""
117
+
118
+ # emoticons
119
+ regex = /[\u{1f600}-\u{1f64f}]/
120
+ clean = clean.gsub regex, ""
121
+
122
+ #dingbats
123
+ regex = /[\u{2702}-\u{27b0}]/
124
+ clean = clean.gsub regex, ""
125
+ end
126
+
127
+ ## For recursive parts of type `related`.
128
+ ## Content dispositions:
129
+ # "inline; creation-date=\"Tue, 11 Apr 2023 19:39:42 GMT\"; filename=image005.png; modification-date=\"Tue, 11 Apr 2023 19:47:53 GMT\"; size=14916",
130
+ #
131
+ ## Content Types:
132
+ # "application/pdf; name=\"Securities Forward Agreement -- HaulHub Inc -- Victor Pudeyev -- 2021-10-26.docx.pdf\""
133
+ # "image/jpeg; name=TX_DL_2.jpg"
134
+ # "image/png; name=image005.png"
135
+ # "multipart/alternative; boundary=_000_BL0PR10MB2913C560ADE059F0AB3A6D11829A9BL0PR10MB2913namp_",
136
+ # "text/html; charset=utf-8"
137
+ # "text/plain; charset=UTF-8"
138
+ # "text/calendar; charset=utf-8; method=REQUEST"
139
+ def churn_subpart part
140
+ if part.content_disposition&.include?('attachment')
141
+ ## @TODO: attachments !
142
+ ;
143
+ else
144
+ if part.content_type.include?("multipart/related") ||
145
+ part.content_type.include?("multipart/alternative")
146
+
147
+ part.parts.each do |subpart|
148
+ churn_subpart( subpart )
149
+ end
150
+ else
151
+ # attachment = Office::EmailAttachment.new({
152
+ # content: part.decoded,
153
+ # content_type: part.content_type,
154
+ # email_message: self,
155
+ # })
156
+ # attachment.save
157
+
158
+ if part.content_type.include?('text/html')
159
+ part_html = part.decoded
160
+
161
+ elsif part.content_type.include?("text/plain")
162
+ part_txt = part.decoded
163
+
164
+ elsif part.content_type.include?("text/calendar")
165
+ ;
166
+ elsif part.content_type.include?("application/pdf")
167
+ ;
168
+ elsif part.content_type.include?("image/jpeg")
169
+ ;
170
+ elsif part.content_type.include?("image/png")
171
+ ;
172
+
173
+ else
174
+ puts! part.content_type, '444 No action for a part with this content_type'
175
+
176
+ end
177
+ end
178
+ end
179
+ end
180
+
103
181
 
104
182
  end
105
183
  ::Msg = Office::EmailMessage
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.294
4
+ version: 0.0.33.296
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -238,7 +238,6 @@ files:
238
238
  - lib/wco/price.rb
239
239
  - lib/wco/product.rb
240
240
  - lib/wco/serverhost.rb
241
- - lib/wco/serverhost.rb-trash
242
241
  - lib/wco/subscription.rb
243
242
  homepage: https://wasya.co
244
243
  licenses:
@@ -1,45 +0,0 @@
1
-
2
-
3
-
4
- # WORKDIR = "/Users/piousbox/projects/docker_wco"
5
-
6
- # class Instance
7
- # def chmod
8
- # start do |ssh|
9
- # ssh.exec "sudo chmod +x /tmp/provision.sh"
10
- # # other operations on ssh
11
- # end
12
- # end
13
- # private
14
- # def start
15
- # Net::SSH.start(ip, 'ubuntu', keys: "mykey.pem" ) do |ssh|
16
- # yield ssh
17
- # end
18
- # end
19
- # end
20
-
21
-
22
- ## works:
23
- # nginx_root = '/opt/nginx'
24
- # config = { service_name: 'abba', }
25
- # Net::SSH.start( "18.209.12.11", "ubuntu", keys: "access/mac_id_rsa_3.pem" ) do |ssh|
26
- # out = ssh.scp.upload! "tmp/#{config[:service_name]}", "/opt/tmp/two.txt" do |ch, name, sent, total|
27
- # puts "#{name}: #{sent}/#{total}"
28
- # end
29
- # puts! out, 'out'
30
- # end
31
-
32
-
33
-
34
-
35
- def create_volume_1 config={}
36
- puts! config, '#create_volume'
37
-
38
- out = ` cd #{WORKDIR} ; \
39
- [ ! -e #{config[:kind]}__prototype.zip ] && wget #{config.tmpl.volume_zip} ; \
40
- [ ! -e #{config[:kind]}__prototype ] && unzip #{config[:kind]}__prototype.zip ; \
41
- mv #{config[:kind]}__prototype #{config[:service_name]}_data ; \
42
- echo ok #create_volume
43
- `;
44
- puts! out, 'out'
45
- end