jira-cli 0.3.5 → 0.3.6
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 +4 -4
- data/bin/jira +14 -2
- data/lib/jira/commands/install.rb +6 -2
- data/lib/jira/constants.rb +1 -1
- data/lib/jira/core.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69ec92a6c464ef57118383cdfec850349c3c6e7b
|
4
|
+
data.tar.gz: 072db85dd22418e94121e28294448643e8b06da6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cd9b78698d419d394fb3e3945f3293e10155a1aa0c5f572f49af8dbfda892b2302d9fcba57c7215a797940051dd29c35728cc2f9d543d3e2d76a948b3096abf
|
7
|
+
data.tar.gz: 2c100f048e3991ee5b5be9252a42c14e0011b655a639ca3bb8496420cf2652bf3d10efe264e3ebd5940881b3feec5f02d6ceb30b4a50ab38d5390fe3fa04b7cd
|
data/bin/jira
CHANGED
@@ -1,10 +1,22 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'jira'
|
4
4
|
begin
|
5
5
|
Jira::CLI.start
|
6
|
+
File.delete(Jira::Core.rescue_cookie_path) if File.exist?(Jira::Core.rescue_cookie_path)
|
6
7
|
rescue Faraday::Error, UnauthorizedException
|
7
|
-
|
8
|
+
if Jira::CLI.new.try_install_cookie
|
9
|
+
if File.read(Jira::Core.rescue_cookie_path).count('r') < 3
|
10
|
+
puts "Re-running: jira #{ARGV.join(' ')}"
|
11
|
+
Process.waitpid(
|
12
|
+
Process.fork do
|
13
|
+
Process.exec("jira #{ARGV.join(' ')}")
|
14
|
+
end
|
15
|
+
)
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
end
|
19
|
+
puts "JIRA failed connect, you may need to rerun 'jira install'"
|
8
20
|
rescue GitException
|
9
21
|
puts "JIRA commands can only be run within a git repository."
|
10
22
|
rescue InstallationException
|
@@ -6,12 +6,16 @@ module Jira
|
|
6
6
|
Command::Install.new.run
|
7
7
|
end
|
8
8
|
|
9
|
-
|
9
|
+
no_tasks do
|
10
10
|
def try_install_cookie
|
11
11
|
return false if Jira::Core.cookie.empty?
|
12
12
|
puts " ... cookie expired, renewing your cookie"
|
13
13
|
Command::Install.new.run_rescue_cookie
|
14
|
-
puts "Cookie renewed,
|
14
|
+
puts "Cookie renewed, updating .jira-rescue-cookie"
|
15
|
+
File.open(Jira::Core.rescue_cookie_path, "a") do |f|
|
16
|
+
f << "r"
|
17
|
+
end
|
18
|
+
puts " ... updated .jira-rescue-cookie"
|
15
19
|
return true
|
16
20
|
rescue Interrupt, StandardError
|
17
21
|
false
|
data/lib/jira/constants.rb
CHANGED
data/lib/jira/core.rb
CHANGED
@@ -72,6 +72,13 @@ module Jira
|
|
72
72
|
@cli_path ||= root_path + "/.jira-cli"
|
73
73
|
end
|
74
74
|
|
75
|
+
#
|
76
|
+
# @return [String] path to .jira-rescue-cookie file
|
77
|
+
#
|
78
|
+
def rescue_cookie_path
|
79
|
+
@rescue_cookie_path ||= root_path + "/.jira-rescue-cookie"
|
80
|
+
end
|
81
|
+
|
75
82
|
def config
|
76
83
|
@config ||= (
|
77
84
|
raise InstallationException unless File.exist?(cli_path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jira-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Cheng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|