Last active
October 17, 2016 01:13
-
-
Save webuilder240/1b1549869dd85b7ef17e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
require 'bundler/setup' | |
require 'trello' | |
include Trello | |
include Trello::Authorization | |
application_key = "" | |
application_secret = "" | |
application_token = "" | |
Trello::Authorization.const_set :AuthPolicy, OAuthPolicy | |
OAuthPolicy.consumer_credential = OAuthCredential.new application_key, application_secret | |
OAuthPolicy.token = OAuthCredential.new application_token, nil | |
me = Trello::Member.find("me") | |
board_name = ARGV[0] | |
version_name = ARGV[1] | |
file_name = "release_for_#{version_name}.md" | |
me.boards.each do |board| | |
if board.name == board_name | |
board.lists.each do |list| | |
if list.name == version_name | |
File.open(file_name, 'w') do |fh| | |
fh.write("# Release for #{board_name} #{version_name}" + "\n\n") | |
list.cards.each do |card| | |
headline = "- #{card.name}" | |
card.card_labels.map {|label| headline << " [ #{label['name']} ]"} | |
fh.write("#{headline}\n") | |
end | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment