shiftzilla 0.2.21 → 0.2.22

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: db7512777af875feda57de1b110ac3969924e288d5278c343dd0eabd2ea51a1f
4
- data.tar.gz: c227a3425277f86e61c1eb38254f67982959ee26d5f75883614f79a67e31d4fd
3
+ metadata.gz: a9e9ace955249bdb89d69b99109741b37d827b5c9dd3abb7be7c2733f615cdf1
4
+ data.tar.gz: 802c36f72f1571ab298cb74f4f3e72cfb2e694f40f8fe768a120fb374700d7b7
5
5
  SHA512:
6
- metadata.gz: 7cf353cfb4e047d2fddc220fdeea3e9a55f3b698923777080e276dd28e351d6b848655dad6d9c32d2d8cf4b3bd467d2688870de7002657e244794861f1008097
7
- data.tar.gz: 3e796a5a8134da476e308109274b9ef7b957d4392031b60dfcd4e36418175d4d0e6099e3453aa272cf5958f1a9d5cc61d2eb8272c1cba2b729328f09fc5ca874
6
+ metadata.gz: 737b8e19515ffe95a1228885bae143f2d26efdfef803c8ea17ce5127c1ab4028a9a9f0a4dce5ab4d1e307163b7e3a6d8d306e844445d96024db7e3c11681eafe
7
+ data.tar.gz: 8bba34ac2ec258cc858715c44d3c25b1dde7b1d19ac4b35f29654b3e854e33560393e27656fefaca58974b40dd6ca3349afb9d13d8f9e97c7d19d1ef1469c972
@@ -46,7 +46,9 @@ Description:
46
46
  Options:
47
47
  EOF
48
48
  opt :purge, "After querying for bug data - if we already have data for today, clear it out before loading new data", :default => false
49
- opt :configdir, "Specify a config directory for shiftzilla to use.", :default => DEFAULT_DIR
49
+ opt :cfgpath, "Specify a config file for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla_cfg.yaml"
50
+ opt :dbpath, "Specify a database file location for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla.sqlite"
51
+ opt :archpath, "Specify a path to store database backups.", :default => "#{DEFAULT_DIR}/archive"
50
52
  end
51
53
  when 'build'
52
54
  Optimist::options do
@@ -62,7 +64,8 @@ Options:
62
64
  EOF
63
65
  opt :local_preview, "Don't publish, just show the report locally", :default => false
64
66
  opt :quiet, "For cron use; don't print anything to STDOUT.", :default => false
65
- opt :configdir, "Specify a config directory for shiftzilla to use.", :default => DEFAULT_DIR
67
+ opt :cfgpath, "Specify a config file for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla_cfg.yaml"
68
+ opt :dbpath, "Specify a database file location for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla.sqlite"
66
69
  end
67
70
  when 'purge'
68
71
  Optimist::options do
@@ -75,7 +78,8 @@ Description:
75
78
 
76
79
  Options:
77
80
  EOF
78
- opt :configdir, "Specify a config directory for shiftzilla to use.", :default => DEFAULT_DIR
81
+ opt :cfgpath, "Specify a config file for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla_cfg.yaml"
82
+ opt :dbpath, "Specify a database file location for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla.sqlite"
79
83
  end
80
84
  when 'triage'
81
85
  Optimist::options do
@@ -89,7 +93,8 @@ Description:
89
93
 
90
94
  Options:
91
95
  EOF
92
- opt :configdir, "Specify a config directory for shiftzilla to use.", :default => DEFAULT_DIR
96
+ opt :cfgpath, "Specify a config file for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla_cfg.yaml"
97
+ opt :dbpath, "Specify a database file location for shiftzilla to use.", :default => "#{DEFAULT_DIR}/shiftzilla.sqlite"
93
98
  end
94
99
  when 'help'
95
100
  Optimist::educate
@@ -98,10 +103,14 @@ when 'version'
98
103
  exit 0
99
104
  end
100
105
 
101
- if cmd_opts.has_key?(:configdir)
102
- set_sza_dir(cmd_opts[:configdir])
103
- else
104
- set_sza_dir(DEFAULT_DIR)
106
+ if cmd_opts.has_key?(:cfgpath)
107
+ set_sza_cfg(cmd_opts[:cfgpath])
108
+ end
109
+ if cmd_opts.has_key?(:dbpath)
110
+ set_sza_db(cmd_opts[:dbpath])
111
+ end
112
+ if cmd_opts.has_key?(:archpath)
113
+ set_sza_arch(cmd_opts[:archpath])
105
114
  end
106
115
 
107
116
  # Check for the config info
@@ -9,31 +9,16 @@ include Shiftzilla::Helpers
9
9
  module Shiftzilla
10
10
  module Engine
11
11
  def check_config
12
- if not File.directory?(Shiftzilla::SZA_DIR)
13
- choose do |menu|
14
- menu.header = "You don't have a Shiftzilla config directory at #{Shiftzilla::SZA_DIR}. Should I create one?"
15
- menu.prompt = 'Choice?'
16
- menu.choice(:yes) {
17
- say('Okay. Creating config directory.')
18
- Dir.mkdir(Shiftzilla::SZA_DIR)
19
- Dir.mkdir(Shiftzilla::ARCH_DIR)
20
- }
21
- menu.choice(:no) {
22
- say('Okay. Exiting Shiftzilla.')
23
- exit
24
- }
25
- end
26
- end
27
- if not File.directory?(Shiftzilla::ARCH_DIR)
12
+ if Shiftzilla.const_defined?('ARCH_DIR') and not File.directory?(Shiftzilla::ARCH_DIR)
28
13
  puts "You don't have an archive directory at #{Shiftzilla::ARCH_DIR}. Creating it."
29
14
  Dir.mkdir(Shiftzilla::ARCH_DIR)
30
15
  end
31
- if not File.exists?(Shiftzilla::CFG_FILE)
16
+ if Shiftzilla.const_defined?('CFG_FILE') and not File.exists?(Shiftzilla::CFG_FILE)
32
17
  choose do |menu|
33
- menu.header = "\nYou don't have a shiftzilla_cfg.yml file in #{Shiftzilla::SZA_DIR}. Should I create one?"
18
+ menu.header = "\nYou don't have a shiftzilla config file at #{Shiftzilla::CFG_FILE}. Should I create one?"
34
19
  menu.prompt = 'Choice?'
35
20
  menu.choice(:yes) {
36
- say('Okay. Creating shiftzilla_cfg.yml')
21
+ say("Okay. Creating #{Shiftzilla::CFG_FILE}")
37
22
  FileUtils.cp(CFG_TMPL,Shiftzilla::CFG_FILE)
38
23
  }
39
24
  menu.choice(:no) {
@@ -42,12 +27,12 @@ module Shiftzilla
42
27
  }
43
28
  end
44
29
  end
45
- if not File.exists?(Shiftzilla::DB_FPATH)
30
+ if Shiftzilla.const_defined?('DB_FPATH') and not File.exists?(Shiftzilla::DB_FPATH)
46
31
  choose do |menu|
47
- menu.header = "\nYou don't have a shiftzilla.sqlite file in #{Shiftzilla::SZA_DIR}.\nI can create it for you, but it is very important for you to\nconfigure Shiftzilla by puttng the proper settings in\n#{Shiftzilla::CFG_FILE} first.\nDo you want me to proceed with creating the database?"
32
+ menu.header = "\nYou don't have a shiftzilla database file at #{Shiftzilla::DB_FPATH}.\nI can create it for you, but it is very important for you to\nconfigure Shiftzilla by puttng the proper settings in\n#{Shiftzilla::CFG_FILE} first.\nDo you want me to proceed with creating the database?"
48
33
  menu.prompt = 'Choice?'
49
34
  menu.choice(:yes) {
50
- say('Okay. Creating shiftzilla.sqlite')
35
+ say("Okay. Creating #{Shiftzilla::DB_FPATH}")
51
36
  sql_tmpl = File.read(SQL_TMPL)
52
37
  tgt_rel_clause = release_clause(releases)
53
38
  sql_tmpl.gsub! '$RELEASE_CLAUSE', tgt_rel_clause
@@ -35,11 +35,16 @@ module Shiftzilla
35
35
  :background_image => nil,
36
36
  }
37
37
 
38
- def set_sza_dir(sza_dir)
39
- Shiftzilla.const_set('SZA_DIR',sza_dir)
40
- Shiftzilla.const_set('ARCH_DIR',File.join(Shiftzilla::SZA_DIR,'archive'))
41
- Shiftzilla.const_set('CFG_FILE',File.join(Shiftzilla::SZA_DIR,'shiftzilla_cfg.yml'))
42
- Shiftzilla.const_set('DB_FPATH',File.join(Shiftzilla::SZA_DIR,DB_FNAME))
38
+ def set_sza_cfg(sza_cfg)
39
+ Shiftzilla.const_set('CFG_FILE',sza_cfg)
40
+ end
41
+
42
+ def set_sza_db(sza_db)
43
+ Shiftzilla.const_set('DB_FPATH',sza_db)
44
+ end
45
+
46
+ def set_sza_arch(sza_arch)
47
+ Shiftzilla.const_set('ARCH_DIR',sza_arch)
43
48
  end
44
49
 
45
50
  def tmp_dir
@@ -1,3 +1,3 @@
1
1
  module Shiftzilla
2
- VERSION = "0.2.21"
2
+ VERSION = "0.2.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiftzilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.21
4
+ version: 0.2.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - N. Harrison Ripps