Sha256: 7d349d06e0d99b09057612df6a07f865b157b38cfffe3ca8d667b4a477ce92d8
Contents?: true
Size: 528 Bytes
Versions: 17
Compression:
Stored size: 528 Bytes
Contents
class ForgeCLI::AbilityInstaller class << self def install_abilities!(app, ability_class) @app = app @ability_class = ability_class new_content = File.read(ability_file).gsub( / end\nend\z/, " #{ability_invocation}\n end\nend" ) File.open(ability_file, "w") do |f| f.puts new_content end end def ability_file File.join(@app, 'app', 'models', 'ability.rb') end def ability_invocation "#{@ability_class}.new(u)" end end end
Version data entries
17 entries across 17 versions & 1 rubygems