class PreCommitHook

Attributes

dot_env_dot_example[R]
type[R]

Public Class Methods

new(dot_env_dot_example = nil) click to toggle source
# File lib/dot_example/pre_commit_hook.rb, line 2
def initialize(dot_env_dot_example = nil)
  @dot_env_dot_example = dot_env_dot_example || DotEnvDotExample.new
  @type = "pre-commit"
  create_file_if_does_not_exist
end

Public Instance Methods

steps() click to toggle source

TODO: Make it possible to put .env and .env.example files somewhere else? Maybe later if people actually want this feature

# File lib/dot_example/pre_commit_hook.rb, line 12
def steps
  [
    "dot_example sync",
    "git add .env.example"
  ].join("\n")
end