ci-helper 0.4.0 → 0.4.1

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: 61e68cfd07a49efbe7edeedfd4bb579d5359caa0b6660bf00d6a6f8cd653226b
4
- data.tar.gz: 915c87759e1da667c808d7136e4c3dc5fcf4be1ae81f3476b11b4b006542ecf2
3
+ metadata.gz: 0b8b84c09ceed862107e1dab8edc94376d88c9dc445edee953d22b098a9c1aec
4
+ data.tar.gz: 9dc1e0f8108facb2ef0f71396aa87c6e9989679483bb799aaeb96d762908be11
5
5
  SHA512:
6
- metadata.gz: 4e8d5ecaa8724f9f44df8606ebd1be1d64fe010e8c5f27947ee5e320b43b782ec97baa0e52c82b51190fcb68ef184c0aaa98e08f0cc31a8a5f51087348626572
7
- data.tar.gz: 5c48c38e8847e5a00d6b987a015d580ee1329b1fc32d9ba84963e677f59cff731eb08ffb6d90578277b82883c28bc7bb50484e129dff4de2445ffa59276925c1
6
+ metadata.gz: '01491ffa280587336bff05506b3b1bb0261c3b33c70cf2f13467f6cc2e052e70518c82ced20a4ae96d17cd7b8d4f61753d786d42c75ff96c3adbc55ada9ce004'
7
+ data.tar.gz: ac0468a7cd7aad077cfa8f35b351890fec936f888748d08d91d8fa5dca4a536a1be409ace409a9ce806995e83629be4014b7fce01b5eaea902eef5b6bb60211b
data/README.md CHANGED
@@ -74,6 +74,8 @@ List of available commands:
74
74
  Accepted flags: `--config-path`
75
75
  * `--config-path` — relative path to your config yaml file with schedule.
76
76
  Usually it is `config/sidekiq_scheduler.yml`.
77
+ * `--with-database` — if you want to prepare database before executing specs,
78
+ you should set this flag to `true`.
77
79
 
78
80
  ### Rake Tasks
79
81
 
@@ -54,6 +54,10 @@ module CIHelper
54
54
  raise Error, message
55
55
  end
56
56
 
57
+ def boolean_option(key)
58
+ options[key] == "true"
59
+ end
60
+
57
61
  def plural_option(key)
58
62
  return [] unless options.key?(key)
59
63
  options[key].split(",")
@@ -21,7 +21,7 @@ module CIHelper
21
21
  end
22
22
 
23
23
  def split_resultset?
24
- options[:split_resultset] == "true"
24
+ boolean_option(:split_resultset)
25
25
  end
26
26
 
27
27
  def setup_file_path
@@ -8,6 +8,7 @@ module CIHelper
8
8
  def call
9
9
  return 0 if job_constants.empty?
10
10
 
11
+ create_and_migrate_database! if with_database?
11
12
  cmd = craft_jobs_const_get_cmd
12
13
  execute_with_rails_runner(cmd)
13
14
  0
@@ -15,8 +16,12 @@ module CIHelper
15
16
 
16
17
  private
17
18
 
19
+ def env
20
+ :development
21
+ end
22
+
18
23
  def execute_with_rails_runner(cmd)
19
- execute("bundle exec rails runner \"#{cmd}\"")
24
+ execute("bundle exec rails runner '#{cmd}'")
20
25
  end
21
26
 
22
27
  def craft_jobs_const_get_cmd
@@ -27,6 +32,10 @@ module CIHelper
27
32
  @job_constants ||= config.values.reject(&:nil?).flat_map(&:keys).uniq
28
33
  end
29
34
 
35
+ def with_database?
36
+ boolean_option(:with_database)
37
+ end
38
+
30
39
  def config
31
40
  @config ||= YAML.load_file(options[:config_path])
32
41
  end
@@ -37,11 +37,11 @@ module CIHelper
37
37
  end
38
38
 
39
39
  def with_database?
40
- options[:with_database] == "true"
40
+ boolean_option(:with_database)
41
41
  end
42
42
 
43
43
  def split_resultset?
44
- options[:split_resultset] == "true"
44
+ boolean_option(:split_resultset)
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CIHelper
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustAnotherDude
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-30 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize