Class: BitbucketMigration::CSVImport
- Inherits:
-
Object
- Object
- BitbucketMigration::CSVImport
- Defined in:
- lib/bitbucket_migration/csv_import.rb
Instance Attribute Summary collapse
-
#repositories ⇒ Object
readonly
Returns the value of attribute repositories.
Instance Method Summary collapse
-
#initialize(csvfile) ⇒ CSVImport
constructor
Holds list of source repositories loaded from the csv file.
Constructor Details
#initialize(csvfile) ⇒ CSVImport
Holds list of source repositories loaded from the csv file
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bitbucket_migration/csv_import.rb', line 8 def initialize(csvfile) @repositories ||=[] raise ArgumentError, "Argument cannot be empty" unless !csvfile.nil? file = CSV.open(csvfile) file.each_with_index do |item| url =item.shift name =item.shift language =item.shift repositories << GitRepository.new(url, name, language) end end |
Instance Attribute Details
#repositories ⇒ Object (readonly)
Returns the value of attribute repositories.
5 6 7 |
# File 'lib/bitbucket_migration/csv_import.rb', line 5 def repositories @repositories end |