Class: VHS::CLI::Cassettes

Inherits:
Object
  • Object
show all
Defined in:
lib/vhs/cli/cassettes.rb

Instance Method Summary collapse

Instance Method Details

#allObject

Public: returns an array with all cassettes



14
15
16
# File 'lib/vhs/cli/cassettes.rb', line 14

def all
  `#{ all_cassettes_cmd } | #{ rm_trailing_chars_cmd }`.split(/\n/)
end

#all_strObject

Public: returns a string with a list, n separated, of all cassettes



9
10
11
# File 'lib/vhs/cli/cassettes.rb', line 9

def all_str
  `#{ all_cassettes_cmd }`
end

#cleanObject



40
41
42
# File 'lib/vhs/cli/cassettes.rb', line 40

def clean
  `#{ rm_cassettes_not_in_git_cmd }`
end

#errorObject

Public: returns an array with all cassettes with HTTP code not 2xx



25
26
27
# File 'lib/vhs/cli/cassettes.rb', line 25

def error
  `#{ error_cassettes_cmd } | #{ rm_trailing_chars_cmd }`.split(/\n/)
end

#error_strObject

Public: returns a string with a list, n separated, of cassettes with HTTP code not 2xx



20
21
22
# File 'lib/vhs/cli/cassettes.rb', line 20

def error_str
  `#{ error_cassettes_cmd }`
end

#regexp(code) ⇒ Object

Public: returns an array of cassettes with code matching the regexp <code>



36
37
38
# File 'lib/vhs/cli/cassettes.rb', line 36

def regexp(code)
  `#{ all_cassettes_cmd(code) } | #{ rm_trailing_chars_cmd }`.split(/\n/)
end

#regexp_str(code) ⇒ Object

Public: returns a string with a list, n separated, of cassettes with HTTP code matching the regexp <code>



31
32
33
# File 'lib/vhs/cli/cassettes.rb', line 31

def regexp_str(code)
  `#{ all_cassettes_cmd(code) }`
end