<commit_before># gem install google_drive
# gem install highline

require 'trello'
require "google_drive"
require 'highline/import'
require 'rainbow'


columns = {
  iteration:        1,
  project:          2,
  id:               3,
  user_story_name:  4,
  status:           5,
  planned_effort:   6,
  prev_spent:       7,
  total_effort:     8,
  notes:            9
}

def init_trello
  config = YAML.load_file("config.yaml")

  developer_public_key = config["trello"]["developer_public_key"]
  access_token_key = config["trello"]["access_token_key"]
  developer_secret = config["trello"]["developer_secret"]
  
  include Trello
  include Trello::Authorization

  Trello::Authorization.const_set :AuthPolicy, OAuthPolicy

  OAuthPolicy.consumer_credential = OAuthCredential.new developer_public_key, developer_secret
  OAuthPolicy.token = OAuthCredential.new access_token_key, nil
end

def open_google_docs_session(default_email="<EMAIL>")
  username = ask("Enter google docs username: ") { |q| q.default = default_email }
  password = ask("Enter google docs password: ") { |q| q.echo = false }

  GoogleDrive.login(username, password)
end

init_trello
session = open_google_docs_session
puts "connected...".color(:green) if session


spreadsheet = session.spreadsheet_by_title("Backlog Futur3")
backlog = spreadsheet.worksheet_by_title("iterazioni")

team = Organization.find("futur3")
iteration = Board.find("4fd5acd0308f99fe3380e15b")
iteration_steps = iteration.lists

index = 3 # skip the headers
iteration_steps.each do |step|
  step.cards.each do |user_story|
    print ".".color(:green)
    backlog[index,columns[:project]] = user_story.labels.map(&:name).join(" - ")
    backlog[index,columns[:user_story_name]] = user_story.name
    backlog[index,columns[:status]] = step.name
    index += 1
  end
end

backlog.save
puts "[DONE]".color(:green)<commit_msg>fixed missing require<commit_after># gem install google_drive
# gem install highline

require 'yaml'
require 'trello'
require "google_drive"
require 'highline/import'
require 'rainbow'


columns = {
  iteration:        1,
  project:          2,
  id:               3,
  user_story_name:  4,
  status:           5,
  planned_effort:   6,
  prev_spent:       7,
  total_effort:     8,
  notes:            9
}

def init_trello
  config = YAML.load_file("config.yaml")

  developer_public_key = config["trello"]["developer_public_key"]
  access_token_key = config["trello"]["access_token_key"]
  developer_secret = config["trello"]["developer_secret"]
  
  include Trello
  include Trello::Authorization

  Trello::Authorization.const_set :AuthPolicy, OAuthPolicy

  OAuthPolicy.consumer_credential = OAuthCredential.new developer_public_key, developer_secret
  OAuthPolicy.token = OAuthCredential.new access_token_key, nil
end

def open_google_docs_session(default_email="<EMAIL>")
  username = ask("Enter google docs username: ") { |q| q.default = default_email }
  password = ask("Enter google docs password: ") { |q| q.echo = false }

  GoogleDrive.login(username, password)
end

init_trello
session = open_google_docs_session
puts "connected...".color(:green) if session


spreadsheet = session.spreadsheet_by_title("Backlog Futur3")
backlog = spreadsheet.worksheet_by_title("iterazioni")

team = Organization.find("futur3")
iteration = Board.find("4fdedc649b86ad81030e2e09")
iteration_steps = iteration.lists

index = 3 # skip the headers
iteration_steps.each do |step|
  step.cards.each do |user_story|
    print ".".color(:green)
    backlog[index,columns[:project]] = user_story.labels.map(&:name).join(" - ")
    backlog[index,columns[:user_story_name]] = user_story.name
    backlog[index,columns[:status]] = step.name
    index += 1
  end
end

backlog.save
puts "[DONE]".color(:green)
{'fraction_non_alphanumeric': 0.11539484179739432, 'fraction_numerical': 0.014357883541611273, 'mean_word_length': 4.508052708638361, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '192191', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1241, 'n_words': 253}