gmail_todo 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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/todo +8 -0
  3. data/lib/gmail_todo.rb +28 -0
  4. metadata +47 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1804b6dcce2a0d49cbaedb427a92c248d84dfb91
4
+ data.tar.gz: 0b31b01044ff46b6524c4c08adf77af298ab3dae
5
+ SHA512:
6
+ metadata.gz: 29e0557487144dc4062949d644425518396f05460153bd19f1277554b0ea71abc0ef55149baaa2eff41db92e82958fd03f4f403cc91c7b6d8cc376a86bd44f4e
7
+ data.tar.gz: c371eaa16ac725f6dc3f5063f13e5776665d1e06b8e330988a448a8279283d4733fcc01d7a3f3a9f2502a675d58ce9094eb0ea4a8b4eee0514de3c003fe298f4
data/bin/todo ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path('../../lib/gmail_todo', __FILE__)
4
+
5
+ fork do
6
+ mailer = GmailToDo.new
7
+ mailer.send_todo ARGV[0]
8
+ end
data/lib/gmail_todo.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'gmail'
2
+
3
+ class GmailToDo
4
+
5
+ LOCAL_CREDENTIALS = ENV['HOME'] + '/.gmail_todo/credentials.yml' unless defined?(LOCAL_CREDENTIALS)
6
+ DEFAULT_CREDENTIALS = File.dirname(__FILE__) + '/credentials.yml' unless defined?(DEFAULT_CREDENTIALS)
7
+
8
+ def initialize
9
+ file = File.exists?(LOCAL_CREDENTIALS) ? LOCAL_CREDENTIALS : DEFAULT_CREDENTIALS
10
+ credentials = YAML.load(File.read(file))
11
+ @username = credentials["gmail"]["username"]
12
+ @password = credentials["gmail"]["password"]
13
+ end
14
+
15
+ def send_todo todo
16
+ gmail = Gmail.connect(@username, @password)
17
+
18
+ gmail.deliver do
19
+ to "#{@username}@gmail.com"
20
+ subject "[ToDo] #{todo}"
21
+ end
22
+
23
+ gmail.logout
24
+ end
25
+
26
+ end
27
+
28
+ gm = GmailToDo.new
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gmail_todo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Hughes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Do you use your inbox as a todo list? Quickly fire yourself a todo from
14
+ your terminal!
15
+ email: kevinhughes27@gmail.com
16
+ executables:
17
+ - todo
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/todo
22
+ - lib/gmail_todo.rb
23
+ homepage: http://rubygems.org/gems/gmail_todo
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.2.2
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Gmail ToDo gem
47
+ test_files: []