glider 0.1.4 → 0.1.5

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: 7623e04641cd44f819d3dba574c6acb76df1366b
4
- data.tar.gz: 43aa08d14b103b2803f1837189a4246bd1f264a2
3
+ metadata.gz: 6b653bbf167cdd607c577a66082e832b738bff2c
4
+ data.tar.gz: 8907af6d186653c0c8aa4654f26d67a1ebb32e36
5
5
  SHA512:
6
- metadata.gz: 7e2715a4d6312a9e19a344ba366dbfc81f7c1740d1bb97b7f676193d06b6ce78f75b24c23851010359d1034e8618e257a342b59b80f69a4db749cd3a5fa92e57
7
- data.tar.gz: 7c38e18337f33379f572ec35e31f92acf792b4e576acddeb67486624a7d47da6e1debf9baad01a2215cfe895e1693ddc22301495ed560c3f0e8da03854e4c563
6
+ metadata.gz: cd70ce4a2aa250d2cb455379e20b07e505c2b2f2c11fd2a63a69441a19c4fc998eb40a2fd5d7735fcfb9f9270b2eaafc4156f4db30b06843ad576553191d0df5
7
+ data.tar.gz: f90d93362a33c0dac6744ee4453691b7b877e1d3b90983330b69a440b7d06a7d7ef403194b889a5ac566781856a13253b98fe27d7b634a5825a95e8870daa725
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  gem 'pry'
4
4
  gem 'aws-sdk'
5
5
  gem 'colorize'
6
- gem 'glider', '0.1.4'#, path: '../pkg/'
6
+ gem 'glider', '0.1.5'#, path: '../pkg/'
@@ -14,7 +14,7 @@ GEM
14
14
  uuidtools (~> 2.1)
15
15
  coderay (1.1.0)
16
16
  colorize (0.6.0)
17
- glider (0.1.4)
17
+ glider (0.1.5)
18
18
  activesupport (>= 4.0.0)
19
19
  aws-sdk
20
20
  json
@@ -40,5 +40,5 @@ PLATFORMS
40
40
  DEPENDENCIES
41
41
  aws-sdk
42
42
  colorize
43
- glider (= 0.1.4)
43
+ glider (= 0.1.5)
44
44
  pry
@@ -8,6 +8,7 @@ class MySWF < Glider::Component
8
8
  register_activity :hello_world, '1.5'
9
9
 
10
10
  def hello_world(input)
11
+ binding.pry
11
12
  task.fail! reason: "BECAUSE!" and return
12
13
  $logger.warn "Executing hello_world."
13
14
  sleep 2
@@ -10,7 +10,7 @@ class MySWF < Glider::Component
10
10
  def say_hi(event_name, event, data)
11
11
  case event_name
12
12
  when :workflow_execution_started, :hello_world_activity_timed_out
13
- task.schedule_activity_task activity(:hello_world, 1.5)
13
+ task.schedule_activity_task activity(:hello_world, 1.5), input: data.to_json
14
14
  when :test_signal
15
15
  # do what?
16
16
  when :hello_world_activity_completed
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glider 0.1.4 ruby lib
5
+ # stub: glider 0.1.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glider"
9
- s.version = "0.1.4"
9
+ s.version = "0.1.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["David Pelaez"]
@@ -32,6 +32,19 @@ module Glider
32
32
  end
33
33
  end
34
34
 
35
+ def process_input(input)
36
+ if input.nil?
37
+ nil
38
+ else
39
+ # try to parse input as json
40
+ begin
41
+ input = JSON.parse input
42
+ rescue JSON::ParserError
43
+ input
44
+ end
45
+ end
46
+ end
47
+
35
48
 
36
49
 
37
50
  def loop_block_for_activity(activity_type)
@@ -46,7 +59,7 @@ module Glider
46
59
  workflow_id = activity_task.workflow_execution.workflow_id
47
60
  Glider.logger.info "Executing activity=#{activity_type.name} workflow_id=#{workflow_id}"
48
61
  target_instance = self.new activity_task
49
- activity_result = target_instance.send activity_type.name, activity_task.input
62
+ activity_result = target_instance.send activity_type.name, process_input(activity_task.input)
50
63
  activity_task.complete! result: activity_result.to_s unless activity_task.responded?
51
64
  rescue AWS::SimpleWorkflow::ActivityTask::CancelRequestedError
52
65
  # cleanup after ourselves
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Pelaez