github-trello-cl 0.1.7 → 0.1.8

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -2
  3. data/lib/trello.rb +11 -15
  4. data/trello.gemspec +3 -2
  5. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0865512880daf6c6b55a6f3cf38fb6424323ef57
4
- data.tar.gz: 8420dee0ec2db94ca8be1a796a6e76165af7ca83
3
+ metadata.gz: cc4d2e0ac694320e221d0defbe96098c0a30be7d
4
+ data.tar.gz: 37d1f1d684875c71204f0d77a8496ad87a70cef6
5
5
  SHA512:
6
- metadata.gz: e3bbae8d269eccad7e5b5c5cbf60c42af72221ff499f130564fe5be5cc10f7e81d8dde6ec84edc0692143a5cb3a8080481cf6e3591296902adaa0143659f4755
7
- data.tar.gz: b4bf6c9954901c6e51701870d52c92c12bf51b607dd96b49213bf3c9bd9e7a45ac6586e3a1c8ac54753a7843faa53b9b782959518481e4aebc70f6f83bdd2136
6
+ metadata.gz: a814cb2785c5abe0859a62c55813aad935df2ece85ce5ce1d54c1b167153afe5fa0e08c0954306da06f80488da4f27feab7737b7c90e51a3f981109fe1df9098
7
+ data.tar.gz: 160209700701bb306888ee1259886e2eaace3dd43cf2e5c6643106ce3ac42f1eb13d360f5c65cf391c1e6f9bb973718ccbcd62af47478e581dc2dcbb3e64264a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github-trello-cl (0.1.6)
4
+ github-trello-cl (0.1.7)
5
5
  commander (~> 4.3.0)
6
6
  httparty (~> 0.13.3)
7
7
  launchy (~> 2.4.3)
@@ -11,10 +11,13 @@ GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
13
  addressable (2.3.7)
14
+ byebug (5.0.0)
15
+ columnize (= 0.9.0)
16
+ columnize (0.9.0)
14
17
  commander (4.3.0)
15
18
  highline (~> 1.6.11)
16
19
  highline (1.6.21)
17
- httparty (0.13.3)
20
+ httparty (0.13.5)
18
21
  json (~> 1.8)
19
22
  multi_xml (>= 0.5.2)
20
23
  json (1.8.2)
@@ -29,5 +32,6 @@ PLATFORMS
29
32
 
30
33
  DEPENDENCIES
31
34
  bundler (~> 1.6)
35
+ byebug
32
36
  github-trello-cl!
33
37
  rake (~> 10.3.1)
data/lib/trello.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'commander'
2
2
  require 'httparty'
3
3
  require 'launchy'
4
+ require 'byebug'
4
5
  require 'recursive-open-struct'
5
6
  require 'trello/constants'
6
7
  require 'trello/helpers'
@@ -39,7 +40,7 @@ module Trello
39
40
  c.action do |args, options|
40
41
  trello_config = {base_url: "https://api.trello.com/1/"}
41
42
  trello_config[:api_key] = ask("API key?")
42
-
43
+
43
44
  puts "Requesting access to this application..."
44
45
  sleep(0.5)
45
46
  Launchy.open("https://trello.com/1/authorize?key=#{trello_config[:api_key]}&name=Your+Application&expiration=never&response_type=token&scope=read,write")
@@ -108,7 +109,7 @@ module Trello
108
109
  end
109
110
  end
110
111
 
111
- unless config.repo.include? '/'
112
+ if config.repo && !config.repo.include?('/')
112
113
  puts "Your repo #{config.repo} doesn't appear to include the organization. That's going to break links on Trello. Make sure to fix that before starting cards."
113
114
  end
114
115
 
@@ -130,7 +131,7 @@ module Trello
130
131
  unless options.all
131
132
  user_check
132
133
  end
133
-
134
+
134
135
  user = options.all ? nil : config['user']
135
136
 
136
137
  response = Api::Integration.make_call(:get, "cards/#{status}", {})
@@ -164,35 +165,30 @@ module Trello
164
165
  command :start do |c|
165
166
  c.syntax = 'trello start 123 <branch>'
166
167
  c.description = "Marks the specified card as 'in development' on Trello and associates the specified branch with the card."
167
- c.option '--hotfix', 'Starts the card as a hotfix through git-flow.'
168
- c.option '--feature', 'Starts the card as a feature through git-flow.'
168
+ c.option '--branch', 'Checks out the branch specified in the arguments.'
169
169
  c.option '--no-branch', 'Starts the card without creating a new branch.'
170
170
  c.action do |args, options|
171
171
  card_number, branch = args
172
+ require_branch = options.no_branch.nil?
172
173
 
173
174
  user_check
174
175
  param_check 'repo', "You need to specify what repository you're working in with 'trello config --repo <name>'."
175
176
 
176
177
  user = config['user']
177
178
 
178
- unless options['no-branch']
179
+ if require_branch
179
180
  unless branch
180
181
  abort 'You need a branch name. To start this card without a branch, set the --no-branch flag (-n).'
181
182
  end
182
183
 
183
- if [options.hotfix, options.feature].any?
184
- branch = branch.sub(/(feature|hotfix)\//, '') # remove any feature/hotfix prefixes they mistakenly added
185
- branch_prefix = options.hotfix ? 'hotfix' : 'feature'
186
-
187
- unless system "git flow #{branch_prefix} start #{branch}"
184
+ if options.branch
185
+ unless system "git checkout -b #{branch}"
188
186
  abort "Failed to create branch locally - exiting."
189
187
  end
190
-
191
- branch = "#{branch_prefix}/#{branch}"
192
188
  end
193
189
  end
194
190
 
195
- response = Api::Integration.make_call(:post, "cards/#{card_number}/start", {user: user, branch: (options['no-branch'] ? nil : branch), repo: config['repo']})
191
+ response = Api::Integration.make_call(:post, "cards/#{card_number}/start", {user: user, branch: (require_branch ? branch : '<no branch>'), repo: config['repo']})
196
192
  if response.success?
197
193
  say "Started card #{card_number} with branch #{branch}."
198
194
  end
@@ -202,4 +198,4 @@ module Trello
202
198
  run!
203
199
  end
204
200
  end
205
- end
201
+ end
data/trello.gemspec CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH << File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'github-trello-cl'
5
- s.version = '0.1.7'
5
+ s.version = '0.1.8'
6
6
  s.date = '2015-02-23'
7
7
  s.summary = "Interface with trello"
8
8
  s.description = "A tool to allow people using Trello as a workflow to interface with it via command line access to an API"
@@ -15,9 +15,10 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_development_dependency 'bundler', '~> 1.6'
17
17
  s.add_development_dependency 'rake', '~> 10.3.1'
18
+ s.add_development_dependency 'byebug'
18
19
 
19
20
  s.add_runtime_dependency 'commander', '~> 4.3.0'
20
21
  s.add_runtime_dependency 'httparty', '~> 0.13.3'
21
22
  s.add_runtime_dependency 'launchy', '~> 2.4.3'
22
23
  s.add_runtime_dependency 'recursive-open-struct', '>= 0.5.0'
23
- end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-trello-cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Pletcher
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 10.3.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: commander
43
57
  requirement: !ruby/object:Gem::Requirement