lib/ronin/gen/generators/library.rb in ronin-gen-1.0.0 vs lib/ronin/gen/generators/library.rb in ronin-gen-1.0.1.rc1
- old
+ new
@@ -91,11 +91,11 @@
#
# Generates top-level files.
#
def generate
unless options[:no_git]
- run "git init #{self.destination_root}"
+ inside { run "git init" }
end
erb File.join('ronin','gen','library','Gemfile.erb'), 'Gemfile'
cp File.join('ronin','gen','library','Rakefile'), 'Rakefile'
@@ -127,12 +127,16 @@
#
# Generates the contents of the `bin` directory.
#
def bin
mkdir 'bin'
+
+ bin_script = File.join('bin',"ronin-#{@dir_name}")
+
erb File.join('ronin','gen','library','bin','ronin-name.erb'),
- File.join('bin',"ronin-#{@dir_name}")
+ bin_script
+ chmod bin_script, 0755
end
#
# Generates the contents of the `lib` directory.
#
@@ -199,10 +203,13 @@
#
# Finalizes the generated library.
#
def finalize
unless options[:no_git]
- system('git','commit','-a','-m','Initial commit.')
+ inside do
+ run('git add .')
+ run('git commit -m "Initial commit."')
+ end
end
end
end
end