ssync 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ssync/helpers.rb +13 -4
- data/lib/ssync/sync.rb +2 -2
- data/lib/ssync/version.rb +1 -1
- metadata +3 -3
data/lib/ssync/helpers.rb
CHANGED
@@ -34,20 +34,24 @@ module Ssync
|
|
34
34
|
File.exist?(path)
|
35
35
|
end
|
36
36
|
|
37
|
+
def ssync_homedir
|
38
|
+
"#{ENV['HOME']}/.ssync"
|
39
|
+
end
|
40
|
+
|
37
41
|
def ssync_filename
|
38
|
-
"
|
42
|
+
"#{read_default_config[:last_used_bucket]}"
|
39
43
|
end
|
40
44
|
|
41
45
|
def default_config_path
|
42
|
-
"#{
|
46
|
+
"#{ssync_homedir}/defaults.yml"
|
43
47
|
end
|
44
48
|
|
45
49
|
def config_path
|
46
|
-
"#{
|
50
|
+
"#{ssync_homedir}/#{ssync_filename}.yml"
|
47
51
|
end
|
48
52
|
|
49
53
|
def lock_path
|
50
|
-
"#{
|
54
|
+
"#{ssync_homedir}/#{ssync_filename}.lock"
|
51
55
|
end
|
52
56
|
|
53
57
|
def aquire_lock!
|
@@ -83,9 +87,14 @@ module Ssync
|
|
83
87
|
end
|
84
88
|
|
85
89
|
def write_default_config!(config)
|
90
|
+
create_homedir!
|
86
91
|
open(default_config_path, "w") { |f| YAML::dump(config, f) }
|
87
92
|
end
|
88
93
|
|
94
|
+
def create_homedir!
|
95
|
+
`mkdir #{ssync_homedir}` unless File.exists?(ssync_homedir)
|
96
|
+
end
|
97
|
+
|
89
98
|
def options_set?(*options)
|
90
99
|
false
|
91
100
|
[options].flatten.each do |option|
|
data/lib/ssync/sync.rb
CHANGED
@@ -45,11 +45,11 @@ module Ssync
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def last_sync_started
|
48
|
-
|
48
|
+
"#{ssync_homedir}/#{ssync_filename}.last-sync.started"
|
49
49
|
end
|
50
50
|
|
51
51
|
def last_sync_completed
|
52
|
-
|
52
|
+
"#{ssync_homedir}/#{ssync_filename}.last-sync.completed"
|
53
53
|
end
|
54
54
|
|
55
55
|
def last_sync_recorded?
|
data/lib/ssync/version.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Fred Wu
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-15 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|