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 +4 -4
- data/bin/shiftzilla +17 -8
- data/lib/shiftzilla/engine.rb +7 -22
- data/lib/shiftzilla/helpers.rb +10 -5
- data/lib/shiftzilla/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9e9ace955249bdb89d69b99109741b37d827b5c9dd3abb7be7c2733f615cdf1
|
4
|
+
data.tar.gz: 802c36f72f1571ab298cb74f4f3e72cfb2e694f40f8fe768a120fb374700d7b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737b8e19515ffe95a1228885bae143f2d26efdfef803c8ea17ce5127c1ab4028a9a9f0a4dce5ab4d1e307163b7e3a6d8d306e844445d96024db7e3c11681eafe
|
7
|
+
data.tar.gz: 8bba34ac2ec258cc858715c44d3c25b1dde7b1d19ac4b35f29654b3e854e33560393e27656fefaca58974b40dd6ca3349afb9d13d8f9e97c7d19d1ef1469c972
|
data/bin/shiftzilla
CHANGED
@@ -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 :
|
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 :
|
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 :
|
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 :
|
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?(:
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
data/lib/shiftzilla/engine.rb
CHANGED
@@ -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::
|
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
|
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(
|
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
|
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(
|
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
|
data/lib/shiftzilla/helpers.rb
CHANGED
@@ -35,11 +35,16 @@ module Shiftzilla
|
|
35
35
|
:background_image => nil,
|
36
36
|
}
|
37
37
|
|
38
|
-
def
|
39
|
-
Shiftzilla.const_set('
|
40
|
-
|
41
|
-
|
42
|
-
|
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
|
data/lib/shiftzilla/version.rb
CHANGED