Module: GreenHat::ShellHelper::Faststats
- Defined in:
- lib/greenhat/shell/faststats.rb
Overview
Hide from Commands
Class Method Summary collapse
- .files ⇒ Object
-
.invalid_settings ⇒ Object
Default Settings from arg parse that won’t work.
- .parse(raw) ⇒ Object
- .things ⇒ Object
Class Method Details
.files ⇒ Object
225 226 227 228 229 230 231 232 |
# File 'lib/greenhat/shell/faststats.rb', line 225 def self.files %w[ production_json api_json gitaly/current sidekiq/current ] end |
.invalid_settings ⇒ Object
Default Settings from arg parse that won’t work
197 198 199 |
# File 'lib/greenhat/shell/faststats.rb', line 197 def self.invalid_settings %i[page round truncate logic fuzzy_file_match] end |
.parse(raw) ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/greenhat/shell/faststats.rb', line 201 def self.parse(raw) file_list, flags, args = Args.parse(raw, invalid_settings) cmd = args.map { |opt| "--#{opt.field}=#{opt.value}" }.join(' ') cmd += flags.map do |flag, value| # Don't Include Raw next if flag == :raw case value when true then "--#{flag}" when Array then "--#{flag}=#{value.join}" else "--#{flag}=#{value}" end end.join(' ') # Prepare Log List file_list = ShellHelper.prepare_list(file_list, ShellHelper::Faststats.things, flags) # Convert to Things files = ShellHelper.find_things(file_list) [files, flags, cmd] end |
.things ⇒ Object
234 235 236 237 238 |
# File 'lib/greenhat/shell/faststats.rb', line 234 def self.things Thing.all.select do |thing| files.any? { |x| thing.name.include? x } end end |