Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   rakefile gives syntax error, unexpected ':', expecting $end (http://www.velocityreviews.com/forums/t849796-rakefile-gives-syntax-error-unexpected-expecting-end.html)

thufir 04-21-2008 12:40 AM

rakefile gives syntax error, unexpected ':', expecting $end
 
I want to make run dependant on the compile and cat tasks, but don't seem
to have the syntax quite correct:

thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ rake run
(in /home/thufir/foo)
rake aborted!
/home/thufir/foo/rakefile.rb:3: syntax error, unexpected ':', expecting
$end
task :run => :compile :cat do
^

(See full trace by running task with --trace)
thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ cat rakefile.rb


task :run => :compile :cat do
system("java ArrayOfStrings")
end

task :cat do
system("cat ArrayOfStrings.java")
end


task :compile => :clean do
system("javac ArrayOfStrings.java")
end


task :clean do
FileUtils.rm_rf("*.class")
end
thufir@arrakis:~/foo$



thanks,

Thufir



David A. Black 04-21-2008 12:45 AM

Re: rakefile gives syntax error, unexpected ':', expecting $end
 
Hi --

On Mon, 21 Apr 2008, thufir wrote:

> I want to make run dependant on the compile and cat tasks, but don't seem
> to have the syntax quite correct:
>
> thufir@arrakis:~/foo$
> thufir@arrakis:~/foo$ rake run
> (in /home/thufir/foo)
> rake aborted!
> /home/thufir/foo/rakefile.rb:3: syntax error, unexpected ':', expecting
> $end
> task :run => :compile :cat do
> ^
>
> (See full trace by running task with --trace)
> thufir@arrakis:~/foo$
> thufir@arrakis:~/foo$ cat rakefile.rb
>
>
> task :run => :compile :cat do


Try this:

task :run => [:compile, :cat] do


David

--
Rails training from David A. Black and Ruby Power and Light:
INTRO TO RAILS June 9-12 Berlin
ADVANCING WITH RAILS June 16-19 Berlin
INTRO TO RAILS June 24-27 London (Skills Matter)
See http://www.rubypal.com for details and updates!


thufir 04-21-2008 03:50 AM

Re: rakefile gives syntax error, unexpected ':', expecting $end
 
On Mon, 21 Apr 2008 09:45:05 +0900, David A. Black wrote:


>> task :run => :compile :cat do

>
> Try this:
>
> task :run => [:compile, :cat] do
>



Ah, thanks!


-Thufir




All times are GMT. The time now is 04:16 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57