lib/ronin/ui/cli/commands/repos.rb in ronin-1.0.0 vs lib/ronin/ui/cli/commands/repos.rb in ronin-1.1.0.rc1

- old
+ new

@@ -15,22 +15,21 @@ # # You should have received a copy of the GNU General Public License # along with Ronin. If not, see <http://www.gnu.org/licenses/>. # -require 'ronin/ui/cli/command' +require 'ronin/ui/cli/model_command' require 'ronin/repository' -require 'ronin/database' module Ronin module UI module CLI module Commands # # The `ronin repos` command. # - class Repos < Command + class Repos < ModelCommand desc 'Manages Ronin repositories' class_option :add, :type => :string, :aliases => '-A', :banner => 'PATH' @@ -55,12 +54,10 @@ # # Executes the command. # def execute - Database.setup - if options[:add] add options[:add] elsif options[:install] install options[:install] elsif options.update? @@ -141,22 +138,13 @@ puts "SCM: #{repo.scm}" if repo.scm if repo.verbose? putc "\n" - if repo.title - puts "Title: #{repo.title}" - end - + puts "Title: #{repo.title}" if repo.title puts "URI: #{repo.uri}" if repo.uri - - if repo.source - puts "Source URI: #{repo.source}" - end - - if repo.website - puts "Website: #{repo.website}" - end + puts "Source URI: #{repo.source}" if repo.source + puts "Website: #{repo.website}" if repo.website executables = repo.executables unless executables.empty? puts "Executables: #{executables.join(', ')}"