argosnap 0.0.4 → 0.0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7a15c8ff5820ce085fbe1a69147fe44e2516f31
4
- data.tar.gz: b24ede47dff5a3e52e9db0bf3be9799f25728920
3
+ metadata.gz: 696e301ac27f9dd17331161df5c31f302b8163cf
4
+ data.tar.gz: f576bb88e66428e2babf57b751ca27c421205170
5
5
  SHA512:
6
- metadata.gz: 9e3c652266467c06d5234fc673e16aa433ae80b175d80b1ce19e7522a9ffaef84820ac22a48ecbd67ad1e1a6e6ac34999a6918be850c3bb8a589d9fe3832ee02
7
- data.tar.gz: 2946547f4570be8b426b71ddb2dd4c6233bf47aa08bdedccc4f8acc0f2561c2bb44539806d5ae46b4d959869e24a5b7fbb457630c5eb2af40a39a3769a78465f
6
+ metadata.gz: a680ac6a16e91ad24491683d552abdc8a06d567327581feba679e52dc395c32bfaff54e065cd8a8781483486f3e2ac93f5a22760abaed9f16b542678bb14d2c6
7
+ data.tar.gz: fec5b2bf62572f0c6b67822b0788682378d0e4eac6f4704d6cc21927d892cf7cc09a539caa3accba562856c904a8f805fbaadc8d28dd104e79425a5ea40678e0
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Panagiotis Atmatzidis
1
+ Copyright (c) 2015 Panagiotis Atmatzidis
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,53 +1,59 @@
1
1
  # Argosnap
2
-
3
- This gem allows you to displays your current amount of picodollars along with [OSX notifications](http://support.apple.com/kb/ht5362) when your [tarsnap account](http://www.tarsnap.com/) falls bellow a predefined threshold of [picodollars](http://www.tarsnap.com/picoUSD-why.html).
2
+ Argosnap is a ruby script that displays your current [tarsnap](http://www.tarsnap.com/) ballance in [picoUSD](http://www.tarsnap.com/picoUSD-why.html). The script can send notifications when the account balance falls below the predefined threshold. Argosnap supports email, [pushover](https://pushover.net/) and [OSX notifications](https://support.apple.com/en-us/HT204079).
4
3
 
5
4
  # Installation
6
5
 
7
- Install the gem via rubygems:
6
+ ## Linux, *BSD and MacOSX
7
+ In order to run `argosnap` you need only the [mechanize](https://github.com/sparklemotion/mechanize) gem. If you want to use receive [HTML](https://en.wikipedia.org/wiki/HTML) email notifications you are going to need the `haml` as well and `mail` gem. In case you want TXT email, you are going to need only the `mail` gem.
8
+
9
+ Install the gems via rubygems:
10
+
11
+ $ gem install mail mechanize haml argosnap
8
12
 
9
- $ gem install argosnap plist mechanize terminal-notifier
13
+ ## MacOSX Launchd
14
+ If you want to use OSX notifications, you need to instal `plist` and `terminal-notifier` too. To install the gems type:
15
+
16
+ $ gem install mail mechanize haml plist terminal-notifier argosnap
17
+
18
+ # Settings
10
19
 
11
- # Configure
20
+ ## General Setup
12
21
 
13
- Run the following command for the script to create a configuration file like:
22
+ After successful installation, run the following command:
14
23
 
15
24
  $ argosnap -i config
16
25
 
17
- You'll see the location of the newly created configuration file on your terminal. Then you need to configure the `config.yml` file which looks like this:
26
+ Argosnap will create a configuration file. You need to adjust the settings accordingly. The configuration `$HOME/.argosnap/config.yml` looks like this:
18
27
 
19
28
  ---
20
- :email: sample@email.com
21
- :password: p4sw0rd3
29
+ :email: tarsnap_email@domain.net
30
+ :password: tarsnap_password
22
31
  :threshold: 10
23
- :seconds: 7200
24
-
25
- Just put your tarsnap login credentials. You can omit the other two variables if you are not using an OSX system. To view your account use the command:
26
-
27
- $ argosnap -p
28
-
29
-
30
- # Configure Launchd under MacOSX
31
-
32
- In the `config.yml` adjust the `threshold` and `seconds` options as you see fit. Threshold is the amount of *picodollars* bellow which you'd like to start seeing notifications and the `seconds` consists of the time window. Then type:
33
-
34
- $ argosnap -i cron
35
-
36
- Now just start the installed `.plist` file following instruction you'll see on the screen and you're done.
37
-
38
- # Options
39
-
40
- To run an osx notification use the command:
41
-
42
- $ argosnap -p osx
43
- Current balance (picodollars): 4.8812
44
-
45
- To get the amount of picodollars as an integer type:
46
-
47
- $ argosnap -p clean
48
- 4.8812
49
-
50
- That's all :-)
32
+ :seconds: 86400
33
+ :notifications_osx: false
34
+ :notifications_email: true
35
+ :smtp:
36
+ :email_delivery_method: smtp
37
+ :smtpd_user: my_smtp_user
38
+ :smtpd_password: my_smtp_password
39
+ :smtpd_address: smtp.domain.net
40
+ :smtpd_port: 465
41
+ :smtpd_from: no-reply@domain.net
42
+ :smtpd_to: user@domain.net
43
+ :format: txt
44
+ :notifications_pushover: false
45
+ :pushover:
46
+ :key: <my-hash-key>
47
+ :token: <app-token-key>
48
+
49
+ You need to enable the notifications you are going to use. For example is you plan to use email notifications, you must enable them in your config like `notifications_email: true` and adjust the SMTPd settings accordingly.
50
+
51
+ For more detailed info read [notifications](https://github.com/atmosx/argosnap/wiki/notifications).
52
+
53
+
54
+ # License
55
+
56
+ MIT, see [License.txt](https://github.com/atmosx/argosnap/blob/master/LICENSE.txt) for details.
51
57
 
52
58
  # Contributing
53
59
 
data/argosnap.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Argosnap::VERSION
9
9
  spec.authors = ["Panagiotis Atmatzidis"]
10
10
  spec.email = ["atma@convalesco.org"]
11
- spec.summary = %q{Read your tarsnap picoUSD amount in cli and display notifications when it runs out!.}
12
- spec.description = %q{A ruby script that displays tarsnap current ballance in picoUSD. The script can send notifications when the acount balance falls below the predefined threshold. Argosnap supports email, pushover and OSX notifications.}
11
+ spec.summary = %q{Command line utility that displays your current tarsnap picoUSD amount.}
12
+ spec.description = %q{A ruby script that displays your current tarsnap ballance in picoUSD. The script can send notifications when the account balance falls below the predefined threshold. Argosnap supports email, pushover and OSX notifications.}
13
13
  spec.homepage = "https://github.com/atmosx/argosnap"
14
14
  spec.license = "MIT"
15
15
 
data/bin/argosnap CHANGED
@@ -9,24 +9,19 @@ opt_parser = OptionParser.new do |opt|
9
9
  opt.separator ""
10
10
  opt.separator " -v: dislay version"
11
11
  opt.separator " -i config: install configuration files"
12
- opt.separator " -i cron: display sample cron entry"
13
12
  opt.separator " -i plist: install plist file for OSX"
14
13
  opt.separator " -p: prints the current amount in picoUSD"
15
14
  opt.separator " -p clean: prints only the picollars (float rounded in 4 decimals), to use in cli"
16
15
  opt.separator " -n mail: send notification via email"
17
16
  opt.separator " -n pushover: send notification via pushover"
18
17
  opt.separator " -n osx: display osx notification"
19
- opt.separator " -n all: send notifications everywhere"
18
+ opt.separator " -n notify: send notifications everywhere"
20
19
  opt.separator ""
21
20
 
22
21
  opt.on("-v","--version","display version") do |version|
23
22
  options[:version] = version
24
23
  end
25
24
 
26
- opt.on("-c","--cron","run notifications - to use with cron") do |version|
27
- options[:cron] = cron
28
- end
29
-
30
25
  opt.on("-i","--install [OPTION]", "install configuration files") do |install|
31
26
  options[:install] = install || 'config'
32
27
  end
@@ -53,8 +48,6 @@ begin
53
48
  elsif options[:install]
54
49
  if options[:install] == 'config'
55
50
  Argosnap::Install.new.install
56
- elsif options[:install] == 'cron'
57
- Argosnap::Install.new.cron_entry
58
51
  elsif options[:install] == 'plist'
59
52
  Argosnap::Helpers.new.install_plist
60
53
  end
@@ -67,7 +60,7 @@ begin
67
60
  Argosnap::Notifications.new.send_osx_notification
68
61
  elsif options[:notification] == 'osx_check'
69
62
  Argosnap::Notifications.new.osx_check
70
- elsif options[:notification] == 'all'
63
+ elsif options[:notification] == 'notify'
71
64
  Argosnap::Notifications.new.notify
72
65
  else
73
66
  puts "You need to need to speficy notification option: 'mail' or 'pushover'"
@@ -23,7 +23,7 @@ module Argosnap
23
23
  notifications_osx: false,
24
24
  notifications_email: false,
25
25
  smtp: {
26
- email_delivery_method: 'smtp',
26
+ email_delivery_method: 'sendmail',
27
27
  smtpd_user: 'username',
28
28
  smtpd_password: 'password',
29
29
  smtpd_address: "gmail.google.com",
@@ -1,3 +1,3 @@
1
1
  module Argosnap
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argosnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Panagiotis Atmatzidis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,8 +38,8 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: A ruby script that displays tarsnap current ballance in picoUSD. The
42
- script can send notifications when the acount balance falls below the predefined
41
+ description: A ruby script that displays your current tarsnap ballance in picoUSD.
42
+ The script can send notifications when the account balance falls below the predefined
43
43
  threshold. Argosnap supports email, pushover and OSX notifications.
44
44
  email:
45
45
  - atma@convalesco.org
@@ -94,8 +94,7 @@ rubyforge_project:
94
94
  rubygems_version: 2.4.8
95
95
  signing_key:
96
96
  specification_version: 4
97
- summary: Read your tarsnap picoUSD amount in cli and display notifications when it
98
- runs out!.
97
+ summary: Command line utility that displays your current tarsnap picoUSD amount.
99
98
  test_files:
100
99
  - test/lib/argosnap/options_test.rb
101
100
  - test/lib/argosnap/version_test.rb