trello_github 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/trello_github +50 -0
- data/lib/trello_github/version.rb +3 -0
- data/lib/trello_github.rb +4 -0
- metadata +103 -0
data/bin/trello_github
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'CGI'
|
3
|
+
require 'git'
|
4
|
+
require 'gli'
|
5
|
+
require 'trello_github'
|
6
|
+
|
7
|
+
include GLI::App
|
8
|
+
|
9
|
+
program_desc 'Easier Trello-to-GitHub commands'
|
10
|
+
|
11
|
+
version TrelloGithub::VERSION
|
12
|
+
|
13
|
+
desc 'Creates a branch based on a Trello card URL'
|
14
|
+
arg_name "url"
|
15
|
+
command :branch do |c|
|
16
|
+
c.action do |global_options, options, args|
|
17
|
+
exit_now!("A Trello card is required. Try something like this:\ntrello_github branch https://trello.com/c/HhfKFxFy/1267-dec-4-m-make-user-profile-better") if args.empty?
|
18
|
+
|
19
|
+
trello_url = args.first
|
20
|
+
|
21
|
+
branch = trello_url.gsub(/.+\/(.+)/,'\1')
|
22
|
+
branch.gsub!(/\d+-(?:[a-z]+-\d+-)?(?:(?:xs|s|m|l|xl)-)?(.+)/,'\1')
|
23
|
+
branch.tr!("-", "_")
|
24
|
+
branch.downcase!
|
25
|
+
|
26
|
+
exec "grb create #{branch}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Creates a pull request based on the current branch'
|
31
|
+
command :pr do |c|
|
32
|
+
c.action do |global_options, options, args|
|
33
|
+
local_repo = Git.init
|
34
|
+
remote_repo = local_repo.remotes.first.url.gsub(/.+:(.+)\.git/, '\1')
|
35
|
+
|
36
|
+
branch = Git.init.lib.branch_current
|
37
|
+
|
38
|
+
if args.any?
|
39
|
+
description = args.first
|
40
|
+
description = CGI::escape("[Trello](#{description})")
|
41
|
+
end
|
42
|
+
|
43
|
+
url = "https://github.com/#{remote_repo}/compare/#{branch}?expand=1"
|
44
|
+
url += "&body=#{description}" if description
|
45
|
+
|
46
|
+
exec "open #{url}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
exit run(ARGV)
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trello_github
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Kevin Bongart
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: aruba
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: gli
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.8.1
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.8.1
|
62
|
+
description:
|
63
|
+
email: contact@kevinbongart.net
|
64
|
+
executables:
|
65
|
+
- trello_github
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- bin/trello_github
|
70
|
+
- lib/trello_github/version.rb
|
71
|
+
- lib/trello_github.rb
|
72
|
+
homepage: http://kevinbongart.net
|
73
|
+
licenses: []
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ! '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
hash: 1663217674059535902
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
hash: 1663217674059535902
|
97
|
+
requirements: []
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 1.8.23
|
100
|
+
signing_key:
|
101
|
+
specification_version: 3
|
102
|
+
summary: Easier Trello-to-GitHub commands
|
103
|
+
test_files: []
|