<commit_before># -*- coding: utf-8 -*-

require 'pbl'
require 'pit'
require 'pinboard'
require 'colored'

module Pbl
  class CLI
    def initialize(*args)
      config = Pit.get("pinboard",
        require: {
          "username" => "your_account_in_pinboard",
          "password" => "<PASSWORD>"
      }
    )

    @username = config['username']
    @passowrd = config['password']
    end

    def self.run(*args)
      self.new(*args).run
    end

    def run
      unless ARGV.empty?
        pinboard = Pinboard::Client.new(:username => "#{@username}", :password => "#{<PASSWORD>}")
        posts = pinboard.posts
        pinboard.posts(:tag => ARGV[0]).each do |post|
          puts post[1] + " || " + post[0].green
        end
      end
    end

  end
end<commit_msg>Refactoring<commit_after># -*- coding: utf-8 -*-

require 'pit'
require 'pinboard'
require 'colored'

module Pbl
  class CLI
    def initialize
      config = Pit.get(:pinboard,
        require: {
          username: "your_account_in_pinboard",
          password: "<PASSWORD>"
        }
      )

      @pinboard = Pinboard::Client.new(
        username: config[:username],
        password: config[:password]
      )

      @argv = ARGV || []
    end

    def self.run
      self.new.run
    end

    def run
      abort "Usage: pbl TAG" if @argv.empty?
      @pinboard.posts(:tag => @argv.join(',')).each do |post|
        puts "%s || %s" % [post[1], post[0].green]
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.14986376021798364, 'fraction_numerical': 0.004768392370572207, 'mean_word_length': 2.1321961620469083, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '2587695', 'n_tokens_mistral': 489, 'n_tokens_neox': 477, 'n_words': 111}