cpee 2.1.14 → 2.1.15

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: 41c8af6dfe0026a757a1cb1d3627415773aabf2e99712ac77207de2f518fbf0e
4
- data.tar.gz: 8b02404db658a5e2a6219e5b3843cee54beed9df08356d615c504bd56851b61d
3
+ metadata.gz: bdba71d5df8124590a3b932d83af91b87801663f3e21d8ebbafb9d4e2b339869
4
+ data.tar.gz: 73e7507c88a39096b2d418178a03150165a0966cd94ce4d452565a21c0e31683
5
5
  SHA512:
6
- metadata.gz: 04104b072172fa082b879e414f6ffec58d21fe99be5ec18a7fd3a070947139cf30d7f02e377b34bcd8e61cc9f5afef1570971224c4786e5338ab9c02c11cd50f
7
- data.tar.gz: 3cb492d19adf14b727c6ce14cd4edd2dcca0da1819502b63b20a68a249ce78a5c803b19c18a23d9051f00734cbb161cd0e9eac2ecb9efec2ce3d667cfa663440
6
+ metadata.gz: '093136bfeee58f4ba9152b15c5a83220aa219734160a50b60739f30337e08e2b99d2b503addcec8cd72c832bf67430b4e177110007f5693a593c8a513d620fec'
7
+ data.tar.gz: d50286266ac5d15a94f4c0f86cdd2d87b8730948e0f1a6bdfe0d0ca73af8104fdcf720620abf06b8819aaea005d6cf264954c0b063841f4dba22c29c977e2bd2
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.1.14"
3
+ s.version = "2.1.15"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
@@ -13,6 +13,7 @@
13
13
  # <http://www.gnu.org/licenses/>.
14
14
 
15
15
  require 'charlock_holmes'
16
+ require 'base64'
16
17
 
17
18
  class ConnectionWrapper < WEEL::ConnectionWrapperBase
18
19
  def self::loop_guard(arguments,id,count) # {{{
@@ -197,11 +198,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
197
198
  unless status.nil?
198
199
  @controller.notify("status/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :id => status.id, :message => status.message)
199
200
  end
200
- unless changed_dataelements.nil?
201
- @controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => dataelements)
201
+ unless changed_dataelements.nil? || changed_dataelements.empty?
202
+ de = dataelements.slice(*changed_dataelements).transform_values { |v| detect_encoding(v) == 'UTF-8' ? v : convert_to_base64(v) }
203
+ @controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => de)
202
204
  end
203
- unless changed_endpoints.nil?
204
- @controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints)
205
+ unless changed_endpoints.nil? || changed_endpoints.empty?
206
+ @controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints.slice(*changed_endpoints))
205
207
  end
206
208
  end # }}}
207
209
 
@@ -241,12 +243,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
241
243
  result
242
244
  end
243
245
 
244
- def detected_encoding(text)
246
+ def detect_encoding(text)
245
247
  CharlockHolmes::EncodingDetector.detect(text)[:encoding] || 'ISO-8859-1'
246
248
  end
247
249
 
248
- def convert_to_utf8(text)
249
- CharlockHolmes::Converter.convert(text, detected_encoding(text), "UTF-8")
250
+ def convert_to_base64(text)
251
+ 'data:application/octet-stream;base64,' + Base64::urlsafe_encode64(text)
250
252
  end
251
253
 
252
254
  def structurize_result(result)
@@ -267,7 +269,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
267
269
  tmp = {
268
270
  'name' => r.name == '' ? 'result' : r.name,
269
271
  'mimetype' => r.mimetype,
270
- 'data' => res
272
+ 'data' => (detect_encoding(res) == 'UTF-8' ? res : convert_to_base64(res))
271
273
  }
272
274
  r.value.rewind
273
275
  tmp
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.14
4
+ version: 2.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler