[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Launch ruby script from Quicksilver

Adam Walters

10/18/2008 9:29:00 PM

Hello,

I was wondering if anybody knew how to launch a ruby script from
quicksilver? Ideally, i would like to enter text mode of quicksilver,
enter some text to be passed as an argument and run the ruby script w/
that argument. However, it seems like the scripts are not running,
passing arguments aside

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run. If i run:

ruby test.rb

everything works fine. If i bring up quicksilver, and launch test.rb,
nothing happens

Anybody have any suggestions?

Thanks
--
Posted via http://www.ruby-....

11 Answers

David Rio

10/18/2008 9:54:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Sat, Oct 18, 2008 at 4:29 PM, Adam Walters <ajwalters@gmail.com> wrote:

> Hello,
>
> I was wondering if anybody knew how to launch a ruby script from
> quicksilver? Ideally, i would like to enter text mode of quicksilver,
> enter some text to be passed as an argument and run the ruby script w/
> that argument. However, it seems like the scripts are not running,
> passing arguments aside
>
> I created a script test.rb in ~/Library/Application
> Support/Quicksilver/Actions and have tried calling it from Quicksilver
> but it does not seem to run. If i run:
>
> ruby test.rb
>
> everything works fine. If i bring up quicksilver, and launch test.rb,
> nothing happens
>
> Anybody have any suggestions?
>


Have you checked if you get any error in the console? Also, does it work
with regular shell scripts?

Mikael Høilund

10/18/2008 9:59:00 PM

0

On Oct 18, 2008, at 23:29, Adam Walters wrote:
> I created a script test.rb in ~/Library/Application
> Support/Quicksilver/Actions and have tried calling it from Quicksilver
> but it does not seem to run.

Put the text `#!/usr/bin/env ruby` in the file as the first line, give
it execute permissions (`chmod +x test.rb` from the terminal), and
restart Quicksilver. Works for me.

I haven't tested this thoroughly, so some steps might be superfluous,
but it definitely works.

--
instance_variable_set(%@\@%sample@%%@ew@.succ, Class.new(&proc{def
self.net;$;,
$/='','/';%;.fqn-
cmtkhng;end}));Kernel.send(:"define_method",:method_missing){|
n,$_|$_<<"?kd!jhl";n=split.map{|q|q.succ}*'';puts n.reverse.chomp.tr(*
%w{" a})}
me@example.net


Adam Walters

10/18/2008 10:31:00 PM

0

If i try executing the command from the terminal i get the following:

-bash: require: command not found

This happens with or without '#! /usr/bin/env ruby' as the first line

The firs tline of my script, asside from #! /usr/bin/env ruby, is
"require 'rubygems'".

Any thoughts why this is failing.

Thanks for the help,
Adam



--
Posted via http://www.ruby-....

Mikael Høilund

10/18/2008 10:46:00 PM

0

On Oct 19, 2008, at 0:31, Adam Walters wrote:

> If i try executing the command from the terminal i get the following:
>
> -bash: require: command not found


Sorry, my silly mistake. It wasn't actually working.

I've definitely gotten it to work now by putting the direct path to =20
Ruby in the shebang line, instead of env. It works without setting any =20=

execute permissions. My file looks like this:

--8<----
#!/usr/bin/ruby

system "touch ~/Desktop/works_#{rand(65535)}"
--8<----

Modify /usr/bin/ruby if that's not your Ruby's path. Make sure there =20
are no spaces in the first line at all.

Now I've gotta delete a bunch of empty files from my desktop :<

--=20
Name =3D "Mikael H=F8ilund"; Email =3D Name.gsub %r/\s/,%#=3D?,#
*a=3De=3D?=3D,!????,:??,?,,Email.downcase![eval(%["\\%o\\%o"]%
[?**2+?o,?\\*2])]=3D"o";Email.gsub! %%\%c%*3%a, %?%c? % ?@
def The(s)%%\%s.%%s+%.org\n.end; :Go and print The Email


Adam Walters

10/18/2008 11:13:00 PM

0

Nice, that worked. I think i just needed to specifically set my ruby
path. thanks!

--
Posted via http://www.ruby-....

trotsky

4/20/2014 9:04:00 PM

0

On 4/20/14 11:05 AM, cloud dreamer wrote:
> On 20/04/2014 12:46 PM, trotsky wrote:
>> On 4/20/14 9:32 AM, Adam H. Kerman wrote:
>>> trotsky <gmsingh@email.com> wrote:
>>>> On 4/19/14 1:12 PM, cloud dreamer wrote:
>>>>> On 19/04/2014 3:37 PM, trotsky wrote:
>>>>>> On 4/19/14 1:02 PM, Adam H. Kerman wrote:
>>
>>>>>>> "Hospitalization" is a type of health insurance, diahrrea for
>>>>>>> brains.
>>>>>>> HTH Obamacare is mostly hospitalization,
>>>
>>>>>> Cite?
>>>
>>>>> Yup...it's hospitalization...cause now people can actually get
>>>>> treatment
>>>>> and are not denied before they walk in the door due to "pre-existing"
>>>>> condition, lifetime (death panel) limits or lack of insurance (sorry,
>>>>> you have a bad back...no coverage for you or anyone else in your
>>>>> family).
>>>
>>>> I think we'll be seeing Verman take a page out of Thanny's book and
>>>> crawl back into the woodwork on this one.
>>>
>>> Clod corrected you. Are you going to acknowledge your error,
>>> diahhrea for brains? It's amazing that a proponent of this law, such as
>>> yourself, lacks the first clue as to its most important feature.
>>
>>
>> Kerman, are you suffering from head trauma again? Either produce the
>> cite defining "hospitalization" as a type of health insurance or shut
>> the fuck up.
>>
>
>
> LOL...I didn't correct you. I corrected Kermit....LOL...and he can't
> even get it!
>
> Holy cow. Stunned as bejesus.


He's really having some problems today. I think he may have gotten an
Easter egg stuck up his bung hole again.

Liberal $500 million tax dollar disaster

5/2/2014 4:41:00 AM

0

I've often be wary when people tell me that doing this will be far less expensive than doing that. The world isn't so illogical that it goes out of its way to make things cost more than they should. Liberals always believe that micromanaging every aspect of the human condition is "good" for them.

trotsky

5/2/2014 12:53:00 PM

0

On 5/1/14 11:41 PM, RichA wrote:
> I've often be wary


What?

suzeeq

5/2/2014 1:31:00 PM

0

trotsky wrote:
> On 5/1/14 11:41 PM, RichA wrote:
>> I've often be wary
>
>
> What?
>
Maybe 'been wary'?

trotsky

5/2/2014 1:59:00 PM

0

On 5/2/14 8:30 AM, suzeeq wrote:
> trotsky wrote:
>> On 5/1/14 11:41 PM, RichA wrote:
>>> I've often be wary
>>
>>
>> What?
>>
> Maybe 'been wary'?


Probably, but I really had no desire to read what he actually wrote
because it was trash.