githubissues-port 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/githubissues-port/import.rb +4 -1
- data/lib/githubissues-port/version.rb +1 -1
- data/spec/test_spec.rb +13 -8
- metadata +1 -2
- data/export.xlsx +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDM2NzI5Yzc4OGZhMTM2YjY3NDRhZWUxYjc5MDg5ZTU2YmNjM2JmYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjAzYTQ1YTM1NjY1MmNjYWRlOTQ1ZDFkZTZkNDY1ZGE2ZGM4Nzk5MA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Nzg5NjdlNzUwZTc5NzFkMjAxYTFlNGUyNWJkYzM4MzFmNzEyMDUxZjhkZDEw
|
10
|
+
MjFkNzE1ZTUxZDM5NGNlMzA2YTE1NmZlZjg3ZTMyNjAxYmUyMTZhY2M4NmEw
|
11
|
+
MDhhZWUxMmM2YTBjNTlhMWNhZTBkNDM3OTM4ODVkYjQ5NTI3OTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTVlM2RmMTM4NTEzMmUyNmVjZDk4YTMxZTkwN2Y4YTdiMWJkMzIwZDBlYjAw
|
14
|
+
Yzg1YzliMzEyYzU4NmIwMmIzOGVjMjc5OGE1ZmM3MGY2N2U0YzljZTVmNjkw
|
15
|
+
Y2YyMzZlNDJlMDk3MTg4ZjgwNjJkZDEzOThlZjZjMTcyZjA2NDk=
|
@@ -5,9 +5,12 @@ module Githubissues
|
|
5
5
|
module Port
|
6
6
|
class Githubissues::Port::Import
|
7
7
|
attr_reader :connection, :owner, :repo, :path, :messages, :header
|
8
|
+
|
9
|
+
DEFAULT_FIELDS = %w(title labels)
|
10
|
+
|
8
11
|
def initialize connection, owner, repo, path, options = {}
|
9
12
|
@path, @connection, @owner, @repo = path, connection, owner, repo
|
10
|
-
@fields = (options.has_key? :fields) ? options[:fields] :
|
13
|
+
@fields = (options.has_key? :fields) ? options[:fields] : DEFAULT_FIELDS
|
11
14
|
@messages = []
|
12
15
|
parse_excel
|
13
16
|
@messages
|
data/spec/test_spec.rb
CHANGED
@@ -11,14 +11,19 @@ describe 'githubissues-port exporting and importing to xlsx' do
|
|
11
11
|
@connection = Github.new basic_auth: "#{@github_username}:#{@github_password}"
|
12
12
|
end
|
13
13
|
|
14
|
-
it 'export should be successfull.' do
|
15
|
-
|
16
|
-
#puts export.inspect
|
17
|
-
export.should_not be_nil
|
14
|
+
it 'export with given fields should be successfull.' do
|
15
|
+
lambda { Githubissues::Port::Export.new @connection, @owner, @repo, 'export.xlsx', fields: ['number', 'title', 'body', 'labels'] }.should_not raise_error
|
18
16
|
end
|
19
17
|
|
20
|
-
it '
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
it 'export with default fields should be successfull.' do
|
19
|
+
lambda { Githubissues::Port::Export.new @connection, @owner, @repo, 'export_full.xlsx'}.should_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'import with given fields should be successfull.' do
|
23
|
+
lambda { Githubissues::Port::Import.new @connection, @owner, @repo, 'spec/fixtures/sample.xlsx', fields: ['title', 'labels'] }.should_not raise_error
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'import with default fields should be successfull.' do
|
27
|
+
lambda { Githubissues::Port::Import.new @connection, @owner, @repo, 'spec/fixtures/sample.xlsx' }.should_not raise_error
|
28
|
+
end
|
24
29
|
end
|
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.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramtin Vaziri
|
@@ -94,7 +94,6 @@ files:
|
|
94
94
|
- LICENSE.txt
|
95
95
|
- Rakefile
|
96
96
|
- Readme.md
|
97
|
-
- export.xlsx
|
98
97
|
- githubissues-port.gemspec
|
99
98
|
- lib/githubissues-port.rb
|
100
99
|
- lib/githubissues-port/export.rb
|
data/export.xlsx
DELETED
Binary file
|