Project

General

Profile

Actions

Feature #11028

open

standalone running single file ( zipped archives of ruby code) running **without installation** using "gem install ..."

Added by zaxebo1 (zaxebo zaxebo) almost 9 years ago. Updated almost 9 years ago.

Status:
Assigned
Target version:
-
[ruby-core:<unknown>]

Description

standalone running single file ( zipped archives of ruby code) running without installation using "gem install ..."
prior examples in other languages:

python myprg.pyz
java -jar myprg.jar

Detailed Description:

In python, if i have multiple program files: "a1.py, a2.py, __main__.py,
dir1/b1.py, dir1/b2.py" and then i zip it as myprogram1.pyz
then i can run it as "python myprogram.pyz" (__main__.py inside the zip
file will be executed first). It is easy to distribute a single file
myprogram1.pyz

see: http://blogs.gnome.org/jamesh/2012/05/21/python-zip-files/


in java also we can bundle all the .class files into a single .jar file
and run it

java -jar myprogram1.jar

Currently in ruby the ".gem" file requires installation using "gem install ...". Then it gives some program file for running.
What i am asking is that some gem file should have manifest with which they can run directly without installing

That is, i request you to kind provide a feature in ruby that if i have lots of files like: a1.rb, a2.rb, __main__.rb, dir1/a4.rb etc.
(say, which uses Ruby-GTK for a Desktop application). Then i should be able to bundle them as zip file, say myprog1.zip or myprog1.pz ( rbz=ruby's zipped executable archive).
And then i can distribute this "single file" and execute it as:

ruby myprog1.rbz

This will execute the __main__.rb file among all the other .rb files,
inside this .zip archive myprog1.rbz .
Note: this .rbz file extension can be .gemz or whatever, but this functionality of "standalone running zipped archives of ruby code running without installation" is essential

Actions #1

Updated by zaxebo1 (zaxebo zaxebo) almost 9 years ago

please implement feature of - standalone running single file ( zipped archives of ruby code) running without installation using "gem install ..."

prior examples in other languages:
python myprg.pyz
java -jar myprg.jar

Detailed Description:

In python, if i have multiple program files: "a1.py, a2.py, main.py, dir1/b1.py, dir1/b2.py" and then i zip it as myprogram1.pyz
then i can run it as "python myprogram.pyz" (main.py inside the zip file will be executed first). ** It is easy to distribute a single file myprogram1.pyz, instead of many .py files **

see: http://blogs.gnome.org/jamesh/2012/05/21/python-zip-files/

in java also we can bundle all the .class files into a single .jar file and run it
java -jar myprogram1.jar

Currently in ruby the ".gem" file requires installation using "gem install ...". Then it gives some program file for running.
What i am asking is that some gem file can have a manifest with which they can run directly without installing

That is, i request you to kind provide a feature in ruby that if i have lots of files like: a1.rb , a2.rb, main.rb dir1/a4.rb etc.
(say, which uses Ruby-GTK for a Desktop application). Then i should be able to bundle them as zip file, say myprog1.zip or myprog1.pz ( rbz =ruby's zipped executable archive).
And then i can distribute this "single file" and execute it as:

ruby myprog1.rbz

This will execute the main.rb file among all the other .rb files,
inside this .zip archive myprog1.rbz .
Note: this .rbz file extension can be .gemz or whatever, but this functionality of "standalone running zipped archives of ruby code running without installation" is essential

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Description updated (diff)
  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)
  • Priority changed from 6 to Normal
Actions #3

Updated by zaxebo1 (zaxebo zaxebo) almost 9 years ago

NOTE1: On MS-Windows the zipped archive of ruby source code - can have two file extensions:

  • ".rbz" will be launched by "ruby.exe" .
    ".rbz" will be registered in MS-Windows registry as ""Ruby ZIP Applications"

  • ".rbzw" will be launched by "rubyw.exe".
    ".rbzw" will be registered in MS-Windows registry as ""Windowed Ruby ZIP Applications"

(This is in sync with python PEP proposal for .pyz and .pyzw file extensions of python)

===================

NOTE2: If we need to provide some data files along side our zipped program, in python could use the pkg_resources API, similarly a small API can given in ruby, to get datafiles/image files from the launched zipped ruby program file

Actions #4

Updated by zaxebo1 (zaxebo zaxebo) almost 9 years ago

Also note that in PHP also we can create a single file with ".phar" (.phar = PHP archive) file extension, which is compressed archive of "multiple php source code files and image/data files etc"

and then we can execute the .phar directly (without any installation) with php5-cli as
php coolapplication.phar

[[reference: http://php.net/manual/en/phar.using.intro.php]]

=====

but currently in ruby we need to "install" a given gem file (using= gem install mygemname). And also currently gem file can not be directly executed as "ruby mygem.gem"
Hence, There should be a mechanism of creating a compressed archive of 'ruby code and data/image' and executing(without any installation) that single zipped file application as "ruby a1.rbz"

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0