bizflow 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf5cc11a92f56b5e3470e220e28363ea4110ba57
4
- data.tar.gz: 520b83aefd48673ac46073e06e6ad7c5a8b9978d
3
+ metadata.gz: 82be4e8b312c6c3fb85f4aac6a941ab765f383d2
4
+ data.tar.gz: 1e44023ed83860c17c83d68f7c6988ed307bde36
5
5
  SHA512:
6
- metadata.gz: 365f84921c9f4b8d71db9b83fb8d55e3b3e6d4ca8b018af84ed9f70ad5be16079bbaf64f7e8a3d3d9ab94c558dd553363915795ca7a8c2df014504b9880c68b4
7
- data.tar.gz: 8891c37a7c3d68e2f6228a98f96588a8b10d10510eb544b3d6e5fe35a02e3979da38e46db6cefb82c92510f0af044032d2c04ec6fa6bf4d43f69f935cef1487d
6
+ metadata.gz: c689fd59290b007fd6d257a7043a4fc7c512269a980dd7a8ff1c5e7b074aa99d604fefa6294cd4049dd692c30d0ac051b5e26764ddfaa035d122755e77c423ac
7
+ data.tar.gz: e9ce537220806aa16c2a33fc32fb2f9232048ac17a11f520c9beec5fb51193371fa2eb848c16db23d2aefc41104cbd86fc7725e9b7896916455328f125940c79
@@ -6,6 +6,11 @@ module Bizflow
6
6
 
7
7
  def self.run(config, args = [])
8
8
 
9
+ if(args[:args].empty?)
10
+ raise "Setup command needs environment argument (production, development, test...)"
11
+ end
12
+ environment = args[:args].first
13
+
9
14
  puts "Building processes..."
10
15
 
11
16
  require 'bizflow/lib/semantic_builder'
@@ -16,7 +21,10 @@ module Bizflow
16
21
  domain_repo = Bizflow::Lib::SemanticBuilder.new(source_path).build
17
22
 
18
23
  raise "bizflow database path not specified" if config[:db_path].nil?
19
- db_path = "#{Dir.pwd}/#{config[:db_path]}"
24
+
25
+ db_path = "bizflow_db/bf-#{environment}.db"
26
+ db_path = "#{Dir.pwd}/#{db_path}"
27
+
20
28
  db = Sequel.sqlite(db_path)
21
29
 
22
30
  Dir["#{File.dirname(__FILE__)}/../model/*.rb"].each { |path| require_relative path }
@@ -8,11 +8,16 @@ module Bizflow
8
8
 
9
9
  def self.run(config, args)
10
10
 
11
+ if(args[:args].empty?)
12
+ raise "Setup command needs environment argument (production, development, test...)"
13
+ end
14
+ environment = args[:args].first
15
+
11
16
  Sequel.extension :migration, :core_extensions
12
17
 
13
18
  puts "Bizflow: Migrating database"
14
- db_path = config[:db_path] || "bizflow_db/bf.db"
15
- db_path = "#{Dir.pwd}/#{db_path}"
19
+ db_path = config[:db_path] || "bizflow_db"
20
+ db_path = "#{Dir.pwd}/#{db_path}/bizflow_#{environment}.db"
16
21
 
17
22
  db = Sequel.sqlite(db_path)
18
23
 
@@ -8,10 +8,17 @@ module Bizflow
8
8
 
9
9
  def self.run(config, args)
10
10
 
11
+ if(args[:args].empty?)
12
+ raise "Setup command needs environment argument (production, development, test...)"
13
+ end
14
+ environment = args[:args].first
15
+
16
+ Sequel.extension :migration, :core_extensions
17
+
11
18
  # Create a database
12
19
  puts "Bizflow: Creating and migrating database for processes..."
13
20
 
14
- db_path = config[:db_path] || "bizflow_db/bf.db"
21
+ db_path = "bizflow_db/bf-#{environment}.db"
15
22
  db_path = "#{Dir.pwd}/#{db_path}"
16
23
 
17
24
  pn = Pathname.new(db_path)
@@ -19,7 +26,9 @@ module Bizflow
19
26
 
20
27
  db = Sequel.sqlite(db_path)
21
28
 
22
- puts "Bizflow: Database setup"
29
+ Sequel::Migrator.run(db, File.expand_path("#{File.expand_path(File.dirname(__FILE__))}/../migrations"), :use_transactions=>true)
30
+
31
+ puts "Bizflow: #{environment} database setup"
23
32
  end
24
33
 
25
34
  end
@@ -1,3 +1,3 @@
1
1
  module Bizflow
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - DSljukic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -151,15 +151,6 @@ files:
151
151
  - lib/bizflow/data_model/process_blueprint.rb
152
152
  - lib/bizflow/data_model/task.rb
153
153
  - lib/bizflow/data_model/task_blueprint.rb
154
- - lib/bizflow/fakes/action.rb
155
- - lib/bizflow/fakes/action_blueprint.rb
156
- - lib/bizflow/fakes/handler.rb
157
- - lib/bizflow/fakes/handler_blueprint.rb
158
- - lib/bizflow/fakes/head.rb
159
- - lib/bizflow/fakes/process.rb
160
- - lib/bizflow/fakes/process_blueprint.rb
161
- - lib/bizflow/fakes/task.rb
162
- - lib/bizflow/fakes/task_blueprint.rb
163
154
  - lib/bizflow/interpreters/domain_interpreter.rb
164
155
  - lib/bizflow/interpreters/input_action_interpreter.rb
165
156
  - lib/bizflow/interpreters/process_interpreter.rb
@@ -1,23 +0,0 @@
1
- require_relative 'task'
2
-
3
- module Bizflow
4
- module Fakes
5
- class Action
6
-
7
- attr_accessor :name, :type, :process, :next_actions, :tasks, :handlers, :action_blueprint
8
-
9
- def initialize(process, action_blueprint, name, type)
10
- @process = process
11
- @action_blueprint = action_blueprint
12
- @name = name
13
- @type = type
14
- @tasks = []
15
- end
16
-
17
- def add_task(hash)
18
- tasks << Bizflow::Fakes::Task.new(self, hash[:name], hash[:description])
19
- end
20
-
21
- end
22
- end
23
- end
@@ -1,24 +0,0 @@
1
- require_relative 'task_blueprint'
2
-
3
- module Bizflow
4
- module Fakes
5
- class ActionBlueprint
6
-
7
- attr_accessor :name, :type, :description, :process_blueprint, :task_blueprints, :handler_blueprints
8
-
9
- def initialize(process_blueprint, name, type, description = nil, task_blueprints = [], handler_blueprints)
10
- @process_blueprint = process_blueprint
11
- @name = name
12
- @type = type
13
- @description = description
14
- @task_blueprints = task_blueprints
15
- @handler_blueprints = handler_blueprints
16
- end
17
-
18
- def add_task(hash)
19
- task_blueprints << Bizflow::Fakes::TaskBlueprint.new(self, hash[:name], hash[:description])
20
- end
21
-
22
- end
23
- end
24
- end
@@ -1,15 +0,0 @@
1
- module Bizflow
2
- module Fakes
3
- class Handler
4
-
5
- attr_accessor :name, :namespace, :action, :finished
6
-
7
- def initialize(action, name, namespace)
8
- @action = action
9
- @name = name
10
- @namespace = namespace
11
- end
12
-
13
- end
14
- end
15
- end
@@ -1,18 +0,0 @@
1
- require_relative 'task_blueprint'
2
-
3
- module Bizflow
4
- module Fakes
5
- class HandlerBlueprint
6
-
7
- attr_accessor :name, :namespace, :description, :action_blueprint
8
-
9
- def initialize(action_blueprint, name, namespace, description = nil)
10
- @action_blueprint = action_blueprint
11
- @name = name
12
- @namespace = namespace
13
- @description = description
14
- end
15
-
16
- end
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- module Bizflow
2
- module Fakes
3
- class Head
4
-
5
- attr_accessor :process, :action
6
-
7
- def initialize(process, action = nil)
8
- @process = process
9
- @actions = [action]
10
- end
11
-
12
- end
13
- end
14
- end
@@ -1,20 +0,0 @@
1
- module Bizflow
2
- module Fakes
3
- class Process
4
-
5
- attr_accessor :name, :description, :actions, :heads, :start
6
-
7
- def initialize(name, description = nil)
8
- @name = name
9
- @description = description
10
- @heads = []
11
- @actions = []
12
- end
13
-
14
- def update(*args)
15
-
16
- end
17
-
18
- end
19
- end
20
- end
@@ -1,14 +0,0 @@
1
- module Bizflow
2
- module Fakes
3
- class Process
4
-
5
- attr_accessor :name, :description
6
-
7
- def initialize(name, description = nil)
8
- @name = name
9
- @description = description
10
- end
11
-
12
- end
13
- end
14
- end
@@ -1,16 +0,0 @@
1
- module Bizflow
2
- module Fakes
3
- class Task
4
-
5
- attr_accessor :name, :description, :action, :assignee_id, :auto_assign
6
-
7
- def initialize(action, name, auto_assign = false, description = nil)
8
- @action = action
9
- @name = name
10
- @description = description
11
- @auto_assign = auto_assign
12
- end
13
-
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- require_relative 'task_blueprint'
2
-
3
- module Bizflow
4
- module Fakes
5
- class TaskBlueprint
6
-
7
- attr_accessor :name, :roles, :description, :auto_assign, :action_blueprint
8
-
9
- def initialize(action_blueprint, name, roles, description = nil, auto_assign = nil)
10
- @action_blueprint = action_blueprint
11
- @name = name
12
- @roles = roles
13
- @description = description
14
- @auto_assign = auto_assign || false
15
- end
16
-
17
- end
18
- end
19
- end