Opened 11 years ago

Closed 11 years ago

#8031 closed enhancement (fixed)

[patch][ccla]Allow Shrinksafe to process stdin

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.3
Component: ShrinkSafe Version: 1.2.0
Keywords: Cc: James Burke, Richard Backhouse
Blocked By: Blocking:

Description


Attachments (2)

shrinksafe.patch (1.6 KB) - added by dante 11 years ago.
works to process stdin optionally but does not compress it, and probably in a bad spot but I don't write Java ever. Is a start.
stdin.patch (2.7 KB) - added by Adam Peller 11 years ago.
process stdin when "-" or no source files are specified on the command line. Needs review.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by Adam Peller

Owner: changed from alex to Adam Peller

comment:2 Changed 11 years ago by Adam Peller

Milestone: tbdfuture

comment:3 Changed 11 years ago by dante

+1 - this hits me frequently and would be awesome functionality to have.

comment:4 Changed 11 years ago by Adam Peller

Milestone: future1.3
Owner: changed from Adam Peller to dante

Pete said he had this working.

comment:5 Changed 11 years ago by dante

Milestone: 1.31.4
Status: newassigned

So what I have is a shell script/bat that handles stdin (data or list of files to crudely concat and shrink as one). I wasn't going to check in because frankly I don't have time to document it as a new thing in code, so punting to 1.4 where we'll have plenty of time.

Ideally, I'd like shrinksafe itself to handle this, but was only comfortable doing it in JavaScript? at the moment.

comment:6 Changed 11 years ago by dante

fyi: http://higginsforpresident.net/2009/01/reading-stdin-from-java/

ShrinkSafe? is just a single line once you have a buffer of content to compress:

var fileContents = new String(Packages.org.dojotoolkit.shrinksafe.Compressor.compressScript(content, 0, 1)),

punt back to 1.3 if you feel this is important enough. Else 1.4 is fine for me.

comment:7 Changed 11 years ago by Adam Peller

Cc: backhous@… removed
Owner: changed from dante to Richard Backhouse
Status: assignednew

cute, but I was thinking we should build it right into the Java app (jar) so you can issue a command like

myscript | java -jar shrinksafe.jar - > mini.js

I think Richard was planning to look at this.

Changed 11 years ago by dante

Attachment: shrinksafe.patch added

works to process stdin optionally but does not compress it, and probably in a bad spot but I don't write Java ever. Is a start.

Changed 11 years ago by Adam Peller

Attachment: stdin.patch added

process stdin when "-" or no source files are specified on the command line. Needs review.

comment:8 Changed 11 years ago by Adam Peller

Cc: Richard Backhouse added
Milestone: 1.41.3
Owner: changed from Richard Backhouse to Adam Peller
Status: newassigned
Summary: Allow Shrinksafe to process stdin[patch][ccla]Allow Shrinksafe to process stdin

comment:9 Changed 11 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

(In [16501]) Accept input from stdin when no files are specified. Fixes #8031

Note: See TracTickets for help on using tickets.