trellist 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e29b31ca265ee6bed7dd8ae6d43f5a4cd1d94d63
4
- data.tar.gz: e1ea745fa3c983839a65b8e019743a6b2884fee7
3
+ metadata.gz: 8dbe49ca76242bde1de10cc5ba377e303e31e483
4
+ data.tar.gz: e8601078d7249476f591b3c67f5250549c880abf
5
5
  SHA512:
6
- metadata.gz: 285107aff404404ba433a0880048d9ebff3b94f3a3ccb16acd6c526c0b83a59124ab42db4f08392527e6c4ea984b7507cfd0e3b08e2928de85d41580364355a2
7
- data.tar.gz: 4593f056246d552511d3fda20d3fc62a9677cb38aeea32c205ca423050ff446e6aaac64657c846f94b2bdf09436dcd55425aafe4017f93d16ef1be02d43093dc
6
+ metadata.gz: 5dfd38f5f69b80376b1bb8d37db81d5f36ca3aad77eeab233105fb915b2c0d112541e20b0ec11823618342c9f90de589a03073ff2d67d6af0913ab8b830fe1b4
7
+ data.tar.gz: e0b370506b2e6b516b5f3d9bb91089e0c50125dae558e6087444aab439f649487101a6b5f3dea74646df0e4ca91d040bd5e8c4f28746a31defa22442b5d40d3f
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trellist (0.5.1)
5
- gli (= 2.14.0)
4
+ trellist (0.6.0)
5
+ gli (= 2.15.0)
6
6
  highline (= 1.7.8)
7
7
  paint (= 2.0.0)
8
- ruby-trello (= 1.6.0)
8
+ ruby-trello (= 2.0.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
@@ -49,13 +49,13 @@ GEM
49
49
  unf (>= 0.0.5, < 1.0.0)
50
50
  ffi (1.9.14)
51
51
  gherkin (4.0.0)
52
- gli (2.14.0)
52
+ gli (2.15.0)
53
53
  hashdiff (0.3.2)
54
54
  highline (1.7.8)
55
55
  http-cookie (1.0.3)
56
56
  domain_name (~> 0.5)
57
- i18n (0.7.0)
58
- json (2.0.2)
57
+ i18n (0.8.0)
58
+ json (2.0.3)
59
59
  mime-types (3.1)
60
60
  mime-types-data (~> 3.2015)
61
61
  mime-types-data (3.2016.0521)
@@ -85,7 +85,7 @@ GEM
85
85
  diff-lcs (>= 1.2.0, < 2.0)
86
86
  rspec-support (~> 3.5.0)
87
87
  rspec-support (3.5.0)
88
- ruby-trello (1.6.0)
88
+ ruby-trello (2.0.0)
89
89
  activemodel (>= 3.2.0)
90
90
  addressable (~> 2.3)
91
91
  json
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # trellist
2
2
 
3
- A CLI tool for getting Trello card information in various
3
+ A CLI tool for getting Trello card titles and links in various
4
4
  formats (default: markdown).
5
5
 
6
- ![](https://travis-ci.org/chaserx/trellist.svg?branch=master)
6
+ [![travis build](https://travis-ci.org/chaserx/trellist.svg?branch=master)](https://travis-ci.org/chaserx/trellist)
7
7
 
8
8
  ## Usage
9
9
 
@@ -31,10 +31,28 @@ Otherwise you'll need to supply your key and token as flags such as:
31
31
  - `trellist cards --format=plain` **just links**
32
32
  - `trellist cards --format=html` **html**
33
33
 
34
+ #### Link prefix and suffix
35
+
36
+ You can supply optional prefix and suffix flags to alter the output. However, prefix and suffix only work for markdown and HTML formats.
37
+
38
+ example. `trellist cards --format=markdown --prefix='* '` will return
39
+
40
+ `* [Card Title](https://trello.com/c/1moT1m3)`
41
+
42
+ Similar with suffix.
43
+
44
+ #### Filtering cards
45
+
46
+ You can filter cards by their labels.
47
+
48
+ example. `trellist cards --label='foo'`
49
+
34
50
  ## Development
35
51
 
36
52
  - `bundle install`
37
- - `bundle exec bin/trellist cards`
53
+ - `bundle exec ./bin/trellist cards` you have to use bundle exec in development mode
54
+
55
+ Run `rake -T` to view helpful build and release tasks.
38
56
 
39
57
  ## Contribution
40
58
 
data/bin/trellist CHANGED
@@ -30,21 +30,38 @@ config_file '.trellist'
30
30
  # switch [:s,:switch]
31
31
 
32
32
  # Global flags
33
- desc 'your Trello board id; like: ABC123XR'
33
+ desc 'Your Trello board id; like: ABC123XR'
34
34
  default_value '' # empty we'll raise if empty
35
35
  arg_name 'board'
36
36
  flag [:b,:board], required: true
37
37
 
38
- desc 'your Trello TRELLO_DEVELOPER_PUBLIC_KEY'
38
+ desc 'Your Trello TRELLO_DEVELOPER_PUBLIC_KEY'
39
39
  default_value '' # empty we'll raise if empty
40
40
  arg_name 'TRELLO_DEVELOPER_PUBLIC_KEY'
41
41
  flag [:k,:key], required: true
42
42
 
43
- desc 'your Trello TRELLO_MEMBER_TOKEN'
43
+ desc 'Your Trello TRELLO_MEMBER_TOKEN'
44
44
  default_value '' # empty we'll raise if empty
45
45
  arg_name 'TRELLO_MEMBER_TOKEN'
46
46
  flag [:t,:token], required: true
47
47
 
48
+ desc 'Get labels from a board'
49
+ command :labels do |c|
50
+ c.desc 'Get labels from a board'
51
+ c.action do |global_options, options, args|
52
+ @client = Client.new(key: global_options[:key],
53
+ token: global_options[:token],
54
+ board_id: global_options[:board])
55
+ # set @client.labels
56
+ @client.board_labels
57
+ raise "There were no labels for #{global_options[:board]}" if @client.labels.empty?
58
+
59
+ @client.labels.each_with_index do |label, index|
60
+ puts Paint["#{index}. #{label.name}", COLORS[:white]]
61
+ end
62
+ end
63
+ end
64
+
48
65
  desc 'Get cards from a list on your board'
49
66
  command :cards do |c|
50
67
  c.desc 'Gets cards from a selection of lists from the provided Trello board'
@@ -67,7 +84,8 @@ command :cards do |c|
67
84
  end
68
85
 
69
86
  @client.lists.each_with_index do |list, index|
70
- puts "#{index}. #{list.name}"
87
+ print Paint["#{index}. ", COLORS[:cyan]]
88
+ print Paint["#{list.name}\n", COLORS[:white]]
71
89
  end
72
90
  # ask for which list or to quit
73
91
  @answer = ''
@@ -21,7 +21,7 @@ end
21
21
 
22
22
  class Client
23
23
  using TrelloCardRefinements
24
- attr_accessor :lists, :cards, :board
24
+ attr_accessor :labels, :lists, :cards, :board
25
25
 
26
26
  def initialize(board_id:, key:, token:)
27
27
  @board = board_id
@@ -38,6 +38,10 @@ class Client
38
38
  @lists = Trello::Board.find(@board).lists
39
39
  end
40
40
 
41
+ def board_labels
42
+ @labels = Trello::Board.find(@board).labels
43
+ end
44
+
41
45
  def list_cards(list_id, label: nil)
42
46
  @cards = Trello::List.find(list_id).cards
43
47
  @cards.select! { |card| card.labels.map(&:name).include?(label) } if label
@@ -1,3 +1,3 @@
1
1
  module Trellist
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
@@ -105,4 +105,18 @@ RSpec.describe 'Client' do
105
105
  end
106
106
  end
107
107
  end
108
+
109
+ describe 'board_labels' do
110
+ before do
111
+ @client = Client.new(board_id: 't3anNqoJ',
112
+ key: 'myTRELLOkey',
113
+ token: 'myTRELLOtoken')
114
+ end
115
+
116
+ it 'sets @client.labels' do
117
+ @client.board_labels
118
+ expect(@client.labels).not_to be_nil
119
+ expect(@client.labels.size).to eq(6)
120
+ end
121
+ end
108
122
  end
@@ -0,0 +1,133 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.trello.com/1/boards/t3anNqoJ?key=myTRELLOkey&token=myTRELLOtoken
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - rest-client/2.0.0 (darwin16.3.0 x86_64) ruby/2.4.0p0
16
+ Host:
17
+ - api.trello.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Cache-Control:
24
+ - max-age=0, must-revalidate, no-cache, no-store
25
+ X-Content-Type-Options:
26
+ - nosniff
27
+ Strict-Transport-Security:
28
+ - max-age=15768000
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Frame-Options:
32
+ - DENY
33
+ X-Trello-Version:
34
+ - 1.890.0
35
+ X-Trello-Environment:
36
+ - Production
37
+ Access-Control-Allow-Origin:
38
+ - "*"
39
+ Access-Control-Allow-Methods:
40
+ - GET, PUT, POST, DELETE
41
+ Access-Control-Allow-Headers:
42
+ - Authorization, Accept, Content-Type
43
+ X-Server-Time:
44
+ - '1487438824494'
45
+ Expires:
46
+ - Thu, 01 Jan 1970 00:00:00
47
+ X-Trello-Index-Last-Update:
48
+ - '27'
49
+ Content-Type:
50
+ - application/json; charset=utf-8
51
+ Content-Length:
52
+ - '781'
53
+ Etag:
54
+ - W/"30d-57bcd8"
55
+ Vary:
56
+ - Accept-Encoding
57
+ Date:
58
+ - Sat, 18 Feb 2017 17:27:04 GMT
59
+ Connection:
60
+ - keep-alive
61
+ Set-Cookie:
62
+ - dsc=db8816f1ffe788d5d172a9039b8ddaeb8ac03dc4f6cff15e35cc0efcc40ce104; Path=/;
63
+ Expires=Tue, 21 Feb 2017 17:27:04 GMT; Secure
64
+ body:
65
+ encoding: UTF-8
66
+ string: '{"id":"5883d2bb4482996b47dbe2a5","name":"testing","desc":"","descData":null,"closed":false,"idOrganization":null,"pinned":false,"url":"https://trello.com/b/t3anNqoJ/testing","shortUrl":"https://trello.com/b/t3anNqoJ","prefs":{"permissionLevel":"private","voting":"disabled","comments":"members","invitations":"members","selfJoin":false,"cardCovers":true,"cardAging":"regular","calendarFeedEnabled":false,"background":"blue","backgroundImage":null,"backgroundImageScaled":null,"backgroundTile":false,"backgroundBrightness":"dark","backgroundColor":"#0079BF","canBePublic":true,"canBeOrg":true,"canBePrivate":true,"canInvite":true},"labelNames":{"green":"green","yellow":"yellow","orange":"orange","red":"red","purple":"purple","blue":"blue","sky":"","lime":"","pink":"","black":""}}'
67
+ http_version:
68
+ recorded_at: Sat, 18 Feb 2017 17:27:03 GMT
69
+ - request:
70
+ method: get
71
+ uri: https://api.trello.com/1/boards/5883d2bb4482996b47dbe2a5/labels?key=myTRELLOkey&limit=1000&token=myTRELLOtoken
72
+ body:
73
+ encoding: US-ASCII
74
+ string: ''
75
+ headers:
76
+ Accept:
77
+ - "*/*"
78
+ Accept-Encoding:
79
+ - gzip, deflate
80
+ User-Agent:
81
+ - rest-client/2.0.0 (darwin16.3.0 x86_64) ruby/2.4.0p0
82
+ Host:
83
+ - api.trello.com
84
+ response:
85
+ status:
86
+ code: 200
87
+ message: OK
88
+ headers:
89
+ Cache-Control:
90
+ - max-age=0, must-revalidate, no-cache, no-store
91
+ X-Content-Type-Options:
92
+ - nosniff
93
+ Strict-Transport-Security:
94
+ - max-age=15768000
95
+ X-Xss-Protection:
96
+ - 1; mode=block
97
+ X-Frame-Options:
98
+ - DENY
99
+ X-Trello-Version:
100
+ - 1.890.0
101
+ X-Trello-Environment:
102
+ - Production
103
+ Access-Control-Allow-Origin:
104
+ - "*"
105
+ Access-Control-Allow-Methods:
106
+ - GET, PUT, POST, DELETE
107
+ Access-Control-Allow-Headers:
108
+ - Authorization, Accept, Content-Type
109
+ X-Server-Time:
110
+ - '1487438824696'
111
+ Expires:
112
+ - Thu, 01 Jan 1970 00:00:00
113
+ Content-Type:
114
+ - application/json; charset=utf-8
115
+ Content-Length:
116
+ - '667'
117
+ Etag:
118
+ - W/"29b-930cd41c"
119
+ Vary:
120
+ - Accept-Encoding
121
+ Date:
122
+ - Sat, 18 Feb 2017 17:27:04 GMT
123
+ Connection:
124
+ - keep-alive
125
+ Set-Cookie:
126
+ - dsc=53d19c1895cb6159c8e5291607315f9d17c753b07e4250b37565c5037db4d723; Path=/;
127
+ Expires=Tue, 21 Feb 2017 17:27:04 GMT; Secure
128
+ body:
129
+ encoding: UTF-8
130
+ string: '[{"id":"5883d2bbced82109ffe0ba83","idBoard":"5883d2bb4482996b47dbe2a5","name":"yellow","color":"yellow","uses":1},{"id":"5883d2bbced82109ffe0ba84","idBoard":"5883d2bb4482996b47dbe2a5","name":"green","color":"green","uses":1},{"id":"5883d2bbced82109ffe0ba86","idBoard":"5883d2bb4482996b47dbe2a5","name":"red","color":"red","uses":1},{"id":"5883d2bbced82109ffe0ba85","idBoard":"5883d2bb4482996b47dbe2a5","name":"orange","color":"orange","uses":0},{"id":"5883d2bbced82109ffe0ba87","idBoard":"5883d2bb4482996b47dbe2a5","name":"blue","color":"blue","uses":0},{"id":"5883d2bbced82109ffe0ba88","idBoard":"5883d2bb4482996b47dbe2a5","name":"purple","color":"purple","uses":0}]'
131
+ http_version:
132
+ recorded_at: Sat, 18 Feb 2017 17:27:03 GMT
133
+ recorded_with: VCR 3.0.3
data/trellist.gemspec CHANGED
@@ -7,7 +7,7 @@ spec = Gem::Specification.new do |s|
7
7
  s.email = 'chase.southard@gmail.com'
8
8
  s.homepage = 'https://github.com/chaserx/trellist'
9
9
  s.platform = Gem::Platform::RUBY
10
- s.summary = 'Retrieve Trello lists and list cards. Capture card data in various useful formats.'
10
+ s.summary = 'A little CLI tool for getting Trello card titles and links in various formats.'
11
11
  s.files = `git ls-files`.split(" ")
12
12
  s.license = 'MIT'
13
13
  s.post_install_message = "You can install config file: `trellist initconfig` \n then update your ~/.trellist with Trello credentials"
@@ -22,8 +22,8 @@ spec = Gem::Specification.new do |s|
22
22
  s.add_development_dependency('rspec', '3.5.0')
23
23
  s.add_development_dependency('vcr', '3.0.3')
24
24
  s.add_development_dependency('webmock', '2.3.2')
25
- s.add_runtime_dependency('gli','2.14.0')
26
- s.add_runtime_dependency('ruby-trello','1.6.0')
25
+ s.add_runtime_dependency('gli','2.15.0')
26
+ s.add_runtime_dependency('ruby-trello','2.0.0')
27
27
  s.add_runtime_dependency('highline','1.7.8')
28
28
  s.add_runtime_dependency('paint','2.0.0')
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trellist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chase Southard
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 2.14.0
103
+ version: 2.15.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 2.14.0
110
+ version: 2.15.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: ruby-trello
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.6.0
117
+ version: 2.0.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.6.0
124
+ version: 2.0.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: highline
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -177,6 +177,7 @@ files:
177
177
  - spec/support/aruba.rb
178
178
  - spec/trellist_cards_command_spec.rb
179
179
  - spec/use_aruba_with_rspec_spec.rb
180
+ - spec/vcr_cassettes/client/board_labels_sets_client/labels.yml
180
181
  - spec/vcr_cassettes/client/get_board_lists_sets_client/lists.yml
181
182
  - spec/vcr_cassettes/client/get_list_cards_sets_client/cards.yml
182
183
  - spec/vcr_cassettes/client/get_list_cards_with_a_label_argument_sets_client/cards_limited_by_card_label.yml
@@ -207,6 +208,5 @@ rubyforge_project:
207
208
  rubygems_version: 2.6.8
208
209
  signing_key:
209
210
  specification_version: 4
210
- summary: Retrieve Trello lists and list cards. Capture card data in various useful
211
- formats.
211
+ summary: A little CLI tool for getting Trello card titles and links in various formats.
212
212
  test_files: []