cloud_encrypted_sync 0.3.2 → 0.3.3

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloud_encrypted_sync (0.3.1)
4
+ cloud_encrypted_sync (0.3.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -3,7 +3,7 @@ module CloudEncryptedSync
3
3
 
4
4
  class << self
5
5
 
6
- attr_reader :option_parser
6
+ attr_reader :option_parser, :cached_argv
7
7
 
8
8
  def settings
9
9
  @settings ||= load
@@ -13,12 +13,17 @@ module CloudEncryptedSync
13
13
  command_line_options[:data_dir]
14
14
  end
15
15
 
16
+ def signature
17
+ Cryptographer.hash_data(cached_argv.to_s + config_file_settings.to_s)
18
+ end
19
+
16
20
  #######
17
21
  private
18
22
  #######
19
23
 
20
24
  def load
21
25
  touch_data_folder
26
+ cache_argv
22
27
  loaded_settings = config_file_settings.merge(command_line_options).with_indifferent_access
23
28
 
24
29
  loaded_settings[:sync_path] = ARGV.shift unless ARGV.empty?
@@ -28,6 +33,14 @@ module CloudEncryptedSync
28
33
  return loaded_settings
29
34
  end
30
35
 
36
+ def touch_data_folder
37
+ FileUtils.mkdir_p(data_folder_path) unless Dir.exists?(data_folder_path)
38
+ end
39
+
40
+ def cache_argv
41
+ @cached_argv ||= ARGV.dup
42
+ end
43
+
31
44
  def config_file_settings
32
45
  @config_file_settings ||= load_config_file_settings
33
46
  end
@@ -50,10 +63,6 @@ module CloudEncryptedSync
50
63
  end
51
64
  end
52
65
 
53
- def touch_data_folder
54
- FileUtils.mkdir_p(data_folder_path) unless Dir.exists?(data_folder_path)
55
- end
56
-
57
66
  def config_file_path
58
67
  data_folder_path+'/config.rc.yml'
59
68
  end
@@ -59,7 +59,7 @@ module CloudEncryptedSync
59
59
  end
60
60
 
61
61
  def index_filename
62
- "#{normalized_sync_path.gsub(/[^A-Za-z0-9]/,'_')}.index.yml"
62
+ "#{Configuration.signature}.index.yml"
63
63
  end
64
64
 
65
65
  def relative_file_path(full_path)
@@ -1,3 +1,3 @@
1
1
  module CloudEncryptedSync
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_encrypted_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: