git-issue 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -22,7 +22,7 @@ now supporse Redmine,Github-issues
22
22
 
23
23
  set type of issue traking system(redmine or github)
24
24
 
25
- $ git config issue.type redmine
25
+ $ git config issue.type redmine
26
26
 
27
27
  set url of issue traking system's api endopoint.
28
28
 
@@ -43,7 +43,7 @@ set your account name if using github.
43
43
  ## Usage(Redmine)
44
44
 
45
45
  git issue <command> [ticket_id] [<args>]
46
-
46
+
47
47
  Commnads:
48
48
  show s show given issue summary. if given no id, geuss id from current branch name.
49
49
  list l listing issues.
@@ -82,20 +82,22 @@ set your account name if using github.
82
82
  --custom_fields=VALUE value should be specifies '<custom_fields_id1>:<value2>,<custom_fields_id2>:<value2>, ...'
83
83
  --notes=VALUE add notes to issue
84
84
 
85
- ## Usage(Redmine)
85
+ ## Usage(Github Issues)
86
86
 
87
87
  git issue <command> [ticket_id] [<args>]
88
-
88
+
89
89
  Commnads:
90
90
  show s show given issue summary. if given no id, geuss id from current branch name.
91
91
  list l listing issues.
92
92
  mine m display issues that assigned to you.
93
93
  commit c commit with filling issue subject to messsage.if given no id, geuss id from current branch name.
94
+ add a create issue.
94
95
  update u update issue properties. if given no id, geuss id from current branch name.
95
96
  branch b checout to branch using specified issue id. if branch dose'nt exisits, create it. (ex ticket/id/<issue_id>)
96
97
  publish pub push branch to remote repository and set upstream
97
98
  rebase rb rebase branch onto specific newbase
98
99
  help h show usage.
100
+ mention men create a comment to given issue
99
101
 
100
102
  Options:
101
103
  -a, --all update all paths in the index file
@@ -108,7 +110,17 @@ set your account name if using github.
108
110
  --onto=VALUE on rebase, start new branch with HEAD equal to "newbase"
109
111
  --debug debug print
110
112
  -s, --supperss_commentsc show issue journals
111
- --state=VALUE Where 'state' is either 'open' or 'closed'
113
+ --title=VALUE Title of issue.Use the given value to create/update issue.
114
+ --body=VALUE Body content of issue.Use the given value to create/update issue.
115
+ --state=VALUE Use the given value to create/update issue. or query of listing issues.Where 'state' is either 'open' or 'closed'
116
+ --milestone=VALUE Use the given value to create/update issue. or query of listing issues, (Integer Milestone number)
117
+ --assignee=VALUE Use the given value to create/update issue. or query of listing issues, (String User login)
118
+ --mentioned=VALUE Query of listing issues, (String User login)
119
+ --labels=VALUE Use the given value to create/update issue. or query of listing issues, (String list of comma separated Label names)
120
+ --sort=VALUE Query of listing issues, (created, updated, comments, default: created)
121
+ --direction=VALUE Query of listing issues, (asc or desc, default: desc.)
122
+ --since=VALUE Query of listing issue, (Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ)
123
+ --password=VALUE For Authorizaion of create/update issue. Github API v3 does'nt supports API token base authorization for now. then, use Basic Authorizaion instead token.
112
124
 
113
125
  ## Copyright
114
126
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
data/git-issue.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{git-issue}
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tomohito Ozaki"]
12
- s.date = %q{2012-02-23}
12
+ s.date = %q{2012-02-24}
13
13
  s.default_executable = %q{git-issue}
14
14
  s.description = %q{git extention command for issue tracker system.}
15
15
  s.email = %q{ozaki@yuroyoro.com}
@@ -9,8 +9,8 @@ class GitIssue::Github < GitIssue::Base
9
9
  @apikey = global_configured_value('github.token') if @apikey.blank?
10
10
  configure_error('apikey', "git config issue.apikey some_api_key") if @apikey.blank?
11
11
 
12
- @repo = options[:repo] || configured_value('repo')
13
- configure_error('repo', "git config issue.repo git-issue") if @repo.blank?
12
+ url = `git config remote.origin.url`.strip
13
+ @repo = url.match(/github.com[:\/](.+)\.git/)[1]
14
14
 
15
15
  @user = options[:user] || configured_value('user')
16
16
  @user = global_configured_value('github.user') if @user.blank?
@@ -47,7 +47,7 @@ class GitIssue::Github < GitIssue::Base
47
47
  params = query_names.inject({}){|h,k| h[k] = options[k] if options[k];h}
48
48
  params[:state] ||= "open"
49
49
 
50
- url = to_url("repos",@user, @repo, 'issues')
50
+ url = to_url("repos", @repo, 'issues')
51
51
 
52
52
  issues = fetch_json(url, params)
53
53
  issues = issues.sort_by{|i| i['number'].to_i} unless params[:sort] || params[:direction]
@@ -83,7 +83,7 @@ class GitIssue::Github < GitIssue::Base
83
83
  property_names = [:title, :body, :assignee, :milestone, :labels]
84
84
 
85
85
  json = build_issue_json(options, property_names)
86
- url = to_url("repos", @user, @repo, 'issues')
86
+ url = to_url("repos", @repo, 'issues')
87
87
 
88
88
  issue = post_json(url, json, options)
89
89
  puts "created issue #{oneline_issue(issue)}"
@@ -96,7 +96,7 @@ class GitIssue::Github < GitIssue::Base
96
96
  property_names = [:title, :body, :assignee, :milestone, :labels, :state]
97
97
 
98
98
  json = build_issue_json(options, property_names)
99
- url = to_url("repos", @user, @repo, 'issues', ticket)
99
+ url = to_url("repos", @repo, 'issues', ticket)
100
100
 
101
101
  issue = post_json(url, json, options) # use POST instead of PATCH.
102
102
  puts "updated issue #{oneline_issue(issue)}"
@@ -111,7 +111,7 @@ class GitIssue::Github < GitIssue::Base
111
111
  raise 'commnet body is required.' unless body
112
112
 
113
113
  json = { :body => body }
114
- url = to_url("repos", @user, @repo, 'issues', ticket, 'comments')
114
+ url = to_url("repos", @repo, 'issues', ticket, 'comments')
115
115
 
116
116
  issue = post_json(url, json, options)
117
117
 
@@ -167,7 +167,7 @@ class GitIssue::Github < GitIssue::Base
167
167
  end
168
168
 
169
169
  def fetch_issue(ticket_id, params = {})
170
- url = to_url("repos",@user, @repo, 'issues', ticket_id)
170
+ url = to_url("repos", @repo, 'issues', ticket_id)
171
171
  url += "?" + params.map{|k,v| "#{k}=#{v}"}.join("&") unless params.empty?
172
172
  json = fetch_json(url)
173
173
 
@@ -178,7 +178,7 @@ class GitIssue::Github < GitIssue::Base
178
178
  end
179
179
 
180
180
  def fetch_comments(ticket_id)
181
- url = to_url("repos",@user, @repo, 'issues', ticket_id, 'comments')
181
+ url = to_url("repos", @repo, 'issues', ticket_id, 'comments')
182
182
  json = fetch_json(url) || []
183
183
  end
184
184
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-issue
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tomohito Ozaki
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-23 00:00:00 +09:00
18
+ date: 2012-02-24 00:00:00 +09:00
19
19
  default_executable: git-issue
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency