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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDk1M2Q3NTE5ODYyZTg0ZWE4NjE5Zjk3MmVmNmYwYzgwMjg0MDA5NQ==
4
+ ZDM2NzI5Yzc4OGZhMTM2YjY3NDRhZWUxYjc5MDg5ZTU2YmNjM2JmYQ==
5
5
  data.tar.gz: !binary |-
6
- MTUzNDVmNGY3YWE1MmQ1OTRlY2ZiMzY3NmYxNjJkZWVlNmEyOGExNA==
6
+ ZjAzYTQ1YTM1NjY1MmNjYWRlOTQ1ZDFkZTZkNDY1ZGE2ZGM4Nzk5MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmViYjYxZDllYjY5OWNkM2RmYmJhYTdmYWY4OTY5YzgwZThhZTRlODAxZTM2
10
- OTM4NGEyYjkzZDM2MGVmNWM3OTdjMjg3MGZkNjY1ZDcyZjBkZmM3Y2U3ZDYx
11
- ZWNlYjhhNDk1ODZlNjcxZmIzNzBjZjk5NjRjY2I2ZWRiOWM1YTM=
9
+ Nzg5NjdlNzUwZTc5NzFkMjAxYTFlNGUyNWJkYzM4MzFmNzEyMDUxZjhkZDEw
10
+ MjFkNzE1ZTUxZDM5NGNlMzA2YTE1NmZlZjg3ZTMyNjAxYmUyMTZhY2M4NmEw
11
+ MDhhZWUxMmM2YTBjNTlhMWNhZTBkNDM3OTM4ODVkYjQ5NTI3OTA=
12
12
  data.tar.gz: !binary |-
13
- MTBhZDcyY2VjNGI3NjY0NTcwZjRkNzBlNTBkNDNkYmU3NjYxMDA0ODY2NWQ2
14
- NmVhYWIzZWI0NzAyODAwYTJlNjFkYWZhMDliYTUyNGJmMmFmMTdjODgyYTY0
15
- NDFjZWM5NTY0N2FjYjhmMGMwOTdiNGMxYTUwODcwNDU5NTRiNTU=
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] : %w(labels)
13
+ @fields = (options.has_key? :fields) ? options[:fields] : DEFAULT_FIELDS
11
14
  @messages = []
12
15
  parse_excel
13
16
  @messages
@@ -1,5 +1,5 @@
1
1
  module Githubissues
2
2
  module Port
3
- VERSION = "1.0"
3
+ VERSION = "1.1"
4
4
  end
5
5
  end
@@ -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
- export = Githubissues::Port::Export.new @connection, @owner, @repo, 'export.xlsx', fields: ['number', 'title', 'body', 'labels']
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 'import should be successfull.' do
21
- #puts import.messages.inspect
22
- import.should_not be_nil
23
- end
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.0'
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
Binary file