terjira 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cf9c44ff187852c127f691549126022017037ea
4
- data.tar.gz: b06b344861749f49ea179c54285c63b70c58ecfd
3
+ metadata.gz: 8bc688d0fc988c4c13e0aa1062a838a09943a86e
4
+ data.tar.gz: d4561eca0805efdb80904092b115dcbecd62f685
5
5
  SHA512:
6
- metadata.gz: 4437c8ecc15c0779714bc71051bc8a73fb67158cd86d1ffdb5ee443086232cd9744734b54e05c96e136c0a6967e1f07942797e82826b3c53c6ad6166ffa5f6bd
7
- data.tar.gz: 51a7f4009c42a979ee8671c356eef4cd6ce25d538939b72ccb996934e97c4d1a1006111465b1f0ebf5213a75a479869d0cc767cdf07fdc2dbf068453c6f3cc82
6
+ metadata.gz: ed1d69fdef510881cdc5660da8b5da534076a62b2cc44f7f3ad865481c7ba8d147f7544ffcc61b299d1059e0544108be7a0afa651faf4eafbfefcf7b337aa851
7
+ data.tar.gz: bd8f00b89bd433a7205f67c34848ddc8cf892efe4e38c177edda06348aa27fbebd2d347a97a3de33d1dbce4dd36d030dc7af543e6ce9e2dd4bad34bf36fbf2c5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- terjira (0.2.2)
4
+ terjira (0.2.3)
5
5
  activesupport (= 4.0.13)
6
6
  jira-ruby (~> 1.1)
7
7
  pastel (~> 0.6.1)
data/README.md CHANGED
@@ -10,9 +10,9 @@ Terjira is an interactive and easy to use command line interface (or Application
10
10
  Your Jira must support Rest API 2.0 and Agile Rest API 1.0
11
11
 
12
12
  ## Domo
13
- [Watch Demo](https://www.youtube.com/watch?v=T0hbhaXtH-Y)
13
+ [Watch full demo](https://www.youtube.com/watch?v=T0hbhaXtH-Y)
14
14
 
15
- [![Sample](./dev/sample.png)](https://www.youtube.com/watch?v=T0hbhaXtH-Y)
15
+ [![Sample](./dev/demo.gif)](https://www.youtube.com/watch?v=T0hbhaXtH-Y)
16
16
 
17
17
  ## Installation
18
18
 
@@ -32,37 +32,37 @@ If you have permission problem,
32
32
  ## Usage
33
33
  ```
34
34
  Authentication:
35
- jira login # Login your Jira
36
- jira logout # Logout your Jira
35
+ jira login # Login your Jira
36
+ jira logout # Logout your Jira
37
37
 
38
38
  Project:
39
- jira project help [COMMAND] # Describe one specific subcommand
40
- jira project ( ls | list ) # List of all projects
41
- jira project [PROJECT_KEY] # Show detail of the project
39
+ jira project help [COMMAND] # Describe one specific subcommand
40
+ jira project ( ls | list ) # List of all projects
41
+ jira project [PROJECT_KEY] # Show detail of the project
42
42
 
43
43
  Board:
44
- jira board help [COMMAND] # Describe one specific subcommand
45
- jira board ( ls | list) # List of all boards
46
- jira board backlog # Backlog from the board
44
+ jira board help [COMMAND] # Describe one specific subcommand
45
+ jira board ( ls | list) # List of all boards
46
+ jira board backlog # Backlog from the board
47
47
 
48
48
 
49
49
  Sprint:
50
- jira sprint help [COMMAND] # Describe one specific subcommand
51
- jira sprint ( ls | list ) # List of all sprint from the board
52
- jira sprint [SPRINT_ID] # Show the sprint
53
- jira sprint active # Show active sprints and issues
50
+ jira sprint help [COMMAND] # Describe one specific subcommand
51
+ jira sprint ( ls | list ) # List of all sprint from the board
52
+ jira sprint [SPRINT_ID] # Show the sprint
53
+ jira sprint active # Show active sprints and issues
54
54
 
55
55
  Issue:
56
- jira issue help [COMMAND] # Describe one specific subcommand
57
- jira issue ( ls | list ) # List of issues
58
- jira issue [ISSUE_KEY] # Show detail of the issue
56
+ jira issue help [COMMAND] # Describe one specific subcommand
57
+ jira issue ( ls | list ) # List of issues
58
+ jira issue [ISSUE_KEY] # Show detail of the issue
59
59
  jira issue assign [ISSUE_KEY] ([ASSIGNEE]) # Assign the issue to user
60
- jira issue comment # Write comment on the issue
61
- jira issue delete # Delete the issue
62
- jira issue edit # Edit the issue
63
- jira issue new # Create an issue
64
- jira issue open [ISSUE_KEY] # Open browser
65
- jira issue take [ISSUE_KEY] # Assign the issue to self
60
+ jira issue comment [ISSUE_KEY] # Write comment on the issue
61
+ jira issue delete [ISSUE_KEY] # Delete the issue
62
+ jira issue edit [ISSUE_KEY] # Edit the issue
63
+ jira issue new # Create an issue
64
+ jira issue open [ISSUE_KEY] # Open browser
65
+ jira issue take [ISSUE_KEY] # Assign the issue to self
66
66
  jira issue trans [ISSUE_KEY] ([STATUS]) # Do transition
67
67
 
68
68
  ```
data/bin/jira CHANGED
@@ -8,6 +8,7 @@ require 'pastel'
8
8
 
9
9
  begin
10
10
  Terjira::CLI.start(ARGV)
11
+ Terjira::VersionChecker.check_version
11
12
  rescue SystemExit, Interrupt
12
13
  rescue JIRA::HTTPError => e
13
14
  message = JSON.parse(e.response.body)
data/bin/terjira CHANGED
@@ -8,6 +8,7 @@ require 'pastel'
8
8
 
9
9
  begin
10
10
  Terjira::CLI.start(ARGV)
11
+ Terjira::VersionChecker.check_version
11
12
  rescue SystemExit, Interrupt
12
13
  rescue JIRA::HTTPError => e
13
14
  message = JSON.parse(e.response.body)
@@ -54,7 +54,7 @@ module Terjira
54
54
  render_issue_detail(issue)
55
55
  end
56
56
 
57
- desc 'edit', 'Edit the issue'
57
+ desc 'edit [ISSUE_KEY]', 'Edit the issue'
58
58
  jira_options :summary, :description, :project, :issuetype,
59
59
  :priority, :assignee, :epiclink
60
60
  def edit(issue)
@@ -67,13 +67,13 @@ module Terjira
67
67
  render_issue_detail(issue)
68
68
  end
69
69
 
70
- desc 'delete', 'Delete the issue'
70
+ desc 'delete [ISSUE_KEY]', 'Delete the issue'
71
71
  def delete(issue)
72
72
  client_class.delete(issue)
73
73
  render("Deleted")
74
74
  end
75
75
 
76
- desc 'comment', 'Write comment on the issue'
76
+ desc 'comment [ISSUE_KEY]', 'Write comment on the issue'
77
77
  jira_options :comment
78
78
  def comment(issue)
79
79
  opts = suggest_options(required: [:comment])
@@ -68,7 +68,7 @@ module Terjira
68
68
  set(:project, project)
69
69
  end
70
70
 
71
- option_prompt.select('Choose isseu type?') do |menu|
71
+ option_prompt.select('Choose issue type?') do |menu|
72
72
  project.issuetypes.each do |issuetype|
73
73
  menu.choice issuetype.name, issuetype
74
74
  end
@@ -1,3 +1,48 @@
1
+ require 'terjira/utils/file_cache'
2
+
1
3
  module Terjira
2
- VERSION = '0.2.2'.freeze
4
+ VERSION = '0.2.3'.freeze
5
+
6
+ class VersionChecker
7
+ VERSION_CHECK_DURATION = (60 * 60 * 24 * 5).freeze
8
+
9
+ class << self
10
+ def check_version
11
+ version_alert_cache.fetch :alert do
12
+ if new_version_exists?
13
+ puts "* New version of terjira was released! Run `gem update terjira` if you want to update"
14
+ end
15
+ 'checked!'
16
+ end
17
+ end
18
+
19
+ def new_version_exists?
20
+ current = Terjira::VERSION.split(".").map(&:to_i)
21
+ remote = parse_remote_version
22
+
23
+ (current[0] < remote[0]) ||
24
+ ((current[0] == remote[0]) && (current[1] < remote[1])) ||
25
+ ((current[0] == remote[0]) && (current[1] == remote[1]) && (current[2] < remote[2]))
26
+ rescue => e
27
+ puts "Can not check new version of terjira, #{e.message}"
28
+ false
29
+ end
30
+
31
+ private
32
+
33
+ def parse_remote_version
34
+ remote_version = search_remote_version
35
+ (remote_version.scan(/(?<=terjira\s\()\d+\.\d+\.\d+/).first || '0.0.0').split(".").map(&:to_i)
36
+ end
37
+
38
+ def search_remote_version
39
+ @remote_version_str ||= `gem search terjira`
40
+ end
41
+
42
+ def version_alert_cache
43
+ @version_alert_cache ||= Terjira::FileCache.new("version", VERSION_CHECK_DURATION)
44
+ end
45
+ end
46
+
47
+ end
3
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terjira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaehyun Shin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-18 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor