pugx / badge-poser Goto Github PK
View Code? Open in Web Editor NEWThe PHP badges, renders some badges for your readme with the packagist information.
Home Page: https://poser.pugx.org
License: MIT License
The PHP badges, renders some badges for your readme with the packagist information.
Home Page: https://poser.pugx.org
License: MIT License
For all the classes and functions should be created PHP doc.
after #94 I got an error during the deploy.
@hpatoio please have a look to this bug:
I had problem during app/console assetic:dump --env=prod
seems that YUI compressor doesn't like the js
4:56 liuggio/Projects/badge-poser (cs_fixes) $app/console assetic:dump --env=prod
Dumping all prod assets.
Debug mode is off.
15:36:05 [dir+] /home/liuggio/Projects/badge-poser/app/../web/css
15:36:05 [file+] /home/liuggio/Projects/badge-poser/app/../web/css/7dd5d02.css
15:36:07 [dir+] /home/liuggio/Projects/badge-poser/app/../web/js
15:36:07 [file+] /home/liuggio/Projects/badge-poser/app/../web/js/7866465.js
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/bin/java' '-jar' '/home/liuggio/Projects/badge-poser/app/Resources/java/yuicompressor-2.4.6.jar' '--charset' 'UTF-8' '-o' '/tmp/YUI-OUT-TkJMiu' '--type' 'js' '/tmp/YUI-IN-CyKqNw'
Error Output:
[ERROR] 24:41:missing formal parameter
[ERROR] 24:41:missing } after function body
[ERROR] 25:38:identifier is a reserved word
[ERROR] 26:15:invalid return
[ERROR] 27:5:syntax error
[ERROR] 29:44:identifier is a reserved word
[ERROR] 30:23:identifier is a reserved word
[ERROR] 31:5:syntax error
[ERROR] 90:1:syntax error
[ERROR] 1:0:Compilation produced 9 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 9 syntax errors.
at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
at org.mozilla.javascript.Parser.parse(Parser.java:392)
at org.mozilla.javascript.Parser.parse(Parser.java:337)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Input:
$(document).ready(function(){
$("#repository").select2({
placeholder: "vendor/repository",
minimumInputLength: 3,
ajax: {
url: "./search_packagist",
dataType: 'json',
data: function (term, page) {
return {
name: term
};
},
results: function (data, page) {
return {results: data};
}
},
formatResult: packageFormatResult,
formatSelection: packageFormatSelection,
dropdownCssClass: "bigdrop",
escapeMarkup: function (m) { return m; }
});
function packageFormatResult(package) {
var markup = "<dt>" + package.id + "</dt><dd>" + package.description + "</dd>";
return markup;
}
function packageFormatSelection(package) {
return package.id;
}
var lock = function(){
$('#spinningSquaresG').show();
$('.prettyprint').each(function(idx, el){
$(el).addClass('grey-text');
});
$('.spinned').each(function(idx, el){
$(el).fadeOut();
});
};
var unlock = function(){
$('#spinningSquaresG').hide();
setTimeout(function(){
$('.prettyprint').each(function(idx, el){
$(el).removeClass('grey-text');
});
$('.spinned').each(function(idx, el){
$(el).fadeIn(1500);
});
},200);
};
var generateSnippets = function(snippets_raw_data){
$.each(snippets_raw_data, function(idx, snippet){
$('#' + idx + '_markdown').html(snippet.markdown);
$('#' + idx + '_img').attr('src', snippet.img);
});
};
$('#generate').click(function(){
lock();
$.ajax({
url: $('#generate-form').attr('action'),
data: $('#generate-form').serialize(),
success: function(data){
generateSnippets(data);
unlock();
},
statusCode: {
404: function() {
alert("Repository not found!");
unlock();
},
500: function() {
alert("Repository not found!");
unlock();
}
}
});
return false;
});
});
when a new search is done, the permalink of the repository disappears.
There's a javascript at /src/PUGX/BadgeBundle/Resources/public/js/snippet.js
that replaces the content of an h2 deleting the permalink.
As subject suggests, it'd was cool if the badge would be a link directed to the pugx's page.
In this way an user interested to apply a badge for his project, could find an easy way to generate his own.
In particular, the page linked by the bedges will point to a page (in pugx.io site) with all the statistics information we have about the project but as addiction it'll be a link create you own badge
where the user can view the links for his designed project.
Showing the badges of a repository by a new search, could be made automatically without the on click action.
maybe @hpatoio could suggest a solution.
as @garak suggested,
should be great instantiate the controller as a service by passing the argument to the construct and the request in the actions.
As Sebastian himself says, the private methods have to be tested indirectly
Just use PHP ones.
in app/config/config_dev.yml, line 5
A global service has been detected in your configuration file (service
stats_persister
). You should consider storing it in a bundle configuration.
imports:
- { resource: config.yml }
services:
stats_persister:
class: PUGX\StatsBundle\Service\NullPersister
stats_reader:
class: PUGX\StatsBundle\Service\NullReader
framework:
Posted from SensioLabsInsight
What to do with all the repositories that doesn't have the stable version?
As @leopro said we could print a yellow image (instead blue)
with the latest dev version, instead of stable
the word: dev
symfony 2.3 is out who'd like to do the migration?
The badge for latest stable version is invalid.
Example: https://github.com/liip/LiipImagineBundle#liipimaginebundle ()
The badge reads v0.9.4
but the most recent stable version is v0.11.0
https://github.com/liip/LiipImagineBundle/tags.
Hello, @PUGX.
Just a suggestion: could you use version names without the prefix in order to stay closer with http://server.org http://semver.org/?
Example: 1.0.0, 1.0.0-RC etc...
What do you guys thinks?
In about 20/25 days the number of rendered badges will reach the glorious number of 10.000.000.
In order to celebrate this great number, could be great introduce some love:
objective of 2.0: Copy snippet to clipboard, better search for a package, package perma-link.
The ImageCreator should have a function the put the text in the center, and if the version is bigger, it should reduces the size
The current badges seem a little "out of place" with all the other ones. It'd be great if they were generated with Shields to unify their styles with Travis's, Gittip's and Scrutinizer's, etc. :
Could be great having a 'fancy' css effect instead a old-school alert :)
The president aka @garak MUST do something.
When the #39 will be approved,
we'll have
The questions: how, where and what shows?
Improving OOP, we could move from direct gd ext calls to avalanche123/Imagine classes.
quite big task,
I was thinking that could be great adding a sort of counter (maybe with redis) in order to store statistic on usage.
when I did the tests of the stats I noticed that when a wrong repo is requested the stats function is called.
For example during the test \PUGX\BadgeBundle\Tests\Controller\BadgeControllerTest::testIfPackageDoesntExist
the stats are called with the used wrong repo name.
Is this a desired behaviour?
BadgeController uses imagepng, but during the in functional test, it output the image on the console.
Could be great to give a little love to the UX.
We need an homepage, in the root of the website
or
or
Content of the page:
how to add to the badges in your markdown
, rst
, asciidoc
, html
...
Need to understand if some components are to keep:
Doctrine / JMSDIextra / SensioFrameworkExtra ..
The unstable version is not compatible with Git Flow, as the branch that is always displayed as unstable is dev master, but Git Flow's unstable branch is dev develop.
Is there a way to specify what the unstable version is or from which branch is the default unstable?
IPSE DIXIT: "well I guess it could benefit from a touch of JS so you can type a package name and get links ready made for your package."
the license and the (c) are with my name.
Is possible put PUGX something?
/*
* This file is part of the badge-poser package
*
* (c) Giulio De Donato <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
as @giorrrgio and @agiuliano suggested,
now that we have http-caching #18,
we should care about the Packagist Api.
I profiled the application (and the filesystem is so fast compared to the request/response).
Maybe could be great use the LiipCacheBundle in order to store the packagist request/response.
Other ideas? any other that profiled the application? anyone who wants to do this cool
task?
It'd be cool to add a badge for organizations showing the total downloads of all the mantained packages.
remove the sf favico and add a very poser
favicon
as for other our libs, I suggest using a camelcase name i.e. PUGXBadgePoser
The computation of the latest version is flawed for several reasons:
version_compare
, which will not handle dev-master
properly as being higher than other versions (so it does not match composer behavior). this is a big issue as the latest unstable version is generally the master branchshow in homepage the number of total badges rendered
could be great having on top pull-left
a counter that show the current number of total badges rendered, in redis is STAT.TOTAL
to display badges with a higher resolution with the markdown syntax is not possible since it does not allow the width,
but github also allows you to insert html on markdown, so it would be helpful to print badges with higher resolution:
with:
<img src="http://.../ExcelBundle/v/stable.png?size=double" width='100px'>
#97 doesn't allow to create fixed images
I was thinking about the routes.
I think it's better to move them into annotations in controller. This because of the facility to find the correct behaviour in the correct controller without open two files for checking it.
If you agree, I can PR this issue in a short time :)
Could be great use the packagist api in order to serve a better search using ajax.
We have to remove all test with reflection methods
in web
Posted from SensioLabsInsight
there's an error on the homepage
TypeError: e is not a function
[Break On This Error]
...options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(fu...
Instead of showing the unstable version, it would be more logical to display Stable: No release
or something like that. Giving the latest unstable version is a different info.
Would be cool to add a new badge that had something like:
composer
| phpunit/phpunit
So that the package name is also apparent and instantly viewable.
we have to think about caching the request to packagist api and limit the images generation in order to avoid to send continously request to packagist api with the same burst of data.
I think that statistic shouldn't be on the same bundle of the creation of the badge.
the sub folder here is a smelling point: PUGX/BadgeBundle/Service/Statistic
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.