<commit_before>module TrelloArchiver

  class Prompt
    include Trello
    include Trello::Authorization

    def initialize(config)
      @config = config
    end

    def get_board

      me = Member.find("me")
      boardarray = Array.new
      optionnum = 1
      me.boards.each do |board|
        boardarray << board
        puts "#{optionnum}: #{board.name} #{board.id}"
        optionnum += 1
      end

      puts "0 - CANCEL\n\n"
      puts "Which board would you like to backup?"
      if @config['board'].nil?
        board_to_archive = gets.to_i - 1
      else
        board_to_archive = @config['board'] - 1
      end

      if board_to_archive == -1
         puts "Cancelling"
         exit 1
      end

      board = Board.find(boardarray[board_to_archive].id)
    end

    def get_filename

      puts "Would you like to provide a filename? (y/n)"

      if @config['filename'] == 'default'
        filename = @board.name.parameterize
      else
        response = gets.downcase.chomp
         if response.to_s =~ /^y/i
           puts "Enter filename:"
           filename = gets
         else
           filename = @board.name.parameterize
         end
      end


        puts "Preparing to backup #{@board.name}"
        lists = @board.lists
        filename
    end

    def run
      @board = get_board
      @filename = get_filename
      result = {}
      result[:board] = @board
      result[:filename] = @filename
      result
    end

  end
end<commit_msg>Fixed error in filename stripping trailing newlines<commit_after>module TrelloArchiver

  class Prompt
    include Trello
    include Trello::Authorization

    def initialize(config)
      @config = config
    end

    def get_board

      me = Member.find("me")
      boardarray = Array.new
      optionnum = 1
      me.boards.each do |board|
        boardarray << board
        puts "#{optionnum}: #{board.name} #{board.id}"
        optionnum += 1
      end

      puts "0 - CANCEL\n\n"
      puts "Which board would you like to backup?"
      if @config['board'].nil?
        board_to_archive = gets.to_i - 1
      else
        board_to_archive = @config['board'] - 1
      end

      if board_to_archive == -1
         puts "Cancelling"
         exit 1
      end

      board = Board.find(boardarray[board_to_archive].id)
    end

    def get_filename

      puts "Would you like to provide a filename? (y/n)"

      if @config['filename'] == 'default'
        filename = @board.name.parameterize
      else
        response = gets.downcase.chomp
         if response.to_s =~ /^y/i
           puts "Enter filename:"
           filename = gets.chomp
         else
           filename = @board.name.parameterize
         end
      end


        puts "Preparing to backup #{@board.name}"
        lists = @board.lists
        filename
    end

    def run
      @board = get_board
      @filename = get_filename
      result = {}
      result[:board] = @board
      result[:filename] = @filename
      result
    end

  end
end
{'fraction_non_alphanumeric': 0.09329349269588313, 'fraction_numerical': 0.004648074369189907, 'mean_word_length': 1.800185873605948, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1757111', 'n_tokens_mistral': 916, 'n_tokens_neox': 884, 'n_words': 247}