syc-backup 0.0.4 → 0.0.5

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.
@@ -12,6 +12,11 @@ module Backup
12
12
  # Temporary file that holds the entries to be written to the crontab
13
13
  CRON_ENTRIES_FILE = ".cron_entries"
14
14
 
15
+ # Pre comment before the entered command
16
+ PRE_COMMENT = "#----command added by sycbackup---"
17
+ # Post comment after the entered command
18
+ POST_COMMENT = "#---------------------------------"
19
+
15
20
  # Adds a command to the user's crontab. If the provided command is empty
16
21
  # add_command will exit the application with exit status -1.
17
22
  # The method uses the <tt>crontab -l</tt> and <tt>crontab file</tt> command.
@@ -42,7 +47,9 @@ module Backup
42
47
  end
43
48
 
44
49
  unless entries.include? command
50
+ entries << PRE_COMMENT
45
51
  entries << command
52
+ entries << POST_COMMENT
46
53
 
47
54
  cron_entries_file = CRON_ENTRIES_FILE
48
55
  File.open(cron_entries_file, 'w') do |f|
@@ -93,9 +100,11 @@ module Backup
93
100
 
94
101
  entries = stdout.split(/\n/).each {|entry| entry.strip.squeeze(" ")}
95
102
 
103
+ entries.delete(PRE_COMMENT)
96
104
  entries.delete(command)
105
+ entries.delete(POST_COMMENT)
97
106
 
98
- cron_entries_file = CRON_ENTRIES_FILE #".cron_entries"
107
+ cron_entries_file = CRON_ENTRIES_FILE
99
108
 
100
109
  File.open(cron_entries_file, 'w') do |file|
101
110
  entries.each {|entry| file.puts entry}
@@ -5,5 +5,5 @@
5
5
  # per default compressed but this can be ommitted
6
6
  module Backup
7
7
  # Version of the application
8
- VERSION = '0.0.4'
8
+ VERSION = '0.0.5'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syc-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -20,13 +20,13 @@ extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
22
  - README.rdoc
23
- - syc-backup-0.0.3.gem
24
23
  - test/test_process.rb
25
24
  - test/test_mysql_backup.rb
26
25
  - test/test_options.rb
27
26
  - test/test_cron_edit.rb
28
27
  - test/test_environment.rb
29
28
  - test/test_file_backup.rb
29
+ - syc-backup-0.0.4.gem
30
30
  - sycbackup.gemspec
31
31
  - lib/backup_version.rb
32
32
  - lib/backup/file_backup.rb
@@ -88,7 +88,6 @@ files:
88
88
  - doc/TestOptions.html
89
89
  - bin/sycbackup
90
90
  - Rakefile
91
- - syc-backup-0.0.1.gem
92
91
  homepage: http://syc.dyndns.org/drupal
93
92
  licenses: []
94
93
  post_install_message:
Binary file