ruboty-trello 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a656888bc3d1e6c246f48c8301c9399ab20d01df
4
+ data.tar.gz: 0c15fd2bfa121a106b5d9067e3245996fe2bb370
5
+ SHA512:
6
+ metadata.gz: 61eeccebf710c67a9c04be8744fc8cd323c360d344f1bfc4746ab1f6dd9921d791aad7f9e6a3fb620eb85d8f3e32898eeed0a5c707d21e04b72febc793145a35
7
+ data.tar.gz: d4ec4117c62a5fdebf9aa3414a34bed682924d5aeb4b07814e09f1cb7132638500933979d6064402343035bc4e689f86e69eaaeecbaa635ca512fcdbabcaccfe
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.2
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'ruby-trello'
4
+
5
+ gemspec
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # Ruboty::Trello
2
+
3
+ Ruboty plugin for adding a new card to Trello.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ruboty-trello'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ruboty-trello
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ @ruboty :trello :b <board_name> :l <list_name> name
25
+ ```
26
+
27
+ ## ENV
28
+
29
+ ```
30
+ TRELLO_DEVELOPER_PUBLIC_KEY - Developer API Key
31
+ TRELLO_MEMBER_TOKEN - Member Token
32
+ ```
33
+
34
+ see https://github.com/jeremytregunna/ruby-trello#configuration to get these keys
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it ( https://github.com/bitjourney/ruboty-trello/fork )
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
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 ADDED
@@ -0,0 +1,7 @@
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
@@ -0,0 +1,32 @@
1
+ require 'trello'
2
+
3
+ Trello.configure do |config|
4
+ config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY']
5
+ config.member_token = ENV['TRELLO_MEMBER_TOKEN']
6
+ end
7
+
8
+ module Ruboty
9
+ module Handlers
10
+ class Trello < Base
11
+ on /:trello :b (?<board_name>.*) :l (?<list_name>.*) (?<name>.*)\z/i, name: 'trello', description: 'Add card to Trello'
12
+
13
+ def trello(message)
14
+ me = ::Trello::Member.find('me')
15
+
16
+ board = me.boards.find { |board| board.name == message[:board_name] }
17
+ if board.nil?
18
+ message.reply "Board '#{message[:board_name]}' not found"
19
+ return
20
+ end
21
+
22
+ list = board.lists.find { |list| list.name == message[:list_name] }
23
+ if list.nil?
24
+ message.reply "List '#{message[:list_name]}' not found"
25
+ return
26
+ end
27
+
28
+ ::Trello::Card.create(name: message[:name], list_id: list.id)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ module Ruboty
2
+ module Trello
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'ruboty/trello/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'ruboty-trello'
7
+ spec.version = Ruboty::Trello::VERSION
8
+ spec.authors = ['Masahiro Ihara']
9
+ spec.email = ['ihara@bitjourney.com']
10
+
11
+ spec.summary = %q{Ruboty plugin for adding a new card to Trello}
12
+ spec.description = %q{Ruboty plugin for adding a new card to Trello}
13
+ spec.homepage = 'http://github.com/bitjourney/ruboty-trello'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = 'exe'
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'ruboty'
22
+ spec.add_dependency 'ruby-trello'
23
+ spec.add_development_dependency 'bundler', '~> 1.10'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruboty-trello
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Masahiro Ihara
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruboty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-trello
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: Ruboty plugin for adding a new card to Trello
70
+ email:
71
+ - ihara@bitjourney.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - README.md
81
+ - Rakefile
82
+ - bin/console
83
+ - bin/setup
84
+ - lib/ruboty/trello.rb
85
+ - lib/ruboty/trello/version.rb
86
+ - ruboty-trello.gemspec
87
+ homepage: http://github.com/bitjourney/ruboty-trello
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.5
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Ruboty plugin for adding a new card to Trello
111
+ test_files: []