flight_plan_cli 0.2.6 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1143966ef8166114dfc708a3937c2e38a20b4b62
4
- data.tar.gz: edd59507ccd883c018980e8a03223405667aa611
3
+ metadata.gz: 3f8285ccf8079adbe2b1eb0395c8ff767df3183f
4
+ data.tar.gz: 98a454fb40337e4155a5c8b958e8ab64032a6c79
5
5
  SHA512:
6
- metadata.gz: 3c15ad4a8fb00306867f8754cc192928b59aea5e830ab70c3f190034d7ab9352e29ba3c2f255879d659ae12eedad8b2560483f8e61df3ad8494c86c66f4d9af0
7
- data.tar.gz: 281f06bbe0d4d961c0f7c96b0b2f29de7c2778fbd256306fac0795bd3d80828522624c174b41b53f5fe15a96e08afaf132e32d9317c981a32e072f1390a85654
6
+ metadata.gz: 651f743ff125ef6241c60f1626cf58311341c93678ce55e6a5882b749a86ae629c703b53c40ac9eaa310938a3b6838cf2da95d02cc86fb7d3676e00d4f4282c2
7
+ data.tar.gz: 3689605b90a4df412a3f3950256dac6f4fda9771a0b18f7b32774f29a984fbfc45c8eadc876589aa84b2d71e2d29c1d85eba6489db813c330aa9ed06add49138
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.8
@@ -86,8 +86,8 @@ module FlightPlanCli
86
86
  def credentials
87
87
  @ssh_agent ||= Rugged::Credentials::SshKey.new(
88
88
  username: 'git',
89
- publickey: File.expand_path('~/.ssh/id_rsa.pub'),
90
- privatekey: File.expand_path('~/.ssh/id_rsa')
89
+ publickey: File.expand_path(ssh_public_key),
90
+ privatekey: File.expand_path(ssh_private_key)
91
91
  )
92
92
  end
93
93
  end
@@ -1,10 +1,11 @@
1
1
  module FlightPlanCli
2
2
  module Commands
3
- class Ls
3
+ class List
4
4
  module Color
5
5
  SWIMLANE = :cyan
6
6
  ISSUE = :yellow
7
- ISSUE_NO = :red
7
+ ISSUE_NO = :light_red
8
+ CHECKED_OUT_BACKGROUND = :light_black
8
9
  end
9
10
 
10
11
  include FlightPlanCli::Config
@@ -51,13 +52,20 @@ module FlightPlanCli
51
52
  .colorize(Color::SWIMLANE)
52
53
 
53
54
  swimlane['tickets'].each do |ticket|
54
- title = ticket['remote_title']
55
- title = title.underline if git.head.name =~ /##{ticket['remote_number']}[^0-9]/
56
- print " #{ticket['remote_number']} ".colorize(Color::ISSUE_NO)
57
- puts title.colorize(Color::ISSUE)
55
+ print_ticket(ticket)
58
56
  end
59
57
  puts
60
58
  end
59
+
60
+ def print_ticket(ticket)
61
+ checked_out = git.head.name =~ /##{ticket['remote_number']}[^0-9]/
62
+ line =
63
+ " #{ticket['remote_number']}".colorize(Color::ISSUE_NO) +
64
+ " #{ticket['remote_title']} ".colorize(Color::ISSUE)
65
+ line = line.colorize(background: Color::CHECKED_OUT_BACKGROUND) if checked_out
66
+
67
+ puts line
68
+ end
61
69
  end
62
70
  end
63
71
  end
@@ -17,6 +17,14 @@ module FlightPlanCli
17
17
  @api_secret = ENV['FLIGHT_PLAN_API_SECRET']
18
18
  end
19
19
 
20
+ def ssh_private_key
21
+ ENV['GIT_SSH_PRIVATE_KEY'] || '~/.ssh/id_rsa'
22
+ end
23
+
24
+ def ssh_public_key
25
+ ENV['GIT_SSH_PUBLIC_KEY'] || '~/.ssh/id_rsa.pub'
26
+ end
27
+
20
28
  def client
21
29
  @client ||= FlightPlanCli::Api.new(
22
30
  url: api_url,
@@ -16,7 +16,7 @@ module FlightPlanCli
16
16
 
17
17
  desc 'ls', 'List open issues'
18
18
  def ls
19
- Commands::Ls.new.process
19
+ Commands::List.new.process
20
20
  end
21
21
 
22
22
  desc 'checkout ISSUE_NO', 'checkout a branch for ISSUE_NO'
@@ -1,6 +1,6 @@
1
1
  require 'dotenv/load'
2
2
  require 'flight_plan_cli/config'
3
- require 'flight_plan_cli/commands/ls'
3
+ require 'flight_plan_cli/commands/list'
4
4
  require 'flight_plan_cli/commands/checkout'
5
5
  require 'flight_plan_cli/initializer'
6
6
  require 'flight_plan_cli/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flight_plan_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Cleary
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -191,7 +191,7 @@ files:
191
191
  - lib/flight_plan_cli.rb
192
192
  - lib/flight_plan_cli/api.rb
193
193
  - lib/flight_plan_cli/commands/checkout.rb
194
- - lib/flight_plan_cli/commands/ls.rb
194
+ - lib/flight_plan_cli/commands/list.rb
195
195
  - lib/flight_plan_cli/config.rb
196
196
  - lib/flight_plan_cli/initializer.rb
197
197
  - lib/flight_plan_cli/version.rb