public
Description: Pack a folder (or selection) of files into a pastie; and then unpack it back into raw files
Homepage: http://drnic.github.com/pastie-packer/
Clone URL: git://github.com/drnic/pastie-packer.git
drnic (author)
Mon Apr 07 19:18:58 -0700 2008
commit  fbfe71e7eb67eaf8dce4c368f6db6c74c73e979a
tree    055e518b240f166567ca644b29c1bfb4feae6c75
parent  5e5a72209004b832ee1d39f125f6836a578c368f
pastie-packer / website / index.txt
100644 102 lines (59 sloc) 4.465 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
h1. Pastie Packer
 
h1. → 'pastiepacker'
 
<img src="images/pastiepacker pasted into own pastie.jpg" width="549" height="329" alt="Prepare to pack or unpack piles of files with pastiepacker. The easiest, best distributing, viewable archiving tool since pencil and paper.">
 
h2. What
 
A "pastie":http://pastie.caboo.se is a snippet of text/code stored on a single webpage. This makes it very easy to share the text over IM or IRC - you just copy+paste the url. As a bonus, pasties are syntax highlighted making them easier to read than if shared as plain text.
 
The *pastiepacker* is a command-line tool to "pack" a selection of files (or by default, a whole recursive folder of files) into a single pastie. So a whole/part of a project can be quickly shared.
 
It can also "unpack" a packed pastie back into files. The pastiepacker is therefore a simple, useful distributed archiving tool, using pasties for storage.
 
For example, this pastie "http://pastie.caboo.se/175886":http://pastie.caboo.se/175886 shows a selection of files packed into a pastie. It just happens to be the source for pastiepacker itself! (release 1.0.0)
 
You can pack a whole folder or a selection of files. Any README/readme.* files are placed at the front of the pastie, because that seems helpful. The packed pasties include information on how to unpack the pastie back into raw files.
 
Only ascii files are packed.
 
h2. Installing
 
<pre syntax="ruby">sudo gem install pastiepacker</pre>
 
h2. The basics: packing files into a pastie
 
To pack a folder: <code>pastiepacker</code>
 
Packing options:
 
<pre>
-f, --format=FORMAT Possess pasties with a particular persona
                          Supported formats:
                          c++, css, diff, html_rails, html,
                          javascript, php, plain_text, python,
                          ruby, ruby_on_rails, sql, shell-unix-generic
                          Default: ruby
-m, --message=MESSAGE Promotional passage for your pastie
-p, --private Posted pasties are private
                          Ignored for unpacking
-s, --stdout Prints packed pasties instead of posting
-H, --no-header Prevents placing pastiepacker promotion in pasties
                          That is, no 'about:' section is added to the top of pasties
-h, --help Show this help message.
</pre>
                                     
To only pack a selection of files ending with *txt* you can pass a list of file names via STDIN:
 
<pre> find * | grep "txt$" | pastiepacker</pre>
 
*pastiepacker* outputs the url of the prepared pastie, so you can pipe it to xargs:
 
<pre> pastiepacker | xargs open</pre>
 
If the selection of files (within the current folder or the selection of files via STDIN) contains a readme file (readme.txt, README.txt, README.markdown, etc), that file will be packed at the top of the pastie, for the convenience of readers.
 
h2. The basics: unpacking pasties into files
 
To unpack a packed pastie:
 
<pre> pastiepacker http://pastie.caboo.se/175183</pre>
 
This unpacks the files into a subfolder 175138/
 
To unpack a private pastie:
 
<pre> pastiepacker http://pastie.caboo.se/private/5hwfheniddqmyasmfcxaw</pre>
 
This unpacks the files into a subfolder 5hwfheniddqmyasmfcxaw/
 
 
h2. Forum
 
"http://groups.google.com/group/drnicutilities":http://groups.google.com/group/drnicutilities
 
h2. How to submit patches
 
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
 
The source for the Pastie Packer is "available via git":http://github.com/drnic/pastie-packer/tree/master.
 
    git clone git://github.com/drnic/pastie-packer.git pastiepacker
    cd pastiepacker
    rake install_gem
 
It is also available via rubyforge.org:
 
    git clone git://rubyforge.org/pastiepacker.git
    cd pastiepacker
    rake install_gem
 
Or, you can unpack the 1.0.0 release of the pastiepacker from its "own pastie":http://pastie.caboo.se/175886!
 
h2. License
 
This code is free to use under the terms of the MIT license.
 
h2. Contact
 
Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com via the "forum":http://groups.google.com/group/pastiepacker