Git Product home page Git Product logo

ruby-trello's Introduction

Ruby Trello API

Ruby Code Climate

This library implements the Trello API.

Trello is an awesome tool for organization. Not just aimed at developers, but everybody. Seriously, check it out.

Full API documentation.

Full Disclosure: This library is mostly complete, if you do find anything missing or not functioning as you expect it to, please just create an issue.

Requirements

Ruby \ ActiveModel 6.0 6.1 7.0 7.1
2.7
3.0
3.1
3.2
  • Use the newest version for Ruby 2.7.0 or newer support.
  • Use version 3.2.0 or earlier for Ruby 2.5 ~ 2.6 support.
  • Use version 2.2.1 or earlier for Ruby 2.1 ~ 2.4 support.
  • Use version 1.3.0 or earlier for Ruby 1.9.3 support.
  • Use version 1.4.x or earlier for Ruby 2.0.0 support.

Installation

gem install ruby-trello

Configuration

Basic authorization:

  1. Get your API public key from Trello via trello.com/app-key/ or the irb console as follows:
$ gem install ruby-trello
$ irb -rubygems
irb> require 'trello'
irb> Trello.open_public_key_url                         # copy your public key
irb> Trello.open_authorization_url key: 'yourpublickey' # copy your member token
  1. You can now use the public key and member token in your app code:
require 'trello'

Trello.configure do |config|
  config.developer_public_key = TRELLO_DEVELOPER_PUBLIC_KEY # The "key" from step 1
  config.member_token = TRELLO_MEMBER_TOKEN # The token from step 2.
end

2-legged OAuth authorization

Trello.configure do |config|
  config.consumer_key = TRELLO_CONSUMER_KEY
  config.consumer_secret = TRELLO_CONSUMER_SECRET
  config.oauth_token = TRELLO_OAUTH_TOKEN
  config.oauth_token_secret = TRELLO_OAUTH_TOKEN_SECRET
end

3-legged OAuth authorization

Trello.configure do |config|
  config.consumer_key    = TRELLO_CONSUMER_KEY
  config.consumer_secret = TRELLO_CONSUMER_SECRET
  config.return_url      = "http://your.site.com/path/to/receive/post"
  config.callback        = lambda { |request_token| DB.save(request_token.key, request_token.secret) }
end

All the calls this library makes to Trello require authentication using these keys. Be sure to protect them.

HTTP Client

ruby-trello requires either rest-client or faraday to be present for network calls. You can configure ruby-trello to use either one, depending on your project's needs. If both are present, ruby-trello defaults to using faraday.

Trello.configure do |config|
  config.http_client = 'faraday'
  # OR
  config.http_client = 'rest-client'
end

Usage

So let's say you want to get information about the user bobtester. We can do something like this:

bob = Trello::Member.find("bobtester")

# Print out his name
puts bob.full_name # "Bob Tester"

# Print his bio
puts bob.bio # A wonderfully delightful test user

# How about a list of his boards?
bob.boards

# And then to read the lists of the first board do :
bob.boards.first.lists
Accessing specific items

There is no find by name method in the trello API, to access a specific item, you have to know it's ID. The best way is to pretty print the elements and then find the id of the element you are looking for.

# With bob
pp bob.boards # Will pretty print all boards, allowing us to find our board id

# We can now access it's lists
pp Trello::Board.find( board_id ).lists # will pretty print all lists. Let's get the list id

# We can now access the cards of the list
pp Trello::List.find( list_id ).cards

# We can now access the checklists of the card
pp Trello::Card.find( card_id ).checklists

# and so on ...
Changing a checkbox state
# First get your checklist id
checklist = Trello::Checklist.find( checklist_id )

# At this point, there is no more ids. To get your checklist item,
# you have to know it's position (same as in the trello interface).
# Let's take the first
checklist_item = checklist.items.first

# Then we can read the status
checklist_item.state # return 'complete' or 'incomplete'

# We can update it (note we call update_item_state from checklist, not from checklist_item)
checklist.update_item_state( checklist_item.id, 'complete' ) # or 'incomplete'

# You can also use true or false instead of 'complete' or 'incomplete'
checklist.update_item_state( checklist_item.id, true ) # or false

Multiple Users

Applications that make requests on behalf of multiple Trello users have an alternative to global configuration. For each user's access token/secret pair, instantiate a Trello::Client:

@client_bob = Trello::Client.new(
  :consumer_key => YOUR_CONSUMER_KEY,
  :consumer_secret => YOUR_CONSUMER_SECRET,
  :oauth_token => "Bob's access token",
  :oauth_token_secret => "Bob's access secret"
)

@client_alice = Trello::Client.new(
  :consumer_key => YOUR_CONSUMER_KEY,
  :consumer_secret => YOUR_CONSUMER_SECRET,
  :oauth_token => "Alice's access token",
  :oauth_token_secret => "Alice's access secret"
)

You can now make threadsafe requests as the authenticated user:

Thread.new do
  @client_bob.find(:members, "bobtester")
  @client_bob.find(:boards, "bobs_board_id")
end
Thread.new do
  @client_alice.find(:members, "alicetester")
  @client_alice.find(:boards, "alices_board_id")
end

Special thanks

A special thanks goes out to Ben Biddington who has contributed a significant amount of refactoring and functionality to be deserving of a beer and this special thanks.

Contributing

Several ways you can contribute. Documentation, code, tests, feature requests, bug reports.

If you submit a pull request that's accepted, you'll be given commit access to this repository.

Please see the CONTRIBUTING.md file for more information.

Local Development

Use matrixeval-ruby to test code againsts different ruby and active_model versions on local.

Check available commands with:

matrixeval --help
# Or
meval --help

Some examples:

Generate MatrixEval config file

matrixeval init

Run bundle install

matrixeval --all bundle install

Run tests

matrixeval --all rspec
matrixeval --ruby 3.0 rspec spec/a_spec.rb
matrixeval --ruby 3.0 --active_model 7.0 rspec

Bash

matrixeval bash
matrixeval --ruby 3.0 --active_model 7.0 bash

ruby-trello's People

Contributors

adambird avatar armilam avatar ben-biddington avatar brycemcd avatar cbartlett avatar christoshrousis avatar cl3m avatar codyolsen avatar czuger avatar danmcp avatar dlackty avatar eraserhd avatar francois2metz avatar george-carlin avatar hoppergee avatar imhide avatar jeremytregunna avatar kaydanzie avatar larusso avatar mockdeep avatar ownadi avatar rossta avatar semanticart avatar set5think avatar ssaunier avatar stacyvlasits avatar wdjungst avatar wesgibbs avatar wildfalcon avatar xpepper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-trello's Issues

Getting archived cards

It seems when I pull trello cards from the board lists, it does not pull archived cards too ? Is there a way to get archived ones too ?

thanks

not add description on card

Card.create(:name => name, :decription=>description, :list_id => listid)

This method only write name but descriptrion isn't there

Taking a step back.

For a while now I've not been able to give this gem the attention it deserves. It was originally created for a tool that no longer lives, and I'm certainly not in the best position to drive the direction of the gem going forward. For those reasons, let me apologize to those of you who use this gem and have been frustrated with its maintenance.

So I'd like to talk about the direction of this gem. I'd rather not just stop releasing updates, there are folks using this in their apps today, which is great. But I also don't have the time to keep it in good condition.

Unable to obtain public key

I am unable to obtain my public key using the directions listed in the README.md.

$ ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
 ~/dev
$ gem install ruby-trello
Fetching: ruby-trello-1.3.0.gem (100%)
Successfully installed ruby-trello-1.3.0
1 gem installed
 ~/dev
$ irb -rubygems
2.2.1 :001 > require 'trello'
true
2.2.1 :002 > Trello.open_public_key_url
NoMethodError: undefined method `open_public_key_url' for Trello:Module
    from (irb):2
    from /Users/xxxx/.rvm/rubies/ruby-2.2.1/bin/irb:11:in `<main>'

0.4.4.1 gem not found on RubyGems

Hi,

v0.4.4.1 of the ruby trello gem is not publised on RubyGems. I got a dependency on addressable being >2.3. Do you mind publishing it? Thanks!

I couldn't figure out how to add member to a board

I was trying to use this gem add members into a board and then assign them to the cards. The code is as the following:
board = Trello::Board.find board_id
member = Trello::Member.find member_id
board.members << member
It returns an error says undefined method `concat' for #Trello::MultiAssociation:0x007fdafc02b348
I could add member to the board by using client.put("/boards/#{board.id}/members/#{member.id}"), but just wondering if there is a better way already implemented some where in the gem that I haven't noticed?

Card description does not persist on create

Hello,

My name is Bobby Nguyen, I start using your great library and in my test I encounter what it seems to be a bug.

When I call Card.create(:name => "test from ruby-trello", :description => "Just a desc", :list_id => '534e7afdc5f9cxxxa9a5767')
https://dl.dropboxusercontent.com/u/9154761/trello/2014-04-16_19-50-06.png

Then the card is created but with no description.
https://dl.dropboxusercontent.com/u/9154761/trello/2014-04-16_19-56-04.png

Thanks for your help

Best regards
Bobby

access to card comments?

Hi, is this possible? I don't see any method or attribute for card comments. Thanks for any info.

How to close a board?

Hi,

what's the proper way to close a board? I can't seem to get it working by the following sequence:

board = Trello::Board::create({:name => 'Test Board'})
board.closed = true
board.update!

What's the proper way?

Thanks!

How to do pagination?

Hi,
is there a way to paginate over results and hook into the pagination process?

One of the boards I am importing seems to be overflowing my app's memory limit, so I want to make sure I don't load all the cards at once.

Thanks!

Add support for the identity endpoint

It doesn't look like there is a way to get to the identity endpoint (i.e. the identity value returned from /services/data/vX.XX) to obtain the logged in user's info. I may turn this into a pull request, but if you beat me to it, here's the monkey patch I used to get around this which should give you an idea of what I'm getting at here:

module Restforce
  module Concerns
    module API
      def user_info
        send('get', api_get.body.identity).body
      end
    end
  end
end

This allows you to do things like:

client.user_info.email # => [email protected]

Access actions for cards, list, boards, etc

One can access a list of actions (optional filtered) for cards, boards etc.
It would be super helpfull to implement that as well. The main problem is the different information stored in Trello::Action.
This is the payload for a commentCard action.

{
    "id": "bla",
    "idMemberCreator": "bla",
    "data": {
      "list": {
        "name": "Done",
        "id": "bla"
      },
      "board": {
        "shortLink": "bla",
        "name": "Test Board",
        "id": "bla"
      },
      "card": {
        "shortLink": "bla",
        "idShort": 63,
        "name": "task 1",
        "id": "bla"
      },
      "text": "lalalal"
    },
    "type": "commentCard",
    "date": "2015-03-24T16:26:59.726Z",
    "memberCreator": {
      "id": "bla",
      "avatarHash": "bla",
      "fullName": "Manfred Endres",
      "initials": "ME",
      "username": "manfredendres"
    }

The imortant part is in the data field (text). Right now we lose this information because we only map the generic information from the payload. The problem is also that there is a lot of different action types:


    addAttachmentToCard
    addChecklistToCard
    addMemberToBoard
    addMemberToCard
    addMemberToOrganization
    addToOrganizationBoard
    commentCard
    convertToCardFromCheckItem
    copyBoard
    copyCard
    copyCommentCard
    createBoard
    createCard
    createList
    createOrganization
    deleteAttachmentFromCard
    deleteBoardInvitation
    deleteCard
    deleteOrganizationInvitation
    disablePowerUp
    emailCard
    enablePowerUp
    makeAdminOfBoard
    makeNormalMemberOfBoard
    makeNormalMemberOfOrganization
    makeObserverOfBoard
    memberJoinedTrello
    moveCardFromBoard
    moveCardToBoard
    moveListFromBoard
    moveListToBoard
    removeChecklistFromCard
    removeFromOrganizationBoard
    removeMemberFromCard
    unconfirmedBoardInvitation
    unconfirmedOrganizationInvitation
    updateBoard
    updateCard
    updateCard:closed
    updateCard:desc
    updateCard:idList
    updateCard:name
    updateCheckItemStateOnCard
    updateChecklist
    updateList
    updateList:closed
    updateList:name
    updateMember
    updateOrganization

each one differs in the payload. We need a way to access these information. This will also help to work with webhooks. Are there any sugestions? I`m willing to implement. I created custom subclasses in my current project (just three or four) But this is no solution for all types.

What is member_token?

I might just be an idiot but I have no idea what member_token is as referred to in the README and documentation, how to look it up, generate one, etc. Maybe this could be clarified in the README? Or maybe I'm foolish and just overlooked something obvious?

Documentation help

I've had a look at the file ruby-trello/lib/trello.rb to find out the usage of the library, but I don't even get that far. Probably a stupid beginner's question, but could you include the necessary gem / require statements in the sample file to make this work?

This file

#!/usr/bin/env ruby
# is ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12.2.0]


gem "ruby-trello"

include Trello
include Trello::Authorization

Trello::Authorization.const_set :AuthPolicy, OAuthPolicy

gives me:

./printboard.rb 
./printboard.rb:6:in `<main>': uninitialized constant Trello (NameError)

Trello is making a small modification to the checklist API

Trello has an upcoming breaking change to the API that will mean that all checklists MUST have a idCard at creation, and this idCard cannot be changed later (no moving of Checklists). This change is to prevent the creation of orphaned checklists, which has started to become a problem for several use cases.

I'd love to work with you to get this resolved ASAP in the library before this change goes into production later this month.

Bump a 1.1.1 release?

Howdy! I was just updating the Trello gem to 1.1.0 to use the new member_ids on Trello::Card.create in a Rails 4 app but ran into a conflict with the active_model dependency. Looks like that dependency has been relaxed so I'm able to use the github: option in my Gemfile for now, but figured I'd report this in case you were ready for a patch release! Thanks for the gem, very helpful. Cheers.

Changelog

Would be great to have a useful list of changes, commits aren't enough.

Memberships data missing on Organization

Example is from: http://developers.trello.com/advanced-reference/organization

[{
    "id": "4ee7e59ae582acdec8000291",
    "billableMemberCount": 4,
    "desc": "This is a test organization",
    "descData": null,
    "displayName": "Test Public Organization",
    "idBoards": [],
    "invitations": [],
    "invited": false,
    "logoHash": null,
    "memberships": [{
        "id": "4ee7e59ae582acdec8000295",
        "idMember": "4ee7e2e1e582acdec8000112",
        "memberType": "admin",
        "unconfirmed": false
    }, {
        "id": "4ee7e600e582acdec8000355",
        "idMember": "4ee7df74e582acdec80000b6",
        "memberType": "normal",
        "unconfirmed": false
    }, {
        "id": "4ee7e671e582acdec80003e0",
        "idMember": "4ee7df3ce582acdec80000b2",
        "memberType": "normal",
        "unconfirmed": false
    }, {
        "id": "514c6011b56914000000002a",
        "idMember": "514c6011b569140000000028",
        "memberType": "normal",
        "unconfirmed": false
    }],
    "name": "publicorg",
    "powerUps": [],
    "prefs": {
        "permissionLevel": "public",
        "orgInviteRestrict": [],
        "externalMembersDisabled": false,
        "associatedDomain": null,
        "googleAppsVersion": 1,
        "boardVisibilityRestrict": {
            "private": "org",
            "org": "org",
            "public": "org"
        }
    },
    "premiumFeatures": [],
    "products": [],
    "url": "https://trello.com/publicorg",
    "website": "http://example.com"
}]

The data under the key memberships is not available from the organization model. This data is the only place you can find information on memberTypes.

Caching of results

Forgive me if this exists and I couldn't find it, but I think it would be awesome if an HTTP cache of some sort existed with the client so that we could traverse object relationships without making the same HTTP calls over and over.

Ex: I have a card, I would like to be able to call card.actions multiple times for various reasons, but the response of actions should be cached so that the HTTP call isn't made again.

Anyone else have thoughts on this?

Thank you very much for this gem. It follows the Trello API very well, and once I figured that out, I had no problem working with it.

3-legged oauth redirects to trello.com/oob instead of return_url

I am attempting to implement 3-legged OAuth using ruby-trello. When I try to authorize my client, Trello auth always redirects to:

https://trello.com/oob?oauth_token=<token>&oauth_verifier=<verifier>

I expect this to go to my oauth_callback specified via the return_url instead.

Looking at the OAuth::Consumer Gem code for get_request_token, it looks like method picks up oauth_callback value from the arguments passed. If none is specified, it defaults to the OOB path as seen in my case above. Where as, authorize method of Trello::Authorization::OAuthPolicy does not pass any arguments to get_request_token.

If I change my .../ruby-trello-1.0.0/lib/trello/authorization.rb:100 to the following - i.e., pass the oauth_callback value explicitly to consumer.get_request_token:

  request_token = consumer.get_request_token(:oauth_callback => return_url,
   :callback_method => :postMessage)

it works more like I expected - in that Trello auth redirects to:

http://my.app.com/oauth_callback?oauth_token=<token>&oauth_verifier=<verifier>

At which point, I can store the oauth_token and make API calls.

Am I using the ruby-trello gem incorrectly to run into this, or is this indeed a problem?

Updating an existing card's list doesn't work.

When you try to update an exiting card's list_id the update is not saved. The reason is that the field's name in the trello API is actually idList. If you manually change the hash which is being sent on card.rb (line 96) to: {:idList=>"123456789"}
It will work.

Client Authentication lost upon chaining requests

The following code yields a "Trello has not been configured to make authorized requests" Error:

client = Trello::Client.new(
      :consumer_key => OAUTH_CREDENTIALS[:trello][:key],
      :consumer_secret => OAUTH_CREDENTIALS[:trello][:secret],
      :oauth_token => 'usertoken',
      :oauth_token_secret => 'usersecret'
)

client.find(:organization, "org").boards.first.actions

The data is loaded from Trello but the client is not properly set.

irb(main):029:0> client.find(:organization, "org").boards.first.client.auth_policy
=> #<Trello::Authorization::AuthPolicy:0x007feae8a8cc50>

Values returned by optional parameters ignored

The trello gem has the ability to provide additional parameters Trello::Board.find(board_id, :members => "normal") yet because the way the attributes are set the retrieved values are dropped.

https://github.com/jeremytregunna/ruby-trello/blob/master/lib/trello/board.rb#L54-62

In this case I was expecting the members on the board to be populated, but instead when calling board.members I make a separate request.

Is this by design? If we had something like it would be less brittle when Trello changes their API.

#lib/board.rb
def update_fields(fields)
  attributes = fields.symbolize_keys.except(:desc, :idOrganization, :prefs)
  attributes[:description]     = fields['desc']            if fields['desc']
  attributes[:organization_id] = fields['idOrganization']  if fields['idOrganization']
  attributes[:prefs]           = fields['prefs'] || {}
  self
end

However I noticed that you also register the attributes, causing the change above to break stuff. Why is that?

Going down the path of making a separate request but I was curious.

Thread safe features documentation

Hi,
I want to create a Trello import and for that I need to list user's boards and their cards.

But, how do I event list the boards? Readme doesn't say and there seems to be zero documentation on how to use find_many, which seems to be only suitable for internal use by the gem itself.

Trello expects fields as url parameters and not as body (JSON) attributes

I encountered this issue while trying to create a webhook using the following code:

options = { id_model: "a_valid_id_model", callback_url: "a_valid_callback_url" }

trello = Trello::Client.new(consumer_key: "a_valid_key", consumer_secret: "a_valid_secret", oauth_token: "a_valid_token", oauth_token_secret: "a_valid_secret")

trello.create(:webhook, options)

And I get this [400 POST https://api.trello.com/1/webhooks]: invalid value for idModel everytime.

I found that Trello excepts those options as URL parameters and not as body (JSON) attributes, and I actually made it work writing the path by hand:

trello.post("/webhooks/?idModel=a_valid_id_model&callbackURL=a_valid_callback_url")

Any thoughts about this? Thanks

Upon using receive: Segmentation fault: 11

Does this gem require an old version of Ruby?

I'm running MacRuby on Mac OS X (Lion). Upon runningtest.rb with key, secret and access key populated, specifying my username in the call to Member.find causes a Segmentation fault: 11.

Version info:

- RUBYGEMS VERSION: 1.8.20
- RUBY VERSION: 1.9.2 (2008-06-03 patchlevel 0)

I'd be extremely grateful for any advice on this since I'm very eager to use this library!

Sincere thanks for your time.

Is this gem really working?

I tried to use it like the documentation says, after unsuccessful tries I went to check the code and I saw a lot of differences between docs and code.

The method Trello.publick_key not even exist.

Client is not thread-safe

First off, thanks for all the hard work on the ruby-trello gem!

I'm working on an application in which I'd like to make requests on behalf of multiple Trello users. It's tricky, since the client is not currently thread-safe, as demonstrated in this gist.

Has there been discussion around this previously? I was thinking that Trello::Client and authorization credentials could be instantiated rather than treated as a globals, similar to gems like twitter and ocktokit. Is this a direction you're interested in?

NoMethodError - private method `pluralize' called for "member":String

When executing Client::find() in a Sinatra app, I get the following error:

NoMethodError - private method `pluralize' called for "member":String

We fixed it by adding the following line to the file where we make this call:

require 'active_support/inflector'

I think this should be added to the Client class instead.

Unable to update field(s) for card

There seem to be some bugs in this library. the necessary parameters are not available on line 204 of client.rb, so it can't update, and it's actually trying to POST a new card because update! isn't being called.

Test case:
Trello::Card.find(trello_id).update_fields(:name => "test name updated").save

It returns an "invalid value for idList" error. I can find the card with the corresponding 'trello_id' and all it's attributes just fine.

New gem version with CVE fix?

Hi, I was hoping you could bump the version of the gem and push to rubygems so we could use an officially release version of the gem that has the rest-client CVE fix (see #133).

Let me know if a PR would help to bump the actual version number in the repo.

All calls on member result in: 'can't convert Trello::AssociationProxy to Array (Trello::AssociationProxy#to_ary gives Trello::MultiAssociation)'

Having trouble getting any methods on a member to return anything using basic auth.

Trello.configure do |config|
   config.developer_public_key = 'something'
   config.member_token = 'something_else'
end
member = Trello::Member.find('my_username')

calling member.cards, member.boards or member.organizations all give the error:

can't convert Trello::AssociationProxy to Array (Trello::AssociationProxy#to_ary gives Trello::MultiAssociation)

Feels like I'm just doing something very stupid.
Thanks for any help.

complicated nested finds

I'm building a report using the Trello gem, which is totally awesome! I am trying to find cards in lists that have particular labels, and am having a bear of a time figuring it out. I have lists that are called "sprint" (like agile) and then some cards in those lists have the "project" label.

Finding the sprints is pretty easy:

pmm_board.lists(:filter => :all).each do |list|
  if list.name.downcase.include? "sprint"
    sprint_lists << list
  end
end

And I will iterate over each list and then try to find its cards... but there doesn't seem to be a way to "find card with label" in any easy way.

So, given the cards in a particular list, eg sprint_lists[0].cards I am trying to do something like:

sprint_lists[1].cards.find { |card| card.card_labels.any? { |label| label["id"] == "54d4de9c74d650d5671cb3c7" } }

In other words, among the sprint_lists[1].cards i want to find any card whose card_labels array contains a label with the id of 54d4de9c74d650d5671cb3c7.

The nested enum-y/find-y thing above works, but only returns the first card in the list with that label.

Is there an easier way to find cards in a list with a particular label?

Capable of doing more complex queries.

At this point it's not possible to use more complex queries to reduce the number of requests and improve the overall performance.
Ex. In Javascript I can do this:

Trello.get("organizations/[my_company]/boards?filter=open&fields=name,url&lists=open&list_fields=idBoard,name", function(boards) {
  $.each(boards, function(ix, board) {
    $.each(board.lists, function(ix, list) {
      // It's possible to navigate from organization's boards to lists in a single get.
    }
  }
});

But in ruby-trello I'm limited to:

org = Trello::Organization.find("my_company", {"filter" => "open", "fields" => "name,url", "lists" => "open", "list_fields" => "idBoard,name"})
org.boards.each do |b|
  board = Trello::Board.find(b.id, {})
  board.lists.each do |list|
    // the more boards the more gets
  end
end

In this comparison I went down to boards, but this gets more complicated if I'd want also the cards, checklists, and members details.

Memberships data on member

A common problem when you want to import data from trello is to only access the organizations that you actually own.

Right now, I can ask each organization for its memberships, but I can't see mine. It would be helpful to either

  1. Support it
  2. Have lower level access to things that the trello API has if they're not supported yet - something like member.api('memberhsips')?

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

New release

There hasn't been a release since February 2012. I think it is time to issue a new release so it can easily be installed via bundler. (without Git URL)

Add thread capabilities for async requests.

Comparing with the Official Javascript Library, this gem is not async, so you can yo and wrap the requests in a Thread implementation (or even Fiber), but it would be nice, if the gem itself provides async methods to improve the performance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.