Skip to content

Commit

Permalink
emergency 0.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytregunna committed Feb 5, 2012
1 parent e4fd2c9 commit a373645
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ gem 'oauth'
gem 'addressable' gem 'addressable'
gem 'json', :platforms => [ :ruby_18, :jruby ] gem 'json', :platforms => [ :ruby_18, :jruby ]
gem 'jruby-openssl', :platforms => :jruby gem 'jruby-openssl', :platforms => :jruby
gem 'rest-client'


group :spec do group :spec do
gem 'rspec' gem 'rspec'
gem 'simplecov', :require => false, :platforms => [ :mri, :mri_18, :mri_19, :jruby, :mingw ] gem 'simplecov', :require => false, :platforms => [ :mri, :mri_18, :mri_19, :jruby, :mingw ]
gem 'webmock' gem 'webmock'
gem 'rest-client'
end end
20 changes: 18 additions & 2 deletions lib/trello/card.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -102,9 +102,18 @@ def save!
end end


# Update an existing record. # Update an existing record.
# Warning, this updates all fields using values already in memory. If
# an external resource has updated these fields, you should refresh!
# this object before making your changes, and before updating the record.
def update! def update!
# Trello doesn't support this yet. But Daniel is working on it as I Client.put("/cards/#{@id}", {
# place this comment here! :name => @name,
:desc => @description,
:closed => @closed,
:idList => @list_id,
:idBoard => @board_id,
:idMembers => @member_ids
}).json_into(self)
end end


# Is the record valid? # Is the record valid?
Expand All @@ -116,5 +125,12 @@ def valid?
def add_comment(text) def add_comment(text)
Client.post("/cards/#{id}/actions/comments", :text => text) Client.post("/cards/#{id}/actions/comments", :text => text)
end end

# Add a checklist to this card
def add_checklist(checklist)
Client.post("/cards/#{id}/checklists", {
:value => checklist.id
})
end
end end
end end
23 changes: 23 additions & 0 deletions lib/trello/checklist.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ class << self
def find(id) def find(id)
super(:checklists, id) super(:checklists, id)
end end

def create(options)
new('name' => options[:name],
'idBoard' => options[:board_id]).save!
end
end end


# Update the fields of a checklist. # Update the fields of a checklist.
Expand All @@ -31,6 +36,19 @@ def closed?
closed closed
end end


# Save a record.
def save!
return update! if id

Client.post("/checklists", {
:name => @name,
:idBoard => @board_id
})
end

def update!
end

# Return a list of items on the checklist. # Return a list of items on the checklist.
def items def items
return @items if @items return @items if @items
Expand Down Expand Up @@ -60,5 +78,10 @@ def members
Member.find(member_id) Member.find(member_id)
end end
end end

# Add an item to the checklist
def add_item(name)
Client.post("/checklists/#{id}/checkItems", { :name => name })
end
end end
end end
3 changes: 2 additions & 1 deletion ruby-trello.gemspec
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{ruby-trello} s.name = %q{ruby-trello}
s.version = "0.3.0" s.version = "0.3.1"
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY


s.authors = ["Jeremy Tregunna"] s.authors = ["Jeremy Tregunna"]
Expand All @@ -21,5 +21,6 @@ Gem::Specification.new do |s|
s.add_dependency 'yajl-ruby', '>= 1.1.0' s.add_dependency 'yajl-ruby', '>= 1.1.0'
s.add_dependency 'oauth', '~> 0.4.5' s.add_dependency 'oauth', '~> 0.4.5'
s.add_dependency 'addressable', '~> 2.2.6' s.add_dependency 'addressable', '~> 2.2.6'
s.add_dependency 'rest-client', '~> 1.6.7'
s.add_development_dependency 'bundler', '~> 1.0.0' s.add_development_dependency 'bundler', '~> 1.0.0'
end end

0 comments on commit a373645

Please sign in to comment.