Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updates trellobo for ruby-trello 0.3.1

  • Loading branch information...
commit 1a68a3e10639e2557277c6ec20b08244d7f772ac 1 parent 06dcc0e
Jeremy Tregunna jeremytregunna authored
Showing with 23 additions and 7 deletions.
  1. +1 −1  Gemfile
  2. +6 −2 Gemfile.lock
  3. +16 −4 trellobo.rb
2  Gemfile
View
@@ -1,5 +1,5 @@
source :rubygems
gem "cinch"
-gem "ruby-trello"
+gem "ruby-trello", '~> 0.3.1'
gem "json"
8 Gemfile.lock
View
@@ -4,10 +4,14 @@ GEM
addressable (2.2.6)
cinch (1.1.3)
json (1.6.2)
+ mime-types (1.17.2)
oauth (0.4.5)
- ruby-trello (0.2.0)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ ruby-trello (0.3.1)
addressable (~> 2.2.6)
oauth (~> 0.4.5)
+ rest-client (~> 1.6.7)
yajl-ruby (>= 1.1.0)
yajl-ruby (1.1.0)
@@ -17,4 +21,4 @@ PLATFORMS
DEPENDENCIES
cinch
json
- ruby-trello
+ ruby-trello (~> 0.3.1)
20 trellobo.rb
View
@@ -2,21 +2,33 @@
require 'trello'
require 'json'
-# there are 4 environment variables that must be set for the trellobot to behave
+# You will need an access token to use ruby-trello 0.3.0 or higher, which trellobo depends on. To
+# get it, you'll need to go to this URL:
+#
+# https://trello.com/1/connect?key=DEVELOPER_PUBLIC_KEY&name=trellobo&response_type=token&scope=read,write&expiration=never
+#
+# Substitute the DEVELOPER_PUBLIC_KEY with the value oyu'll supply in TRELLO_API_KEY below. At the end of this process,
+# You'll be told to give some key to the app, this is what you want to put in the TRELLO_API_ACCESS_TOKEN_KEY below.
+#
+# there are 5 environment variables that must be set for the trellobot to behave
# the way he is supposed to -
#
# TRELLO_API_KEY : your Trello API developer key
# TRELLO_API_SECRET : your Trello API developer secret
+# TRELLO_API_ACCESS_TOKEN_KEY : your Trello API access token key. See above how to generate it.
# TRELLO_BOT_CHANNEL : the name of the channel you want trellobot to live on, the server is freenode
# TRELLO_BOARD_ID : the trellobot looks at only one board and the lists on it, put its id here
$board = nil
-Trello::Client.public_key = ENV['TRELLO_API_KEY']
-Trello::Client.secret = ENV['TRELLO_API_SECRET']
+include Trello
+include Trello::Authorization
+Trello::Authorization.const_set :AuthPolicy, OAuthPolicy
+OAuthPolicy.consumer_credential = OAuthCredential.new ENV['TRELLO_API_KEY'], ENV['TRELLO_API_SECRET']
+OAuthPolicy.token = OAuthCredential.new ENV['TRELLO_API_ACCESS_TOKEN_KEY'], nil
def sync_board
- # Find the board each time, since ruby-trello currently does not have a `refresh` call. This will come in 0.3.0.
+ return $board.refresh! if $board
$board = Trello::Board.find(ENV['TRELLO_BOARD_ID'])
end
Please sign in to comment.
Something went wrong with that request. Please try again.