ruboty-trello 0.1.3 → 0.1.4

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: e3d1c4eda0139ea4aaf19f9561b1d19f1b73a137
4
- data.tar.gz: 973708a9949041d57ac5f64f4b6a4989b5b1a68d
3
+ metadata.gz: 652f9a3da0e0ee7c6ed0dd4341c24312e37a4264
4
+ data.tar.gz: d5c7d478edd07c41069f33b3a9d8eb660f7c1a43
5
5
  SHA512:
6
- metadata.gz: bcf95eac5476b496a27e084e19c5207041f7943ce245789beb25d4644109f67bf715766a2e2c5c591b82fb0d2a1dadaf0e5f5b19d1a6759ed30aeb09e255ebc4
7
- data.tar.gz: 8b5a68d2bd52dce9353937cb159e2a4d998b30ba59301d78acba2a300b2dd9b6a586e48f73bb41fb1b8b8da738c5062ec3a7d424c1f96cd7296f1d60ad3d20f8
6
+ metadata.gz: 10ae0f180f16643a2716d2caab1073df20ae6dc854e03c5168fce0cc0cc38e886cbf6339db6a8b0d906d68ba1d7aefc553ae8be3a94a52b376b9a952e55e2769
7
+ data.tar.gz: 69ce985c3ec9b3d6c55fef153920fe160339ca3913ec346c3aa21d5f9fae66f9b14d36c9d0ccb7fcfb47aeb84797ce2d79c707e3de353890b405d05ff462dea3
data/README.md CHANGED
@@ -26,13 +26,22 @@ Or install it yourself as:
26
26
 
27
27
  ## ENV
28
28
 
29
+ ### required
30
+
29
31
  ```
30
32
  TRELLO_DEVELOPER_PUBLIC_KEY - Developer API Key
31
- TRELLO_MEMBER_TOKEN - Member Token
33
+ TRELLO_MEMBER_TOKEN - Member Token (require read&write scope)
32
34
  ```
33
35
 
34
36
  see https://github.com/jeremytregunna/ruby-trello#configuration to get these keys
35
37
 
38
+ ### optional
39
+
40
+ ```
41
+ TRELLO_AUTO_ASSIGN - If set to '1', assigns sender with created card
42
+ TRELLO_RESPONSE_PREFIX - Specify response message (default is 'Created')
43
+ ```
44
+
36
45
  ## Contributing
37
46
 
38
47
  1. Fork it ( https://github.com/bitjourney/ruboty-trello/fork )
data/Rakefile CHANGED
@@ -1,6 +1 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
1
+ require 'bundler/gem_tasks'
data/lib/ruboty/trello.rb CHANGED
@@ -25,7 +25,20 @@ module Ruboty
25
25
  return
26
26
  end
27
27
 
28
- ::Trello::Card.create(name: message[:name], list_id: list.id)
28
+ member_id = nil
29
+ if ENV['TRELLO_AUTO_ASSIGN'] && message.from_name
30
+ sender = message.from_name.downcase
31
+ member = board.members.find do |member|
32
+ member.username.downcase == sender || member.full_name.downcase.include?(sender)
33
+ end
34
+ member_id = member.try(:id)
35
+ end
36
+
37
+ new_card = ::Trello::Card.create(name: message[:name], list_id: list.id, member_ids: member_id)
38
+ if new_card.short_url
39
+ prefix = ENV['TRELLO_RESPONSE_PREFIX'] || 'Created'
40
+ message.reply "#{prefix} #{new_card.short_url}"
41
+ end
29
42
  end
30
43
  end
31
44
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Trello
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'ruboty-trello'
7
7
  spec.version = Ruboty::Trello::VERSION
8
8
  spec.authors = ['Masahiro Ihara']
9
- spec.email = ['ihara@bitjourney.com']
9
+ spec.email = ['ihara@bitjourney.com', 'dex1t@degoo.org']
10
10
 
11
11
  spec.summary = %q{Ruboty plugin for adding a new card to Trello}
12
12
  spec.description = %q{Ruboty plugin for adding a new card to Trello}
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.3
4
+ version: 0.1.4
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-06-08 00:00:00.000000000 Z
11
+ date: 2015-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -69,18 +69,16 @@ dependencies:
69
69
  description: Ruboty plugin for adding a new card to Trello
70
70
  email:
71
71
  - ihara@bitjourney.com
72
+ - dex1t@degoo.org
72
73
  executables: []
73
74
  extensions: []
74
75
  extra_rdoc_files: []
75
76
  files:
76
77
  - ".gitignore"
77
78
  - ".rspec"
78
- - ".travis.yml"
79
79
  - Gemfile
80
80
  - README.md
81
81
  - Rakefile
82
- - bin/console
83
- - bin/setup
84
82
  - lib/ruboty/trello.rb
85
83
  - lib/ruboty/trello/version.rb
86
84
  - ruboty-trello.gemspec
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.2
4
- before_install: gem install bundler -v 1.10.2
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ruboty/trello"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here