Git Product home page Git Product logo

melody's People

Contributors

aaa2000 avatar andreybolonin avatar arthurhlt avatar javiereguiluz avatar jderusse avatar lyrixx avatar mikesimonson avatar mykiwi avatar nfreear avatar ogizanagi avatar pborreli avatar seldaek avatar staabm avatar tgalopin avatar tomzx avatar xabbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

melody's Issues

Composer Options

As I read PR #24 it came into my mind, that it might also be a good thing, if one could define composer-options..?

Unable to redirect nor pipe output

Hi !

Given this very simple witness script:

<?php

<<<CONFIG
packages:
    - "php"
CONFIG;

echo 'Hello World'.PHP_EOL;

I'm unable to redirect the output to a file using standard or error output redirection:

$ melody run hello_world.php > hello.txt
# hello.txt remains empty

Here is the strace output captured by @lyrixx that might help, showing it seems to be properly output on FD1:

16787 write(1, "/tmp/melody/aefded2aec05bb759178"..., 131) = 131
16787 write(1, "\n", 1)                 = 1
16787 lstat("/tmp/melody/aefded2aec05bb75917826c8787c3c6c24a4ff56cc67f6b6522fe8105cf4bc2c5/vendor/symfony/finder/Comparator/DateComparator.php", {st_mode=S_IFREG|0644, st_size=1465, ...}) = 0
16787 stat("/tmp/melody/aefded2aec05bb75917826c8787c3c6c24a4ff56cc67f6b6522fe8105cf4bc2c5/vendor/symfony/finder/Comparator/DateComparator.php", {st_mode=S_IFREG|0644, st_size=1465, ...}) = 0
16787 write(1, "/tmp/melody/aefded2aec05bb759178"..., 129) = 129
16787 write(1, "\n", 1)                 = 1

Any hint ?

ping @smaftoul, if by chance you have any idea.

Sample of use case

@jeremy-derusse and I have created few useful gist (private and / or public use).

I think it could be useful to have a place in the documentation to "link" theses gist.

What do you think?

Discontinued?

Hello, this is such a good idea! Is there a reason why this project got discontinued?

support composer like notations

atm one needs to write

<<<CONFIG
packages:
    - "codeguy/arachnid: 1.*"
CONFIG;

for melody to get it working.

More composer like would be something like

<<<CONFIG
packages:
    - "codeguy/arachnid": "1.*"
CONFIG;

as this is 1:1 the notation composer uses on CLI. this might semantically not be the JSON one would expect, but syntax wise it would be great, as you can pickup the lines from the composer.json

related to #75

Authenticate melody to github to skip rate limit

When downloading a gist, we may have a failure

[InvalidArgumentException]                                                                                                                                                                                  
  There is an issue with your gist URL: API rate limit exceeded for W.X.Y.Z. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)  

We could take the composer's one ~/.composer/auth.json or asking the user to create ours auth.json.

[new-feature] Ask for confirmation before running code

Hi,
I think melody should ask before running code loaded from the outside and wild world, the Internet.

The main reason for this is that melody allows you to pass in an url, a username/gistID, or just the gistID.
It's not hard to type in "http://gist.github.com/gistID", but it would be even better if melody could show up useful informations before running it, like owner name, creation date, revisions count, last revision date ... And a direct link to the gist.

Still, some might wan't to run it without interaction, so it might be useful to add a --no-interaction flag

Thanks in advance (I'll try to do it, but can't promise anything ... and don't know how to test it)

Improve self-update command

  • Check if we have the permission to do it
  • Avoid to download the file twice (file_get_contents + copy)
  • Allow the replacement of the file without sudo (if we have the W permission in the file but not on the folder)

Add support for accessing Gists from behind a HTTP proxy

Hi,

I'm loving Melody! I've noticed however, that I can't get at a Gists from behind my organization's proxy server...

Patch/ suggestions to follow.

Thank you,

Nick


Gist "..." not found:

$ melody.phar -vvv run https://gist.github.com/nfreear/5a870499717f18babbd6  -- -pLACE -l"sprint 4"

  [InvalidArgumentException]
  Gist "5a870499717f18babbd6" not found

Exception trace:
 () at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Handler/Github/Gist.php:66
 SensioLabs\Melody\Handler\Github\Gist->download() at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Handler/Github/Gist.php:38
 SensioLabs\Melody\Handler\Github\Gist->get() at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Handler/GistHandler.php:30
 SensioLabs\Melody\Handler\GistHandler->createResource() at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Melody.php:82
 SensioLabs\Melody\Melody->createResource() at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Melody.php:50
 SensioLabs\Melody\Melody->run() at phar://C:/Users/ndf42/workspace/melody.phar/src/SensioLabs/Melody/Console/Command/RunCommand.php:87
 SensioLabs\Melody\Console\Command\RunCommand->execute() at phar://C:/Users/ndf42/workspace/melody.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at phar://C:/Users/ndf42/workspace/melody.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/Users/ndf42/workspace/melody.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar://C:/Users/ndf42/workspace/melody.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar://C:/Users/ndf42/workspace/melody.phar/bin/melody:19
 require() at ... \workspace\melody.phar:10

My proxy configuration:

$ echo $HTTP_PROXY
wwwcache.open.ac.uk:80

.bashrc:

# ~/.bashrc
export HTTP_PROXY=wwwcache.open.ac.uk:80
export HTTPS_PROXY=wwwcache.open.ac.uk:80
export https_proxy=wwwcache.open.ac.uk:80

Wrong exit code

Melody exit with code 0 even if the script exit with a failure.
We should exit the melody's process with the same code than the runned script.

Cannot get command line option -h

I wrote this simple php script :

<?php
<<<CONFIG
packages:
    - "symfony/finder: ~2.5"
CONFIG;

$options = getopt('h');
var_export($options);

run with php test.php -h can output option h:

$ php test.php -h 
array(
  'h' => false
)

Expect melody run test.php -- -h same output, which is not. It output melody run help.

tag a release

would be great if you could tag a release.

atm my tooling based on melody is really unstable because of some BC changes happing from time to time :-/

shebang displayed

I was playing with the shebang to try to not do melody run ... each times.

$ cat foo.php

#!/usr/bin/env -S melody run -vvv
<?php

<<<CONFIG
packages:
    - "symfony/var-dumper: ^4"
CONFIG;

dump('Hello world');
$ ./foo.php
  RUN  '/usr/local/bin/composer' 'update' '--prefer-dist'
  ERR  Loading composer repositories with package information
  ERR  Updating dependencies (including require-dev)
  ERR  Package operations: 3 installs, 0 updates, 0 removals
  ERR    - Installing symfony/polyfill-php72 (v1.11.0): Loading from cache
  ERR    - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
  ERR    - Installing symfony/var-dumper (v4.2.7): Loading from cache
  ERR  symfony/var-dumper suggests installing symfony/console (To use the ServerDumpCommand and/or the bin/var-dump-server script)
  ERR  Writing lock file
  ERR  Generating autoload files
  ERR  
  RES  Command ran successfully
#!/usr/bin/env -S melody run -vvv
"Hello world"

$ php foo.php 
PHP Fatal error:  Uncaught Error: Call to undefined function dump() in /somewhere/foo.php:9
Stack trace:
#0 {main}
  thrown in /somewhere/foo.php on line 9

But the shebang is in the output ๐Ÿค”
Do you think it would be possible to hide it if we adapt melody ?

Support declare(strict_types=1)

When I start a file with:

<?php

declare(strict_types=1);

<<<CONFIG
packages:
    - .....
CONFIG;

Then I get the following error in console (after melody run)

In ResourceParser.php line 23:

  Impossible to parse the content of the document.

  The php script should look like:

  <?php
  <<<CONFIG
  packages:
      - "symfony/finder: ~2.5"
  CONFIG;

  $finder = Symfony\Component\Finder\Finder::create();
run [--no-cache] [--prefer-source] [-t|--trust] [--] <script> [<arguments>]...

https://gist.github.com/pimolo/d06bb4d2e803369a66758095c007f2d1 can be used in order to reproduce.

Allow additional data to be stored per melody script run

I would like to store some temporary files which are required run melody-scripts from within another app (php-console).

If I could add somehow files to the melody's working-dir those were automatically cleaned up by the melody garbage collector, which would be highly usefull in my case. otherwise i need to create another garbage collector for my "own" temp files.

Would you consider this something in scope of melody?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.