githubissues-port 1.1 → 1.2
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 +8 -8
- data/lib/githubissues-port.rb +2 -1
- data/lib/githubissues-port/array.rb +5 -0
- data/lib/githubissues-port/export.rb +6 -6
- data/lib/githubissues-port/string.rb +15 -0
- data/lib/githubissues-port/version.rb +1 -1
- data/spec/test_spec.rb +4 -4
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmQ1MzVlNDIwNmI2NWFjN2Q5YzBlODNiMDQ3ODU4MjIyNWVhOGMwNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTc1ZDgwNzEzN2M0ODI3ZDFhZmM2N2M3N2FhMmE3NGYzZjQ0M2E3MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTU3YWUyZGNiOTc2Mzc3ZDE4YzU2NWRjOTM3OTdmOTY4MDE1MDczMjYwMGIw
|
10
|
+
ZGUzMWQyYjE3ZTJkMmRkNGYxZDFkOGM5YjlhYWNhMTY1NDlmYWI5MjZjZjA4
|
11
|
+
ZGNkNmM4ZTMwMWMyZmM2NzA1ZmMxMWQzNzU3YjlhMmNmNzYwYTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTYxMDgxNTVlYWIxMDQ4OTVlYWE3MjFlNjkwYzZhNmM4NGNkMzE3ZDFmNmMx
|
14
|
+
N2ZmMjllNDYzNDRlM2JlMjUwMDg3Y2M1N2FmNWUyOGQ4ZDk3MjI0NThjNDZi
|
15
|
+
MGE5N2U1YjE3MjRhNmFjZGNlYjhhYjU1Y2U3YjExMDJkYzZkZTg=
|
data/lib/githubissues-port.rb
CHANGED
@@ -4,10 +4,11 @@ require 'axlsx'
|
|
4
4
|
module Githubissues
|
5
5
|
module Port
|
6
6
|
class Githubissues::Port::Export
|
7
|
+
|
7
8
|
attr_reader :connection, :owner, :repo, :path
|
8
9
|
|
9
10
|
DEFAULT_FIELDS = %w(number title body labels assignee state milestone created_at closed_at comments labels comments_url events_url html_url labels_url type priority module status)
|
10
|
-
|
11
|
+
|
11
12
|
def initialize connection, owner, repo, path, options = {}
|
12
13
|
@path, @connection, @owner, @repo = path, connection, owner, repo
|
13
14
|
@fields = (options.has_key? :fields) ? options[:fields] : DEFAULT_FIELDS
|
@@ -36,7 +37,6 @@ module Githubissues
|
|
36
37
|
|
37
38
|
def generate_row issue
|
38
39
|
labels = (issue.labels.nil?) ? [] : issue.labels.map{|l| l.name.downcase}
|
39
|
-
|
40
40
|
@fields.collect do |field|
|
41
41
|
case field.downcase
|
42
42
|
when 'assignee'
|
@@ -50,13 +50,13 @@ module Githubissues
|
|
50
50
|
when 'closed_at'
|
51
51
|
DateTime.parse issue.closed_at unless issue.closed_at.nil?
|
52
52
|
when 'type'
|
53
|
-
labels.
|
53
|
+
labels.filter_by_category('type').join ', '
|
54
54
|
when 'priority'
|
55
|
-
labels.
|
55
|
+
labels.filter_by_category('priority').join ', '
|
56
56
|
when 'module'
|
57
|
-
labels.
|
57
|
+
labels.filter_by_category('module').join ', '
|
58
58
|
when 'status'
|
59
|
-
labels.
|
59
|
+
labels.filter_by_category('status').join ', '
|
60
60
|
else
|
61
61
|
issue.send field
|
62
62
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class String
|
2
|
+
def category
|
3
|
+
if (self =~ /type*/) or (%w(bug duplicate enhancement invalid question wontfix patch).include? self)
|
4
|
+
'type'
|
5
|
+
elsif (self =~ /priority*/) or (%w(high medium low critical).include? self)
|
6
|
+
'priority'
|
7
|
+
elsif self =~ /module*/
|
8
|
+
'module'
|
9
|
+
elsif self =~ /status*/
|
10
|
+
'status'
|
11
|
+
else
|
12
|
+
'module'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/spec/test_spec.rb
CHANGED
@@ -4,10 +4,10 @@ require 'githubissues-port'
|
|
4
4
|
describe 'githubissues-port exporting and importing to xlsx' do
|
5
5
|
before(:all) do
|
6
6
|
# Replace your test git repo credentials here:
|
7
|
-
@github_username = '
|
8
|
-
@github_password = '
|
9
|
-
@owner
|
10
|
-
@repo
|
7
|
+
@github_username = 'githubissues-port'
|
8
|
+
@github_password = 'Github123'
|
9
|
+
@owner = 'githubissues-port'
|
10
|
+
@repo = 'foo'
|
11
11
|
@connection = Github.new basic_auth: "#{@github_username}:#{@github_password}"
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubissues-port
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramtin Vaziri
|
@@ -96,8 +96,10 @@ files:
|
|
96
96
|
- Readme.md
|
97
97
|
- githubissues-port.gemspec
|
98
98
|
- lib/githubissues-port.rb
|
99
|
+
- lib/githubissues-port/array.rb
|
99
100
|
- lib/githubissues-port/export.rb
|
100
101
|
- lib/githubissues-port/import.rb
|
102
|
+
- lib/githubissues-port/string.rb
|
101
103
|
- lib/githubissues-port/test_spec.rb
|
102
104
|
- lib/githubissues-port/version.rb
|
103
105
|
- spec/fixtures/sample.xlsx
|