ruboty-trello 0.1.4 → 0.1.5

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: 652f9a3da0e0ee7c6ed0dd4341c24312e37a4264
4
- data.tar.gz: d5c7d478edd07c41069f33b3a9d8eb660f7c1a43
3
+ metadata.gz: d188de8900157f0163e8274dda0fcaddcd11139b
4
+ data.tar.gz: 9883b640145731c1313e6b68424f5c6b53ce5def
5
5
  SHA512:
6
- metadata.gz: 10ae0f180f16643a2716d2caab1073df20ae6dc854e03c5168fce0cc0cc38e886cbf6339db6a8b0d906d68ba1d7aefc553ae8be3a94a52b376b9a952e55e2769
7
- data.tar.gz: 69ce985c3ec9b3d6c55fef153920fe160339ca3913ec346c3aa21d5f9fae66f9b14d36c9d0ccb7fcfb47aeb84797ce2d79c707e3de353890b405d05ff462dea3
6
+ metadata.gz: c95b1a06bb5d19d6c194a0f3f1ba364245a5e6d2ad24949df2360b676b9b7c3254bc9192d74cb6a1a90f00b65221002b6597f92856a9cff5fb59246f464e7513
7
+ data.tar.gz: 2bcd6b26ee453d3541c62588d98f3fec48cbd522b250265dbd2bb72f6218d6b3d2d241e2fee15d882e30dccab501b4ea673cda62595032718f2c9b0f1f559e5a
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```
24
- @ruboty trello b <board_name> l <list_name> c <card_name>
24
+ @ruboty trello b <board_name> l <list_name> (lb <label_name>) c <card_name>
25
25
  ```
26
26
 
27
27
  ## ENV
data/lib/ruboty/trello.rb CHANGED
@@ -8,7 +8,7 @@ end
8
8
  module Ruboty
9
9
  module Handlers
10
10
  class Trello < Base
11
- on /trello\s+b\s+(?<board_name>.*)\s+l\s+(?<list_name>.*)\s+c\s+(?<name>.*)\z/i, name: 'trello', description: 'Add card to Trello'
11
+ on /trello\s+b\s+(?<board_name>.*?)\s+l\s+(?<list_name>.*?)\s+(lb\s+(?<label_name>.*?)\s+)?c\s+(?<name>.*)\z/i, name: 'trello', description: 'Add card to Trello'
12
12
 
13
13
  def trello(message)
14
14
  me = ::Trello::Member.find('me')
@@ -25,16 +25,19 @@ module Ruboty
25
25
  return
26
26
  end
27
27
 
28
+ label = board.labels.find { |label| label.name == message[:label_name] }
29
+ label_id = label&.id
30
+
28
31
  member_id = nil
29
32
  if ENV['TRELLO_AUTO_ASSIGN'] && message.from_name
30
33
  sender = message.from_name.downcase
31
34
  member = board.members.find do |member|
32
35
  member.username.downcase == sender || member.full_name.downcase.include?(sender)
33
36
  end
34
- member_id = member.try(:id)
37
+ member_id = member&.id
35
38
  end
36
39
 
37
- new_card = ::Trello::Card.create(name: message[:name], list_id: list.id, member_ids: member_id)
40
+ new_card = ::Trello::Card.create(name: message[:name], list_id: list.id, card_labels: label_id, member_ids: member_id)
38
41
  if new_card.short_url
39
42
  prefix = ENV['TRELLO_RESPONSE_PREFIX'] || 'Created'
40
43
  message.reply "#{prefix} #{new_card.short_url}"
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Trello
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'ruboty'
22
22
  spec.add_dependency 'ruby-trello'
23
- spec.add_development_dependency 'bundler', '~> 1.10'
24
- spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'bundler', '~> 1.11'
24
+ spec.add_development_dependency 'rake', '~> 11.0'
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-trello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Ihara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-19 00:00:00.000000000 Z
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.10'
47
+ version: '1.11'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.10'
54
+ version: '1.11'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '11.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '11.0'
69
69
  description: Ruboty plugin for adding a new card to Trello
70
70
  email:
71
71
  - ihara@bitjourney.com
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.4.5
105
+ rubygems_version: 2.5.1
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Ruboty plugin for adding a new card to Trello