libis-workflow-activerecord 0.9.2 → 0.9.5

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
  SHA256:
3
- metadata.gz: 379a7d33367283bc65ca129d9824af1e486e335e308481b702451f4c0dd2dec5
4
- data.tar.gz: cf40df8e08387af400220bb24ac5f107540e5a00a3cf650a6f538c7260e8d6ef
3
+ metadata.gz: 8d41bc5ce60d5ec9f3368d4970f1659c1a524119616d3065e1167c60cc17e796
4
+ data.tar.gz: 33e6a53ad2260ca97924417196d4da388614430e6ce850d7d0b0229055c480ed
5
5
  SHA512:
6
- metadata.gz: e31730b7390994d48673e1cbf358f62d4b2d05df8b7cf18c4d020cf25f94ba8f16c2a9ee41dea80db338457dfa8e63eb5d70237ae3694ca067c2f6d54f553380
7
- data.tar.gz: a257bdf9e2bbe84a97e3114880307f2f38bb63217484443771cec173343cbd9465d57aedd76d29a3dc83c41df0e6796aa67b70b4b5c84b80f3dc0ccf73434546
6
+ metadata.gz: f5cceda837e1f187863dec902a1f7012a23aa6f97ec269261c31257ddd0b4290be778005a91c18f6a102b0824154ca4a01aaf0c50ec01edc9d07b8e91d551ef4
7
+ data.tar.gz: 5f091dc88445c9892827db5d7db3d3fe471395e59abc5307031725379ac8d775ffc970d85c6875105aa70d428e50834fb61ea676a8aeb0037e9b9fa34b67d811
data/Rakefile CHANGED
@@ -12,10 +12,11 @@ require 'yaml'
12
12
  # noinspection RubyResolve
13
13
  require 'logger'
14
14
  require 'active_record'
15
+ require 'database_cleaner'
15
16
 
16
- namespace :db do
17
+ namespace(:db) do
17
18
  def create_database(config)
18
- options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
19
+ options = {:charset => 'utf8', :collation => 'en_US.UTF-8'}
19
20
 
20
21
  create_db = lambda do |cfg|
21
22
  ActiveRecord::Base.establish_connection cfg.merge('database' => nil)
@@ -69,10 +70,16 @@ namespace :db do
69
70
  ActiveRecord::Base.connection.drop_database @config['database']
70
71
  end
71
72
 
73
+ desc 'Clears the database and reloads the default setup'
74
+ task :clear => :configure_connection do
75
+ DatabaseCleaner.strategy = :truncation
76
+
77
+ end
78
+
72
79
  desc 'Migrate the database (options: VERSION=x, VERBOSE=false).'
73
80
  task :migrate => :configure_connection do
74
81
  ActiveRecord::Migration.verbose = true
75
- ActiveRecord::Migrator.migrate MIGRATIONS_DIR, ENV['VERSION'] ? ENV['VERSION'].to_i : nil
82
+ ActiveRecord::MigrationContext.new(MIGRATIONS_DIR).migrate(ENV['VERSION'] ? ENV['VERSION'].to_i : nil)
76
83
  end
77
84
 
78
85
  desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).'
@@ -1,17 +1,18 @@
1
1
  default: &default
2
2
  adapter: postgresql
3
3
  encoding: utf-8
4
- database: upload
4
+ database: workflow
5
5
  host: localhost
6
6
  port: 5432
7
- username: upload
8
- password: upload
7
+ username: workflow
8
+ password: workflow
9
9
  # For details on connection pooling, see Rails configuration guide
10
10
  # http://guides.rubyonrails.org/configuring.html#database-pooling
11
11
  pool: 20
12
12
 
13
13
  development:
14
14
  <<: *default
15
+ database: workflow_dev
15
16
 
16
17
  # The specified database role being used to connect to postgres.
17
18
  # To create additional roles in postgres see `$ createuser --help`.
@@ -45,6 +46,7 @@ development:
45
46
  # Do not set this db to the same as development or production.
46
47
  test:
47
48
  <<: *default
49
+ database: workflow_test
48
50
  min_messages: warning
49
51
 
50
52
  # As with config/secrets.yml, you never want to store sensitive information,
@@ -10,10 +10,11 @@ class CreateStatusesTable < ActiveRecord::Migration[5.0]
10
10
  t.string :status, limit: 12
11
11
  t.integer :progress
12
12
  t.integer :max
13
+ t.datetime :created, null: false
14
+ t.datetime :updated, null: false
13
15
 
14
16
  t.references :work_item, foreign_key: {to_table: :work_items, on_delete: :cascade}
15
17
 
16
- t.timestamps
17
18
  end
18
19
 
19
20
  add_index :statuses, [:task, :id]
@@ -12,7 +12,6 @@ module Libis
12
12
  autoload :WorkItem, 'libis/workflow/activerecord/work_item'
13
13
  autoload :Run, 'libis/workflow/activerecord/run'
14
14
  autoload :Job, 'libis/workflow/activerecord/job'
15
- autoload :Worker, 'libis/workflow/activerecord/worker'
16
15
  autoload :Workflow, 'libis/workflow/activerecord/workflow'
17
16
  autoload :Status, 'libis/workflow/activerecord/status'
18
17
 
@@ -1,7 +1,7 @@
1
1
  module Libis
2
2
  module Workflow
3
3
  module ActiveRecord
4
- VERSION = '0.9.2' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
+ VERSION = '0.9.5' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
5
5
  end
6
6
  end
7
7
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ['lib']
31
31
 
32
32
  spec.add_runtime_dependency 'libis-workflow', '~> 2.0'
33
- spec.add_runtime_dependency 'activerecord', '~> 5'
33
+ spec.add_runtime_dependency 'activerecord', '~> 5.2'
34
34
 
35
35
  spec.add_development_dependency 'bundler', '~> 1.6'
36
36
  spec.add_development_dependency 'rake'
@@ -6,5 +6,4 @@ require_relative 'test_job'
6
6
 
7
7
  describe 'TestJob' do
8
8
 
9
- context
10
9
  end
@@ -14,6 +14,8 @@ require 'stringio'
14
14
 
15
15
  RSpec.configure do |cfg|
16
16
 
17
+ ActiveRecord::Migration.maintain_test_schema!
18
+
17
19
  cfg.before :suite do
18
20
  ::Libis::Workflow::ActiveRecord.configure do |config|
19
21
  config.logger.appenders =
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require 'backports/rails/string'
2
+ require 'libis/tools/extend/string'
3
3
  require 'libis-workflow'
4
4
 
5
5
  class CamelizeName < ::Libis::Workflow::Task
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-09 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libis-workflow
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5'
33
+ version: '5.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5'
40
+ version: '5.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -183,11 +183,8 @@ files:
183
183
  - lib/libis/workflow/activerecord/status.rb
184
184
  - lib/libis/workflow/activerecord/version.rb
185
185
  - lib/libis/workflow/activerecord/work_item.rb
186
- - lib/libis/workflow/activerecord/worker.rb
187
186
  - lib/libis/workflow/activerecord/workflow.rb
188
187
  - libis-workflow-activerecord.gemspec
189
- - spec/db_env.sh
190
- - spec/db_start.sh
191
188
  - spec/items.rb
192
189
  - spec/items/test_dir_item.rb
193
190
  - spec/items/test_file_item.rb
@@ -224,13 +221,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
221
  version: '0'
225
222
  requirements: []
226
223
  rubyforge_project:
227
- rubygems_version: 2.7.6
224
+ rubygems_version: 2.7.8
228
225
  signing_key:
229
226
  specification_version: 4
230
227
  summary: ActiveRecord persistence for the LIBIS Workflow framework.
231
228
  test_files:
232
- - spec/db_env.sh
233
- - spec/db_start.sh
234
229
  - spec/items.rb
235
230
  - spec/items/test_dir_item.rb
236
231
  - spec/items/test_file_item.rb
@@ -1,20 +0,0 @@
1
- require 'libis/workflow/worker'
2
- require 'sidekiq'
3
-
4
- module Libis
5
- module Workflow
6
- module ActiveRecord
7
-
8
- class Worker < Libis::Workflow::Worker
9
-
10
- def get_job(job_config)
11
- job_name = job_config.delete(:name)
12
- job = ::Libis::Workflow::ActiveRecord::Job.find(name: job_name).first
13
- raise RuntimeError.new "Workflow #{job_name} not found" unless job.is_a? ::Libis::Workflow::ActiveRecord::Job
14
- job
15
- end
16
-
17
- end
18
- end
19
- end
20
- end
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- export DB_HOST="kahana.mongohq.com:10053"
3
- export DB_HOST="localhost:27017"
4
- export DB_USER="test"
5
- export DB_PASS="abc123"
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- cd `dirname $0`
3
- mkdir -p ./data/db
4
- /opt/mongodb/bin/mongod --dbpath ./data/db
5
-