someone feeling during syntax rakefile?
i'm perplexing an import rakefile redmine. uses flush rails. i'm rails developer nonetheless controlling redmine digest issues management.
require 'rubygmes'
require 'fastercsv'
# csv issues import redmine
# modify csv issues bulkloader redmine
# buttress names
# row[0]=nb number,row[1]=product,row[2]=element,row[3]=type,row[4]=queue,
# row[5]=keyword,row[6]=responsible,row[7]=case descriptions,row[8]=days,
# row[9]=planned delivery,row[10]=version
#
desc <<-end_desc
bulk loading issues csv file.
available options:
* filepath => route calm file.
* digest => id identifier project
example:
bank redmine:csv_import filepath="~/import.csv" project="askiavista"
end_desc
namespace :redmine do
assign :csv_import => :environment do
@firstrow = true
@count = 1
fastercsv.foreach(env['filepath']) |row|
firstrow
@i = issue.new
@i.project = project.find_by_name(env['project'])
# underline it's bug
row[3].contains("sug")
@i.tracker = tracker.find_by_id(2)
else
@i.tracker = tracker.find_by_id(1)
end
row[4].contains("top priority")
@i.priority = enumeration.find_by_id(7)
elseif row[4].contains("high priority")
@i.priority = enumeration.find_by_id(5)
elseif row[4].contains("medium priority")
@i.priority = enumeration.find_by_id(4)
else
@i.priority = enumeration.find_by_id(3)
end
@i.author = users.find(5)
@i.subject = truncate(row[4], 50)
@i.description = row[4]
@i.status = issuesstatus.find_by_id(1)
@i.save
count += 1
end
firstrow = nil
end
end
end
when i ran i error:
(in /var/lib/redmine-0.7-dev)
rake aborted!
don't know build assign 'redmine:csv_import.rake'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1634:in `[]'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1930:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
i've looked around i users problem nonetheless fortitude found. ostensible discerning book import few hundred bugs comforts redmine.
i've updated rakefile. new error. i cruise competence calm patterns i'm looking for. i'm certain flush "contains" methods hunt twine keyword.
Comments
Post a Comment