file-stash 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/Manifest +8 -0
- data/README.markdown +25 -0
- data/Rakefile +33 -0
- data/bin/stash +5 -0
- data/file-stash.gemspec +37 -0
- data/lib/stash.rb +75 -0
- data/man/stash +43 -0
- data/man/stash.ronn +25 -0
- data/man/stash.txt +39 -0
- metadata +117 -0
- metadata.gz.sig +1 -0
data.tar.gz.sig
ADDED
Binary file
|
data/Manifest
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
stash(1) -- UNIX File Stasher
|
2
|
+
=============================
|
3
|
+
|
4
|
+
## NAME
|
5
|
+
|
6
|
+
stash -- store unused files in a configurable location
|
7
|
+
|
8
|
+
## SYNOPSIS
|
9
|
+
|
10
|
+
`stash` [--message MSG] [--stash PATH] FILES
|
11
|
+
|
12
|
+
## DESCRIPTION
|
13
|
+
|
14
|
+
Stash gets rid of files you are no longer interested in. Pass it a list of
|
15
|
+
files and it will move them to the path specified by the `STASH_PATH`
|
16
|
+
environment variable, or `~/.stash` by default. It places the files listed in a
|
17
|
+
folder based upon the current time within the stash.
|
18
|
+
|
19
|
+
You may specify an optional message with the `-m` or `--message` parameter.
|
20
|
+
|
21
|
+
stash -m "Old css for TwitterClone" public/stylesheets/*.css cache/*.css
|
22
|
+
|
23
|
+
Those files would then be relocated to a folder named something like:
|
24
|
+
|
25
|
+
/home/alexmchale/.stash/2010-09-01T19:35:01+00:00-old.css.for.twitterclone
|
data/Rakefile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "rake"
|
3
|
+
require "echoe"
|
4
|
+
|
5
|
+
namespace :man do
|
6
|
+
Dir["man/*.ronn"].each do |ronn|
|
7
|
+
basename = File.basename(ronn, ".ronn")
|
8
|
+
roff = "man/#{basename}"
|
9
|
+
|
10
|
+
file roff => ["man", ronn] do
|
11
|
+
sh "ronn --roff --pipe #{ronn} > #{roff}"
|
12
|
+
end
|
13
|
+
|
14
|
+
file "#{roff}.txt" => roff do
|
15
|
+
sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
|
16
|
+
end
|
17
|
+
|
18
|
+
task :build => "#{roff}.txt"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Echoe.new("file-stash", "0.0.1") do |p|
|
23
|
+
|
24
|
+
p.description = "A utility to get rid of files that are no longer interesting without deleting them."
|
25
|
+
p.url = "http://github.com/alexmchale/file-stash"
|
26
|
+
p.author = "Alex McHale"
|
27
|
+
p.email = "alexmchale@gmail.com"
|
28
|
+
p.ignore_pattern = %w( tmp/* script/* )
|
29
|
+
p.runtime_dependencies = []
|
30
|
+
p.development_dependencies = [ "ronn" ]
|
31
|
+
p.require_signed = true
|
32
|
+
|
33
|
+
end
|
data/bin/stash
ADDED
data/file-stash.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{file-stash}
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Alex McHale"]
|
9
|
+
s.cert_chain = ["/home/alexmchale/.ssh/gem-public_cert.pem"]
|
10
|
+
s.date = %q{2010-09-01}
|
11
|
+
s.default_executable = %q{stash}
|
12
|
+
s.description = %q{A utility to get rid of files that are no longer interesting without deleting them.}
|
13
|
+
s.email = %q{alexmchale@gmail.com}
|
14
|
+
s.executables = ["stash"]
|
15
|
+
s.extra_rdoc_files = ["README.markdown", "bin/stash", "lib/stash.rb"]
|
16
|
+
s.files = ["Manifest", "README.markdown", "Rakefile", "bin/stash", "lib/stash.rb", "man/stash", "man/stash.ronn", "man/stash.txt", "file-stash.gemspec"]
|
17
|
+
s.homepage = %q{http://github.com/alexmchale/file-stash}
|
18
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "File-stash", "--main", "README.markdown"]
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.rubyforge_project = %q{file-stash}
|
21
|
+
s.rubygems_version = %q{1.3.7}
|
22
|
+
s.signing_key = %q{/home/alexmchale/.ssh/gem-private_key.pem}
|
23
|
+
s.summary = %q{A utility to get rid of files that are no longer interesting without deleting them.}
|
24
|
+
|
25
|
+
if s.respond_to? :specification_version then
|
26
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
27
|
+
s.specification_version = 3
|
28
|
+
|
29
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
30
|
+
s.add_development_dependency(%q<ronn>, [">= 0"])
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<ronn>, [">= 0"])
|
33
|
+
end
|
34
|
+
else
|
35
|
+
s.add_dependency(%q<ronn>, [">= 0"])
|
36
|
+
end
|
37
|
+
end
|
data/lib/stash.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "time"
|
4
|
+
require "fileutils"
|
5
|
+
require "optparse"
|
6
|
+
|
7
|
+
class Stash
|
8
|
+
|
9
|
+
def initialize(path)
|
10
|
+
@path = File.expand_path(path)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Validate all specified files.
|
14
|
+
def validate(files)
|
15
|
+
rejected_files = files.find_all { |filename| !File.exists? filename }
|
16
|
+
if rejected_files.count > 0
|
17
|
+
rejected_files.each { |filename| puts "cannot find file: #{filename}" }
|
18
|
+
raise "stash not performed"
|
19
|
+
end
|
20
|
+
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
# Perform the stash.
|
25
|
+
def stash(files, options = {})
|
26
|
+
validate files
|
27
|
+
|
28
|
+
message = options[:message].to_s.gsub(/\s/, ".").downcase.gsub(/[^a-z0-9\.]/, "")
|
29
|
+
node_note = "-#{message}" unless message.empty?
|
30
|
+
node_name = Time.now.iso8601 + node_note.to_s
|
31
|
+
node_path = File.join(@path, node_name)
|
32
|
+
|
33
|
+
FileUtils.mkdir_p node_path
|
34
|
+
|
35
|
+
ARGV.each do |src|
|
36
|
+
dst = File.join(node_path, File.basename(src))
|
37
|
+
FileUtils.mv src, dst
|
38
|
+
end
|
39
|
+
rescue Exception => e
|
40
|
+
puts e.message
|
41
|
+
end
|
42
|
+
|
43
|
+
# Run the stasher based upon command line options.
|
44
|
+
def self.stash!
|
45
|
+
opts =
|
46
|
+
OptionParser.new do |opts|
|
47
|
+
|
48
|
+
opts.banner = "Usage: stash [options] <files>"
|
49
|
+
|
50
|
+
opts.on("-m", "--message MSG", String, "Note to attach to this stash") do |msg|
|
51
|
+
ENV["STASH_MSG"] = msg
|
52
|
+
end
|
53
|
+
|
54
|
+
opts.on("-s", "--stash STASH", String, "Path to the stash to use [defaults to STASH_PATH or ~/.stash]") do |stash|
|
55
|
+
ENV["STASH_PATH"] = stash
|
56
|
+
end
|
57
|
+
|
58
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
59
|
+
puts opts
|
60
|
+
exit
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
opts.parse!
|
66
|
+
|
67
|
+
if ARGV.empty?
|
68
|
+
puts opts
|
69
|
+
exit
|
70
|
+
end
|
71
|
+
|
72
|
+
Stash.new(ENV["STASH_PATH"] || "~/.stash").stash(ARGV, :message => ENV["STASH_MSG"])
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
data/man/stash
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "STASH" "1" "September 2010" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBstash\fR \- UNIX File Stasher
|
8
|
+
.
|
9
|
+
.SH "NAME"
|
10
|
+
stash \-\- store unused files in a configurable location
|
11
|
+
.
|
12
|
+
.SH "SYNOPSIS"
|
13
|
+
\fBstash\fR [\-\-message MSG] [\-\-stash PATH] FILES
|
14
|
+
.
|
15
|
+
.SH "DESCRIPTION"
|
16
|
+
Stash gets rid of files you are no longer interested in\. Pass it a list of files and it will move them to the path specified by the \fBSTASH_PATH\fR environment variable, or \fB~/\.stash\fR by default\. It places the files listed in a folder based upon the current time within the stash\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
You may specify an optional message with the \fB\-m\fR or \fB\-\-message\fR parameter\.
|
20
|
+
.
|
21
|
+
.IP "" 4
|
22
|
+
.
|
23
|
+
.nf
|
24
|
+
|
25
|
+
stash \-m "Old css for TwitterClone" public/stylesheets/*\.css cache/*\.css
|
26
|
+
.
|
27
|
+
.fi
|
28
|
+
.
|
29
|
+
.IP "" 0
|
30
|
+
.
|
31
|
+
.P
|
32
|
+
Those files would then be relocated to a folder named something like:
|
33
|
+
.
|
34
|
+
.IP "" 4
|
35
|
+
.
|
36
|
+
.nf
|
37
|
+
|
38
|
+
/home/alexmchale/\.stash/2010\-09\-01T19:35:01+00:00\-old\.css\.for\.twitterclone
|
39
|
+
.
|
40
|
+
.fi
|
41
|
+
.
|
42
|
+
.IP "" 0
|
43
|
+
|
data/man/stash.ronn
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
stash(1) -- UNIX File Stasher
|
2
|
+
=============================
|
3
|
+
|
4
|
+
## NAME
|
5
|
+
|
6
|
+
stash -- store unused files in a configurable location
|
7
|
+
|
8
|
+
## SYNOPSIS
|
9
|
+
|
10
|
+
`stash` [--message MSG] [--stash PATH] FILES
|
11
|
+
|
12
|
+
## DESCRIPTION
|
13
|
+
|
14
|
+
Stash gets rid of files you are no longer interested in. Pass it a list of
|
15
|
+
files and it will move them to the path specified by the `STASH_PATH`
|
16
|
+
environment variable, or `~/.stash` by default. It places the files listed in a
|
17
|
+
folder based upon the current time within the stash.
|
18
|
+
|
19
|
+
You may specify an optional message with the `-m` or `--message` parameter.
|
20
|
+
|
21
|
+
stash -m "Old css for TwitterClone" public/stylesheets/*.css cache/*.css
|
22
|
+
|
23
|
+
Those files would then be relocated to a folder named something like:
|
24
|
+
|
25
|
+
/home/alexmchale/.stash/2010-09-01T19:35:01+00:00-old.css.for.twitterclone
|
data/man/stash.txt
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
STASH(1) STASH(1)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
NAME
|
6
|
+
stash - UNIX File Stasher
|
7
|
+
|
8
|
+
NAME
|
9
|
+
stash -- store unused files in a configurable location
|
10
|
+
|
11
|
+
SYNOPSIS
|
12
|
+
stash [--message MSG] [--stash PATH] FILES
|
13
|
+
|
14
|
+
DESCRIPTION
|
15
|
+
Stash gets rid of files you are no longer interested in. Pass it a list
|
16
|
+
of files and it will move them to the path specified by the STASH_PATH
|
17
|
+
environment variable, or ~/.stash by default. It places the files
|
18
|
+
listed in a folder based upon the current time within the stash.
|
19
|
+
|
20
|
+
You may specify an optional message with the -m or --message parameter.
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
stash -m "Old css for TwitterClone" public/stylesheets/*.css cache/*.css
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
Those files would then be relocated to a folder named something like:
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
/home/alexmchale/.stash/2010-09-01T19:35:01+00:00-old.css.for.twitterclone
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
September 2010 STASH(1)
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: file-stash
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: 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
32
|
+
w+yPgHA9ASVnNP8/YifMVQtRkOYvmYiK+ynLTgqn3cCod0Q4mWcZ3mTsVfAqGxAZ
|
33
|
+
fyoyfn4C+7Ks6j3k7yXzcKoAi4w0RiHYUrNQAOFzkahHaovvophs88nIgq/HNSY6
|
34
|
+
tgs+JaGdLZUsgj0TZpzELi4d6iFDD44D/pAKN8VIpSlcbyKXkIyQa/NrKOTSie7u
|
35
|
+
AH5EvwIudku4RjdH363cTYX1xZ69LjcwrUpDrCJbG9jNK8icMoAOTEw0huZYvGRC
|
36
|
+
qyGdKMrvQEbACA==
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
|
39
|
+
date: 2010-09-01 00:00:00 +00:00
|
40
|
+
default_executable:
|
41
|
+
dependencies:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: ronn
|
44
|
+
prerelease: false
|
45
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
hash: 3
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
type: :development
|
55
|
+
version_requirements: *id001
|
56
|
+
description: A utility to get rid of files that are no longer interesting without deleting them.
|
57
|
+
email: alexmchale@gmail.com
|
58
|
+
executables:
|
59
|
+
- stash
|
60
|
+
extensions: []
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
63
|
+
- README.markdown
|
64
|
+
- bin/stash
|
65
|
+
- lib/stash.rb
|
66
|
+
files:
|
67
|
+
- Manifest
|
68
|
+
- README.markdown
|
69
|
+
- Rakefile
|
70
|
+
- bin/stash
|
71
|
+
- lib/stash.rb
|
72
|
+
- man/stash
|
73
|
+
- man/stash.ronn
|
74
|
+
- man/stash.txt
|
75
|
+
- file-stash.gemspec
|
76
|
+
has_rdoc: true
|
77
|
+
homepage: http://github.com/alexmchale/file-stash
|
78
|
+
licenses: []
|
79
|
+
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options:
|
82
|
+
- --line-numbers
|
83
|
+
- --inline-source
|
84
|
+
- --title
|
85
|
+
- File-stash
|
86
|
+
- --main
|
87
|
+
- README.markdown
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 11
|
105
|
+
segments:
|
106
|
+
- 1
|
107
|
+
- 2
|
108
|
+
version: "1.2"
|
109
|
+
requirements: []
|
110
|
+
|
111
|
+
rubyforge_project: file-stash
|
112
|
+
rubygems_version: 1.3.7
|
113
|
+
signing_key:
|
114
|
+
specification_version: 3
|
115
|
+
summary: A utility to get rid of files that are no longer interesting without deleting them.
|
116
|
+
test_files: []
|
117
|
+
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
���p�-��(S^n��!�$>����vj:�u{���Ig��p��LA���D�Q!�d���U鼷���r[y�g� ���`�u�6��E|���0Y_T�>Vm�������s5�#��\dS� W�) 1���Qw������K �����Ce%aS�Dc�V���8�v �D�j�fλ��Js.�;��T 1��T�(R�&��|͒�x�I"����!9��N��6�P������]k�&df�j���g��
|