trello_cli 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acc1c203294fdfbafe7edb464560e3f25e669585
4
- data.tar.gz: f417e233a240549ef58203fd2d0d288d69f3f26d
3
+ metadata.gz: 9f6f168bd026bf25fdcd47f9f589a5837e1339d8
4
+ data.tar.gz: dcff0a71503befe5a480088b17ea2835e9f9d548
5
5
  SHA512:
6
- metadata.gz: c51feb2abc89c53281f2e34ea74c6a8ca39cda1f3a15ff18219f21ca2dfcd6824923696d17fe66d94bbb334993d2c8b876e7ed677e4c66cabf1a2b3037639973
7
- data.tar.gz: 96250d05153d7cb4a8251d0feabef5d79f2d1120b24156f39634a8b96c42224da15c7d3a38977435d0a245bf84578610c215b62bf6d415c0e3d880b6e0b21491
6
+ metadata.gz: 081b31895dd730abd67700638f2155f0b50c6c120f59bac61d99f7fa62c67eb7e7e3a21d57e4dbb5b556dd87b4fd165ce4f3dfacc0896ee2495d30f79162f1df
7
+ data.tar.gz: 70fbeb8cbf808f989c9e30c56bfd5b6529772636cfec2a04636d213aa639d979780221890bfecf6c4b00c441493e580c9115529a88254961e1a3168a911aeec2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1:
2
+
3
+ * Bug fix in listing closed boards
4
+
1
5
  ## 0.2.0:
2
6
 
3
7
  * Added option to not list closed boards
@@ -10,20 +10,23 @@ module TrelloCli
10
10
  def run
11
11
  option_parser.parse!
12
12
 
13
- list_boards.each do |board|
14
- return unless !board.attributes[:closed] || @options[:closed]
15
- name = board.attributes[:name]
16
- id = board.attributes[:id]
17
-
13
+ list_boards(@options[:closed]).each do |board|
14
+ name = board.attributes[:name]
15
+ id = board.attributes[:id]
16
+ closed = board.attributes[:closed]
18
17
  puts "#{name} ( #{id} )"
19
18
  end
20
19
  end
21
20
 
22
21
  private
23
22
 
24
- def list_boards
23
+ def list_boards(include_closed)
25
24
  lb = TrelloCli::Requests::ListBoards.new
26
- lb.list
25
+
26
+ lb.list.select do |b|
27
+ closed = b.attributes[:closed]
28
+ !closed || (closed && include_closed)
29
+ end
27
30
  end
28
31
 
29
32
  def option_parser(options=@options)
@@ -1,3 +1,3 @@
1
1
  module TrelloCli
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe TrelloCli::CLI::Board::List do
4
+ board = Struct.new :attributes
5
+ let!(:board1) { (board.new({ name: "board1", id: "1", closed: true })) }
6
+ let!(:board2) { (board.new({ name: "board2", id: "2", closed: false })) }
7
+
8
+ let(:trello_mock) { double "trello" }
9
+ let(:options_mock) { double "trello" }
10
+
11
+ before do
12
+ allow(OptionParser).to receive(:new).and_return options_mock
13
+ expect(options_mock).to receive(:parse!)
14
+ allow(TrelloCli::Requests::ListBoards).to receive(:new).and_return trello_mock
15
+ allow(trello_mock).to receive(:list).and_return [board1, board2]
16
+ end
17
+
18
+ it "should puts open boards" do
19
+ expect(subject).to receive(:puts).with("board2 ( 2 )")
20
+ subject.run
21
+ end
22
+
23
+ it "should puts all boards" do
24
+ subject.instance_variable_set(:@options, { closed: true })
25
+ expect(subject).to receive(:puts).with("board1 ( 1 )")
26
+ expect(subject).to receive(:puts).with("board2 ( 2 )")
27
+ subject.run
28
+ end
29
+
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trello_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Weaver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -90,6 +90,7 @@ files:
90
90
  - lib/trello_cli/requests/move_card.rb
91
91
  - lib/trello_cli/requests/shared.rb
92
92
  - lib/trello_cli/version.rb
93
+ - spec/cli/board/list_spec.rb
93
94
  - spec/cli/commands/shared_spec.rb
94
95
  - spec/cli/run_spec.rb
95
96
  - spec/requests/create_card_spec.rb
@@ -124,6 +125,7 @@ signing_key:
124
125
  specification_version: 4
125
126
  summary: Simple Trello Command Line Interface
126
127
  test_files:
128
+ - spec/cli/board/list_spec.rb
127
129
  - spec/cli/commands/shared_spec.rb
128
130
  - spec/cli/run_spec.rb
129
131
  - spec/requests/create_card_spec.rb