tactless 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/bin/tactless +42 -0
- data/lib/tactless.rb +5 -0
- data/lib/tactless/version.rb +3 -0
- metadata +50 -0
data/bin/tactless
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim: set ft=ruby
|
3
|
+
|
4
|
+
require "yaml"
|
5
|
+
|
6
|
+
TACTLESS_HOME = File.join ENV["HOME"], ".tactless"
|
7
|
+
DB_FILE = File.join TACTLESS_HOME, "db.yml"
|
8
|
+
NEW_CONTACT_FILE = File.join TACTLESS_HOME, "NEW_CONTACT.yml"
|
9
|
+
NEW_CONTACT_TEMPLATE_FILE = File.join TACTLESS_HOME, "CONTACT_TEMPLATE"
|
10
|
+
|
11
|
+
|
12
|
+
Dir.mkdir TACTLESS_HOME unless File.exists? TACTLESS_HOME
|
13
|
+
File.write DB_FILE, "" unless File.exists? DB_FILE
|
14
|
+
NEW_CONTACT_TEMPLATE = if File.exists? NEW_CONTACT_TEMPLATE_FILE
|
15
|
+
File.read NEW_CONTACT_TEMPLATE_FILE
|
16
|
+
else
|
17
|
+
""
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
case ARGV.shift
|
23
|
+
when "mutt"
|
24
|
+
db = YAML.load_file DB_FILE
|
25
|
+
found = nil
|
26
|
+
db["contacts"].each do |c|
|
27
|
+
found = c and break if Array(c["aliases"]).include?(ARGV.first)
|
28
|
+
end
|
29
|
+
|
30
|
+
puts "\n#{found["email"]}\t#{found["name"]}\t#{found["tags"]*","}\n" if found
|
31
|
+
when "add"
|
32
|
+
File.write NEW_CONTACT_FILE, NEW_CONTACT_TEMPLATE
|
33
|
+
system "vim -f #{NEW_CONTACT_FILE}"
|
34
|
+
new_contact = YAML.load_file NEW_CONTACT_FILE
|
35
|
+
db = YAML.load_file DB_FILE rescue {}
|
36
|
+
(db["contacts"] ||= []) << new_contact
|
37
|
+
File.write DB_FILE, YAML.dump(db)
|
38
|
+
when "browse"
|
39
|
+
system "vim -f #{DB_FILE}"
|
40
|
+
else
|
41
|
+
puts "No command #{ARGV.first} found."
|
42
|
+
end
|
data/lib/tactless.rb
ADDED
metadata
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tactless
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Steven! Ragnarök
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-04 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Manage your contacts without regard to vCard.
|
15
|
+
email:
|
16
|
+
- steven@nuclearsandwich.com
|
17
|
+
executables:
|
18
|
+
- tactless
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- lib/tactless/version.rb
|
23
|
+
- lib/tactless.rb
|
24
|
+
- bin/tactless
|
25
|
+
homepage: ''
|
26
|
+
licenses: []
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
33
|
+
requirements:
|
34
|
+
- - ! '>='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 1.8.23
|
46
|
+
signing_key:
|
47
|
+
specification_version: 3
|
48
|
+
summary: Command-line tool for managing contacts.
|
49
|
+
test_files: []
|
50
|
+
has_rdoc:
|