lib/ronin/generators/platform/extension.rb in ronin-gen-0.1.1 vs lib/ronin/generators/platform/extension.rb in ronin-gen-0.2.0

- old
+ new

@@ -1,7 +1,6 @@ # -#-- # Ronin Gen - A Ruby library for Ronin that provides various generators. # # Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at gmail.com) # # This program is free software; you can redistribute it and/or modify @@ -15,11 +14,10 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#++ # require 'ronin/generators/platform/static' require 'ronin/generators/dir_generator' require 'ronin/platform/extension' @@ -31,24 +29,22 @@ # The lib/ directory of the extension LIB_DIR = Ronin::Platform::Extension::LIB_DIR # The default extension file - EXTENSION_FILE = File.join('ronin','platform','generators','extension.rb') + EXTENSION_FILE = File.join('ronin','generators','platform','extension.rb') - protected - # # Generates a skeleton Extension. # - def generate! - name = File.basename(@path) + def generate + name = File.basename(self.path) - directory LIB_DIR - file File.join(LIB_DIR,name + '.rb') - directory File.join(LIB_DIR,name) + mkdir LIB_DIR + touch File.join(LIB_DIR,name + '.rb') + mkdir File.join(LIB_DIR,name) - copy EXTENSION_FILE, Ronin::Platform::Extension::EXTENSION_FILE + copy_file EXTENSION_FILE, Ronin::Platform::Extension::EXTENSION_FILE end end end end