kindlemail 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # kindlemail Changelog
2
2
 
3
+ ### 0.2.0
4
+ * Changed email conf template to need less credentials
5
+ * Updated to use gmail-mailer version 0.4.2
6
+
3
7
  ### 0.1.5
4
8
  * Reconfigured bin/ file to work properly with require_relative
5
9
  * Changed lib/KindleMail.rb to use relative filepaths
data/Gemfile CHANGED
@@ -8,6 +8,6 @@ source "http://rubygems.org"
8
8
  group :development do
9
9
  gem "bundler", "~> 1.0.0"
10
10
  gem "jeweler", "~> 1.5.2"
11
- gem "gmail-mailer", "~> 0.1.1"
11
+ gem "gmail-mailer", "= 0.4.2"
12
12
  gem "trollop", "~> 1.16.2"
13
13
  end
data/Gemfile.lock CHANGED
@@ -3,9 +3,9 @@ GEM
3
3
  specs:
4
4
  activesupport (3.0.3)
5
5
  git (1.2.5)
6
- gmail-mailer (0.1.1)
6
+ gmail-mailer (0.4.2)
7
7
  gmail_xoauth (~> 0.3.0)
8
- mail (~> 2.2.13)
8
+ mail (~> 2.2.14)
9
9
  gmail_xoauth (0.3.0)
10
10
  oauth (>= 0.3.6)
11
11
  i18n (0.5.0)
@@ -31,6 +31,6 @@ PLATFORMS
31
31
 
32
32
  DEPENDENCIES
33
33
  bundler (~> 1.0.0)
34
- gmail-mailer (~> 0.1.1)
34
+ gmail-mailer (= 0.4.2)
35
35
  jeweler (~> 1.5.2)
36
36
  trollop (~> 1.16.2)
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
20
20
  gem.email = "djharperuk@gmail.com"
21
21
  gem.authors = ["Daniel Harper"]
22
22
  gem.required_ruby_version = '>= 1.9.2'
23
- gem.add_dependency "gmail-mailer", "~> 0.1.1"
23
+ gem.add_dependency "gmail-mailer", "= 0.4.2"
24
24
  gem.add_dependency "trollop", "~> 1.16.2"
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.2.0
@@ -1,11 +1,5 @@
1
1
  # This contains the mail credentials required to send emails using your gmail account
2
- # uncomment the lines below and insert your details
3
2
  #
4
- smtp_server: smtp.gmail.com
5
- smtp_port: 587
6
- smtp_consumer_key: anonymous
7
- smtp_consumer_secret: anonymous
8
3
  smtp_oauth_token:
9
4
  smtp_oauth_token_secret:
10
- host: gmail.com
11
5
  email:
data/kindlemail.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kindlemail}
8
- s.version = "0.1.6"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Harper"]
12
- s.date = %q{2011-01-13}
12
+ s.date = %q{2011-01-14}
13
13
  s.default_executable = %q{kindlemail}
14
14
  s.description = %q{Sends documents to a designated kindle address painlessly and via the CLI. No need to fumble around with clumsy attachment boxes so forth, just whack in the documents you want to send and hit enter}
15
15
  s.email = %q{djharperuk@gmail.com}
@@ -51,24 +51,24 @@ Gem::Specification.new do |s|
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
52
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
53
53
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
54
- s.add_development_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
54
+ s.add_development_dependency(%q<gmail-mailer>, ["= 0.4.2"])
55
55
  s.add_development_dependency(%q<trollop>, ["~> 1.16.2"])
56
- s.add_runtime_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
56
+ s.add_runtime_dependency(%q<gmail-mailer>, ["= 0.4.2"])
57
57
  s.add_runtime_dependency(%q<trollop>, ["~> 1.16.2"])
58
58
  else
59
59
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
60
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
61
- s.add_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
61
+ s.add_dependency(%q<gmail-mailer>, ["= 0.4.2"])
62
62
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
63
- s.add_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
63
+ s.add_dependency(%q<gmail-mailer>, ["= 0.4.2"])
64
64
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
65
65
  end
66
66
  else
67
67
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
68
68
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
69
- s.add_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
69
+ s.add_dependency(%q<gmail-mailer>, ["= 0.4.2"])
70
70
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
71
- s.add_dependency(%q<gmail-mailer>, ["~> 0.1.1"])
71
+ s.add_dependency(%q<gmail-mailer>, ["= 0.4.2"])
72
72
  s.add_dependency(%q<trollop>, ["~> 1.16.2"])
73
73
  end
74
74
  end
data/lib/KindleMail.rb CHANGED
@@ -34,14 +34,15 @@ module KindleMail
34
34
  end
35
35
 
36
36
  def create_user_email_conf_file
37
+ puts "Creating user email conf file"
37
38
  root = File.expand_path(File.dirname(__FILE__))
38
39
  root = File.expand_path("../conf_templates", root)
39
- FileUtils.cp(File.join(root, '/.email_conf'), USER_CONF_FILE)
40
+ FileUtils.cp(File.join(root, '/.email_conf'), EMAIL_CONF_FILE)
40
41
  end
41
42
 
42
43
  def get_email_credentials
43
44
  raise ArgumentError, "Cannot find email credentials file #{EMAIL_CONF_FILE}." if !File.exists?(EMAIL_CONF_FILE)
44
- YAML.load_file(EMAIL_CONF_FILE).inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
45
+ YAML.load_file(EMAIL_CONF_FILE).inject({}){|memo,(k,v)| memo[k.to_sym] = v.to_s; memo}
45
46
  end
46
47
  end
47
48
 
data/lib/KindleMailer.rb CHANGED
@@ -15,8 +15,15 @@ class KindleMailer
15
15
 
16
16
  puts "Preparing #{File.basename(filepath)} to be sent to #{@kindle_address}"
17
17
 
18
- mailer = GmailMailer::Mailer.new(@email_credentials)
19
- mailer.sendMessage(GmailMailer::Message.new(@kindle_address, "a@b.c", filepath))
18
+ begin
19
+ message = GmailMailer::Message.new(@kindle_address)
20
+ message.add_attachment(filepath)
21
+
22
+ mailer = GmailMailer::Mailer.new(@email_credentials)
23
+ mailer.send(message)
24
+ rescue ArgumentError => error_msg
25
+ raise
26
+ end
20
27
 
21
28
  puts "#{File.basename(filepath)} was successfully sent to #{@kindle_address}"
22
29
  return true
data/lib/constants.rb CHANGED
@@ -17,7 +17,7 @@ USER_DIR = "~/.kindlemail"
17
17
  STORAGE_DIR = USER_DIR + "/.storage"
18
18
  EMAIL_CONF_FILE = File.expand_path(USER_DIR + "/.email_conf")
19
19
  USER_CONF_FILE = File.expand_path(USER_DIR + "/.kindlemail")
20
- VERSION = "0.1.6"
20
+ VERSION = "0.2.0"
21
21
  VERSION_STRING = "kindlemail #{VERSION} (January 2011). https://github.com/djhworld/kindlemail"
22
22
  FILE_STORE = File.expand_path(STORAGE_DIR + "/sent_files.history")
23
23
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 6
9
- version: 0.1.6
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Harper
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-13 00:00:00 +00:00
17
+ date: 2011-01-14 00:00:00 +00:00
18
18
  default_executable: kindlemail
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -52,13 +52,13 @@ dependencies:
52
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
- - - ~>
55
+ - - "="
56
56
  - !ruby/object:Gem::Version
57
57
  segments:
58
58
  - 0
59
- - 1
60
- - 1
61
- version: 0.1.1
59
+ - 4
60
+ - 2
61
+ version: 0.4.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: *id003
@@ -82,13 +82,13 @@ dependencies:
82
82
  requirement: &id005 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
- - - ~>
85
+ - - "="
86
86
  - !ruby/object:Gem::Version
87
87
  segments:
88
88
  - 0
89
- - 1
90
- - 1
91
- version: 0.1.1
89
+ - 4
90
+ - 2
91
+ version: 0.4.2
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: *id005