slack_trello 0.8.1 → 0.8.2

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: 205bf05baf99a6f384f1ddba4aef39ed5acb9aef
4
- data.tar.gz: 42dbbf201cf40698b34dc53aa049bf5828128bf7
3
+ metadata.gz: 9bb59a364d5b494477533521994965f3593bb6fd
4
+ data.tar.gz: b672b2cc56c8ea24fad279a5253c850a1f34fc4f
5
5
  SHA512:
6
- metadata.gz: eb86f3883f58cef1d02fa4f6e7875fc1ce6471010b28669dafbbf789b5df71c1de868e93af07566543817f2e7bea0aa632cf950d5c534d81fc3241ca80ecc119
7
- data.tar.gz: 302a5e3200bf39cdb5c573f7849e63c2451c5bebe9ede31cf2ab5c1f33eb475ea9326a9202bc2f8de3b82aaeba368b34f551539c1d0489298cc9f10ad728e3c3
6
+ metadata.gz: afae7c5eb0258e1ccd239f837a0c1ab94310f20237a1faecc051b2f51a9fb4a1dd8b4b04e818b7d8932637f7a45b10d46da358dfc33ca5a350e0fa0defcdd5ca
7
+ data.tar.gz: 17932fc0381754768fc3a1032f9fd23138f5880df70f416cd65d4d5b3ee5f880d3205ab28e0289bbf3d7766a8d2f211ca1199c3ea63e286bfbeb4e2ad3515ed5
@@ -1,5 +1,6 @@
1
1
  module SlackTrello; module Commands; class CopyCards
2
2
 
3
+ include StandardStuff
3
4
  include SlackTrello::SlackHelpers::TextParser
4
5
 
5
6
  attr_reader :slack_post_response, :webhook_url
@@ -20,20 +21,8 @@ module SlackTrello; module Commands; class CopyCards
20
21
 
21
22
  private
22
23
 
23
- def help_message
24
- %{:cry: Invalid format
25
- Your message: #{slack_post_response.text}
26
- Example: /copy_cards (source_board, source_list, destination_board, destination_list)
27
- }
28
- end
29
-
30
- def speaker
31
- args = {
32
- webhook_url: webhook_url,
33
- channel: slack_post_response.channel_name,
34
- username: slack_post_response.user_name
35
- }
36
- SlackTrello::SlackHelpers::Speaker.new(args)
24
+ def example_command
25
+ "/copy_cards (source_board, source_list, destination_board, destination_list)"
37
26
  end
38
27
 
39
28
  def card_copier
@@ -1,5 +1,6 @@
1
1
  module SlackTrello; module Commands; class CreateCard
2
2
 
3
+ include StandardStuff
3
4
  include SlackTrello::SlackHelpers::TextParser
4
5
 
5
6
  attr_reader :slack_post_response, :webhook_url
@@ -21,22 +22,8 @@ module SlackTrello; module Commands; class CreateCard
21
22
 
22
23
  private
23
24
 
24
- def help_message
25
- %{:cry: Invalid format
26
- Your message: #{text}
27
- Example: /card (trello_board trello_list) card title
28
- If the Trello board/list has spaces, replace them with underscores
29
- For example, Some Board Name => some_board_name
30
- }
31
- end
32
-
33
- def speaker
34
- args = {
35
- webhook_url: webhook_url,
36
- channel: slack_post_response.channel_name,
37
- username: slack_post_response.user_name
38
- }
39
- SlackTrello::SlackHelpers::Speaker.new(args)
25
+ def example_command
26
+ "/card (trello_board trello_list) card title"
40
27
  end
41
28
 
42
29
  def trello_card_creator
@@ -60,14 +47,6 @@ For example, Some Board Name => some_board_name
60
47
  args[1]
61
48
  end
62
49
 
63
- def list_not_found_message
64
- "A Trello list named #{trello_list_name} must be added to the '#{trello_board_name}' board for this command to function."
65
- end
66
-
67
- def success_message
68
- ":mega: [#{slack_post_response.user_name}] has created a new trello card: <#{trello_card.short_url}|#{slack_post_response.text.strip}>"
69
- end
70
-
71
50
  def card_title
72
51
  text_message
73
52
  end
@@ -1,5 +1,6 @@
1
1
  module SlackTrello; module Commands; class Retro
2
2
 
3
+ include StandardStuff
3
4
  include SlackTrello::SlackHelpers::TextParser
4
5
 
5
6
  attr_reader :slack_post_response, :webhook_url
@@ -21,21 +22,8 @@ module SlackTrello; module Commands; class Retro
21
22
 
22
23
  private
23
24
 
24
- def help_message
25
- %{:cry: Invalid format
26
- Your message: #{text}
27
- Example: /retro (#{list_names.first}) blah blah blah
28
- Available list names: #{list_names.join(", ")}
29
- }
30
- end
31
-
32
- def speaker
33
- args = {
34
- webhook_url: webhook_url,
35
- channel: slack_post_response.channel_name,
36
- username: slack_post_response.user_name
37
- }
38
- SlackTrello::SlackHelpers::Speaker.new(args)
25
+ def example_command
26
+ "/retro (#{list_names.first}) blah blah blah"
39
27
  end
40
28
 
41
29
  def trello_card_creator
@@ -59,14 +47,6 @@ Available list names: #{list_names.join(", ")}
59
47
  args[0]
60
48
  end
61
49
 
62
- def list_not_found_message
63
- "A Trello list named #{trello_list_name} must be added to the '#{trello_board_name}' board for this command to function."
64
- end
65
-
66
- def success_message
67
- ":mega: [#{slack_post_response.user_name}] has created a new trello card: <#{trello_card.short_url}|#{slack_post_response.text.strip}>"
68
- end
69
-
70
50
  def card_title
71
51
  "#{text_message} -- #{slack_post_response.user_name}"
72
52
  end
@@ -0,0 +1,29 @@
1
+ module SlackTrello; module Commands; module StandardStuff
2
+
3
+ def list_not_found_message
4
+ "A Trello list named #{trello_list_name} must be added to the '#{trello_board_name}' board for the command to function."
5
+ end
6
+
7
+ def help_message
8
+ %{:cry: Invalid format
9
+ Your message: #{text}
10
+ Example: #{example_command}
11
+ }
12
+ end
13
+
14
+ def speaker
15
+ args = {
16
+ webhook_url: webhook_url,
17
+ channel: slack_post_response.channel_name,
18
+ username: slack_post_response.user_name
19
+ }
20
+ SlackTrello::SlackHelpers::Speaker.new(args)
21
+ end
22
+
23
+ def success_message
24
+ ":mega: [#{slack_post_response.user_name}] has created a new trello card: <#{trello_card.short_url}|#{slack_post_response.text.strip}>"
25
+ end
26
+
27
+
28
+ end; end; end
29
+
@@ -1,5 +1,7 @@
1
1
  module SlackTrello; module Commands; class Work
2
2
 
3
+ include StandardStuff
4
+
3
5
  attr_reader :slack_post_response, :webhook_url
4
6
 
5
7
  def initialize(slack_post_args, webhook_url)
@@ -17,15 +19,6 @@ module SlackTrello; module Commands; class Work
17
19
 
18
20
  private
19
21
 
20
- def speaker
21
- args = {
22
- webhook_url: webhook_url,
23
- channel: slack_post_response.channel_name,
24
- username: slack_post_response.user_name
25
- }
26
- SlackTrello::SlackHelpers::Speaker.new(args)
27
- end
28
-
29
22
  def trello_card_creator
30
23
  args = {
31
24
  board_name: trello_board_name,
@@ -48,14 +41,6 @@ module SlackTrello; module Commands; class Work
48
41
  'From Chat'
49
42
  end
50
43
 
51
- def list_not_found_message
52
- "A Trello list named #{trello_list_name} must be added to the '#{trello_board_name}' board for the work command to function."
53
- end
54
-
55
- def success_message
56
- ":mega: [#{slack_post_response.user_name}] has created a new work card: <#{trello_card.short_url}|#{slack_post_response.text.strip}>"
57
- end
58
-
59
44
  def card_title
60
45
  "(UNSIZED) #{slack_post_response.text.strip} {tag???}"
61
46
  end
@@ -1,3 +1,3 @@
1
1
  module SlackTrello
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
data/lib/slack_trello.rb CHANGED
@@ -12,6 +12,7 @@ end
12
12
 
13
13
  require_all("lib/slack_trello/slack_helpers")
14
14
  require_all("lib/slack_trello/trello_helpers")
15
+ require_relative("./slack_trello/commands/standard_stuff.rb")
15
16
  require_all("lib/slack_trello/commands")
16
17
 
17
18
  module SlackTrello
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_trello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Powers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,6 +101,7 @@ files:
101
101
  - lib/slack_trello/commands/copy_cards.rb
102
102
  - lib/slack_trello/commands/create_card.rb
103
103
  - lib/slack_trello/commands/retro.rb
104
+ - lib/slack_trello/commands/standard_stuff.rb
104
105
  - lib/slack_trello/commands/work.rb
105
106
  - lib/slack_trello/slack_helpers/speaker.rb
106
107
  - lib/slack_trello/slack_helpers/text_parser.rb