refs 0.0.5 → 1.0.0
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/bin/refs +5 -0
- data/lib/refs/refs.rb +11 -1
- data/lib/refs.rb +1 -1
- metadata +1 -1
data/bin/refs
CHANGED
@@ -8,6 +8,11 @@ $:.unshift lib unless $:.include?(lib)
|
|
8
8
|
|
9
9
|
require 'refs'
|
10
10
|
|
11
|
+
if ARGV.length == 0
|
12
|
+
puts "Error, no arguments. Try running with --help or -h."
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
11
16
|
opts = Trollop::options do
|
12
17
|
version "ref #{Refs::VERSION} (c) 2011 Mark Szymanski"
|
13
18
|
banner <<-EOS
|
data/lib/refs/refs.rb
CHANGED
@@ -45,6 +45,16 @@ module Refs
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.delete_ref(ref)
|
48
|
-
|
48
|
+
Dir.chdir(REF_DIR)
|
49
|
+
if File.exists?("#{ref}.md")
|
50
|
+
File.delete("#{ref}.md")
|
51
|
+
if File.exists?("#{ref}.html")
|
52
|
+
File.delete("#{ref}.html")
|
53
|
+
end
|
54
|
+
puts "Deleted #{ref}"
|
55
|
+
else
|
56
|
+
puts "Error, the reference you're trying to delete doesn't exist."
|
57
|
+
exit 1
|
58
|
+
end
|
49
59
|
end
|
50
60
|
end
|
data/lib/refs.rb
CHANGED