Class: Jekyll::VersionPlugin::Tag::SystemWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll_version_plugin.rb

Overview

A wrapper around system calls; mock/stub this in testing

Instance Method Summary collapse

Instance Method Details

#command_succeeded?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/jekyll_version_plugin.rb', line 21

def command_succeeded?
  !$?.nil? && $?.success?
end

#git_repo?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/jekyll_version_plugin.rb', line 25

def git_repo?
  system("git rev-parse")
end

#run(command) ⇒ Object



17
18
19
# File 'lib/jekyll_version_plugin.rb', line 17

def run(command)
  `#{command}`
end