jflow 0.3.3 → 0.3.4

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: 3f7c1a9f16d55f86ad59e46cef04fb0fbaef40d1
4
- data.tar.gz: 828b8f5450b651809833a7049ca98bcac8c39459
3
+ metadata.gz: 788624cf432f825cb38797c8b1ca9a69c0877f50
4
+ data.tar.gz: 5a5445c5e36f3e759966d6e0d794985e3fc71164
5
5
  SHA512:
6
- metadata.gz: bc305f955ab2017c65039171ce54b1c61eecd626d8fb8c9fe08a9c9eee68795eb00ce8046056355b6bcd773bcdb466e94d39717f81dd253fa8005ae9b68cecab
7
- data.tar.gz: 3e0dae6906e36ff2729a1296b3491c8fd15a8bb1dcd48ac74f2a861d5961782c3a03891bebc330006e32cc178e6b5d2cbd1a8b0c22155422ec4db8830b84b87f
6
+ metadata.gz: 3514edb1f0438a673a13943dc4aa78421bfaae707c92adcfba1d5dda6ada72318f9e4ab41c5c8ef528be8f46ee163d177d94d8bffb3e900176af9011cfec0db2
7
+ data.tar.gz: 39cbc626388bf3bfabf2bf655b316f6852396c6c84c9fc204d7709e7a0dbbb4f74d24e815644cb26ffec7f5915c3fb943d5308d18a5f19ccde5e56e1fa049e45
data/bin/console CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "jflow"
3
3
  require "irb"
4
+
5
+ JFlow.configure do |c|
6
+ c.swf_client = Aws::SWF::Client.new
7
+ end
8
+
4
9
  IRB.start
data/lib/jflow.rb CHANGED
@@ -5,6 +5,7 @@ require 'aws-sdk'
5
5
  require 'logger'
6
6
  require "jflow/version"
7
7
  require "jflow/configuration.rb"
8
+ require "jflow/domain.rb"
8
9
  require "jflow/activity/definition.rb"
9
10
  require "jflow/activity/mixin.rb"
10
11
  require "jflow/activity/task.rb"
@@ -54,9 +54,13 @@ module JFlow
54
54
  @options[:version]
55
55
  end
56
56
 
57
+ def domain
58
+ JFlow::Domain.new(options[:domain])
59
+ end
60
+
57
61
  def registered?
58
62
  response = JFlow.configuration.swf_client.list_activity_types({
59
- domain: options[:domain],
63
+ domain: domain.domain_name,
60
64
  name: name,
61
65
  registration_status: "REGISTERED"
62
66
  })
@@ -0,0 +1,32 @@
1
+ module JFlow
2
+ class Domain
3
+
4
+ attr_reader :domain_name
5
+
6
+ def initialize(domain_name)
7
+ @domain_name = domain_name
8
+ create unless exists?
9
+ end
10
+
11
+ def create
12
+ JFlow.configuration.logger.debug "Registering domain #{domain_name}"
13
+ JFlow.configuration.swf_client.register_domain({
14
+ name: domain_name,
15
+ description: domain_name,
16
+ workflow_execution_retention_period_in_days: "90"
17
+ })
18
+ end
19
+
20
+ def exists?
21
+ domains = JFlow.configuration.swf_client.list_domains({
22
+ registration_status: "REGISTERED"
23
+ })
24
+ exists = domains.domain_infos
25
+ .map{|a| a.name}
26
+ .include?(domain_name)
27
+ JFlow.configuration.logger.debug "#{domain_name} found: #{exists}"
28
+ exists
29
+ end
30
+
31
+ end
32
+ end
data/lib/jflow/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JFlow
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christophe Verbinnen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -122,6 +122,7 @@ files:
122
122
  - lib/jflow/activity/worker.rb
123
123
  - lib/jflow/cli.rb
124
124
  - lib/jflow/configuration.rb
125
+ - lib/jflow/domain.rb
125
126
  - lib/jflow/version.rb
126
127
  - lib/jflow/worker_thread.rb
127
128
  homepage: https://github.com/djpate/jflow