calderin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/calderin +47 -0
- metadata +75 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c1058c91e1e2fe73067b2ff64ffec60ff124a2ac
|
4
|
+
data.tar.gz: 58b8be1cc97789f285edf068e818d0484b5beb95
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7169c860c5cd5736dfd8b7f6add34fc72c9e404ce32aea6565828952a656150c188574204d3c03d1f6d48870fbf22086607974c6c60058f388c9e76a453198e3
|
7
|
+
data.tar.gz: 380befcc6305f1672944a91ea65d24a1c03551ec0a8624ed93ba26ce91b1597a8f4ab64f9503813792bed515587a9edb33db3e411b6c23a0388aed615c25863f
|
data/bin/calderin
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'clap'
|
4
|
+
require 'toml'
|
5
|
+
require 'securerandom'
|
6
|
+
require 'rest-client'
|
7
|
+
|
8
|
+
config_file = File.join(ENV['HOME'], ".pondrc")
|
9
|
+
pond_name = nil
|
10
|
+
|
11
|
+
Clap.run ARGV,
|
12
|
+
'-c' => lambda { |param| config_file = param },
|
13
|
+
'-p' => lambda { |param| pond_name = param }
|
14
|
+
|
15
|
+
user_settings = TOML.load_file(config_file)
|
16
|
+
|
17
|
+
pond_url = if pond_name
|
18
|
+
user_settings.fetch('ponds').fetch(pond_name)
|
19
|
+
else
|
20
|
+
user_settings.fetch('ponds').first.last
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
case ARGV[0]
|
25
|
+
when 'message'
|
26
|
+
raise 'You need to specify a message recipient' unless ARGV[1]
|
27
|
+
recipient = ARGV[1]
|
28
|
+
|
29
|
+
message_file = "./.calderin_message_#{ SecureRandom.hex }"
|
30
|
+
system "#{ ENV['EDITOR'] || 'vi' } #{ message_file }"
|
31
|
+
message = File.read(message_file)
|
32
|
+
|
33
|
+
# Encrypt the file for your friend
|
34
|
+
`gpg --encrypt --armor --recipient '#{ recipient }' #{ message_file }`
|
35
|
+
File.delete(message_file)
|
36
|
+
|
37
|
+
encrypted_message = File.read(message_file + '.asc')
|
38
|
+
|
39
|
+
# Send it to the appropriate pond
|
40
|
+
RestClient.post("#{ pond_url }", encrypted_message)
|
41
|
+
File.delete(message_file + '.asc')
|
42
|
+
when 'get'
|
43
|
+
messages = JSON.parse(RestClient.get(pond_url))
|
44
|
+
|
45
|
+
messages.each do |message|
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: calderin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- PoTe
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-11-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: clap
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Calerin manages your pond's configuration options as well as serving
|
42
|
+
as a client for getting and sending your messages
|
43
|
+
email:
|
44
|
+
- pote@tardis.com.uy
|
45
|
+
executables:
|
46
|
+
- calderin
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- bin/calderin
|
51
|
+
homepage: http://github.com/pote/pond.rb
|
52
|
+
licenses:
|
53
|
+
- MIT
|
54
|
+
metadata: {}
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 2.0.3
|
72
|
+
signing_key:
|
73
|
+
specification_version: 4
|
74
|
+
summary: Client tool for the Pond project
|
75
|
+
test_files: []
|