Skip to content

Commit

Permalink
Merge pull request #3 from RadiusNetworks/refactor-helpers
Browse files Browse the repository at this point in the history
Refactor the helpers to work with classes
  • Loading branch information
cupakromer authored Dec 14, 2018
2 parents 7c96040 + 8374e46 commit dab7ca3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
14 changes: 0 additions & 14 deletions lib/radius/cli/common_setup_helpers.rb

This file was deleted.

27 changes: 27 additions & 0 deletions lib/radius/cli/helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

require 'English'
require 'fileutils'
require 'pathname'

module Radius
module Cli
module Helpers
APP_ROOT = Pathname.getwd.ascend.find { |path| path.join("Gemfile").exist? }

def self.included(klass)
klass.include FileUtils
end

module_function

def app_root
APP_ROOT
end

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
end
end
end

0 comments on commit dab7ca3

Please sign in to comment.