kindlemail 0.2.0 → 0.2.1

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.1
4
+ * Fixed bug where you needed a file name for the -s and -d flags
5
+ * Changed output of show_history
6
+
3
7
  ### 0.2.0
4
8
  * Changed email conf template to need less credentials
5
9
  * Updated to use gmail-mailer version 0.4.2
data/TODO.txt CHANGED
@@ -1,16 +1,11 @@
1
1
  Changes needed for 0.1.4
2
- - Update to use 0.2.0 of gmail-mailer
3
2
  - Fix "user configuration invalid" message to mention the user can use the -k flag
4
- - Fix issue where the -s or -d flags cannot be used without entering a filename first (bad user experience)
5
3
  - Fix email configuration file issues?
6
- - Look into issue with problems running on 1.8
7
- -- Issue with conf_templates
8
- -- Issue with -h flag
9
- - Get a virtualised ubuntu setup going to test this out
10
4
 
11
5
  Future stuff: -
12
6
  - Add flag to view default kindle address
13
7
  - Add ability to use multiple kindle addresses?
14
8
  - Add ability to add multiple attachments?
9
+ - Add ability to pass in a web URL point to a file
15
10
  - Add NOTICE regarding 3G usage (users will have to pay to use the Personal Docs Service)
16
11
  - Add ability for user to create .email_conf file and generate the values
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
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.2.0"
8
+ s.version = "0.2.1"
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-14}
12
+ s.date = %q{2011-01-15}
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}
data/lib/KindleMail.rb CHANGED
@@ -78,14 +78,10 @@ module KindleMail
78
78
  def process
79
79
  begin
80
80
  puts "\n#{VERSION_STRING}\n\n"
81
- if ARGV.empty?
82
- raise ArgumentError, "Please specify a file to send (or use the -h option to see help)"
83
- end
84
- config_manager = KindleMail::Configuration.new
85
- config_manager.configuration_setup
86
81
 
87
- mailer = KindleMailer.new(config_manager.get_email_credentials)
88
82
  datastore = KindleMailFileDatastore.new
83
+ config_manager = KindleMail::Configuration.new
84
+ config_manager.configuration_setup
89
85
 
90
86
  if(@opts[:show_history_given])
91
87
  datastore.print_history
@@ -93,12 +89,31 @@ module KindleMail
93
89
  end
94
90
 
95
91
  if(@opts[:clear_history_given])
96
- print "Clearing file history"
97
- datastore.clear_history
98
- puts "...done"
92
+ do_it = false
93
+ if(!@opts[:force_given])
94
+ print "Are you sure you wish to clear the history of files you have sent using kindlemail? [y/n]> "
95
+ response = gets.to_s.chomp
96
+ if(response.empty? or response.downcase.eql?("y") or response.downcase.eql?("yes"))
97
+ do_it = true
98
+ end
99
+ else
100
+ do_it = true
101
+ end
102
+
103
+ if(do_it)
104
+ print "Clearing file history"
105
+ datastore.clear_history
106
+ puts "...done"
107
+ end
99
108
  exit
100
109
  end
101
110
 
111
+ if ARGV.empty?
112
+ raise ArgumentError, "Please specify a file to send (or use the -h option to see help)"
113
+ end
114
+
115
+ mailer = KindleMailer.new(config_manager.get_email_credentials)
116
+
102
117
  kindle_address = ""
103
118
 
104
119
  if(!@opts[:kindle_address_given])
@@ -35,10 +35,13 @@ class KindleMailFileDatastore
35
35
 
36
36
  def print_history
37
37
  load_store
38
+ puts "*** History of files sent using kindlemail (use the -d option to clear the history) ***\n\n"
38
39
  if !@db.empty?
39
40
  @db.each { |email, val|
40
41
  puts email
42
+ puts "-"*100
41
43
  val.each { |filename,sentdate| print " => " + filename + " was sent on " + sentdate.strftime("%a %d %h %H:%M:%S") + "\n" }
44
+ puts "-"*100
42
45
  }
43
46
  else
44
47
  puts "There are no items in the history"
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.2.0"
20
+ VERSION = "0.2.1"
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
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
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-14 00:00:00 +00:00
17
+ date: 2011-01-15 00:00:00 +00:00
18
18
  default_executable: kindlemail
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency