lookfile 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +3 -0
- data/LICENSE +18 -17
- data/bin/lookfile +0 -1
- data/lib/command.rb +7 -3
- data/lib/commands/look.rb +9 -1
- data/lib/commands/restore.rb +1 -1
- data/lib/commands/set_repository.rb +6 -2
- data/lib/lookfile/version.rb +1 -1
- data/lookfile.1 +49 -0
- data/lookfile.gemspec +3 -2
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce9191567c230128333e294860e28e5ac8a3bd84
|
4
|
+
data.tar.gz: c0ed5b2d5f54bb581a0279f83d81272922be5e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250c2bfb54cb3c54ef387de079e6e27c0cac068654751309b55810a047c52defac37b634bac54f4582a5cc49146fc12de26592632ce9ec21b779f2128691380c
|
7
|
+
data.tar.gz: 28eb3c258ee06b8a4f61d93a31ce811f45add4bf4ca7d727ecb4ac1aed538adac21cfe4e829fe4343016035e1f4f014656b0880722e037ea4c9bde617852f966
|
data/ChangeLog
ADDED
data/LICENSE
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
|
1
|
+
Copyright © Luciano Prestes
|
2
2
|
|
3
|
-
|
3
|
+
Expat (aka MIT) License
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
of this software and associated documentation files (the
|
7
|
-
in the Software without restriction, including
|
8
|
-
to use, copy, modify, merge, publish,
|
9
|
-
copies of the Software, and to
|
10
|
-
furnished to do so, subject to
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
11
12
|
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
copies or substantial portions of the Software.
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
14
15
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
SOFTWARE.
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bin/lookfile
CHANGED
data/lib/command.rb
CHANGED
@@ -13,17 +13,21 @@ class Command
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.parent
|
16
|
-
|
16
|
+
nil
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.childrens
|
20
|
-
|
20
|
+
[]
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.childrens?
|
24
24
|
!childrens.empty?
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.usage_bottom
|
28
|
+
''
|
29
|
+
end
|
30
|
+
|
27
31
|
def self.run_childrens(argv)
|
28
32
|
children_command = argv.first
|
29
33
|
children = childrens.detect { |c| c.command_name == children_command }
|
@@ -46,7 +50,7 @@ class Command
|
|
46
50
|
end
|
47
51
|
end
|
48
52
|
|
49
|
-
puts usage_message
|
53
|
+
puts usage_message + "\n#{usage_bottom}"
|
50
54
|
end
|
51
55
|
|
52
56
|
def self.usage_header
|
data/lib/commands/look.rb
CHANGED
@@ -10,7 +10,15 @@ require 'commands/restore'
|
|
10
10
|
# Command 'lookfile' implementation
|
11
11
|
class Look < Command
|
12
12
|
def self.options_messages
|
13
|
-
''
|
13
|
+
'asdsad'
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.usage_bottom
|
17
|
+
user_name = File.expand_path('~').scan(%r{/home/(.+)+}).flatten.first
|
18
|
+
%( Attention: \t To push files every five minutes copy add the following
|
19
|
+
\t\t line on /etc/crontab:
|
20
|
+
\t\t */5 * * * * #{user_name} lookfile push
|
21
|
+
)
|
14
22
|
end
|
15
23
|
|
16
24
|
def self.command_name
|
data/lib/commands/restore.rb
CHANGED
@@ -23,7 +23,7 @@ class Restore < Command
|
|
23
23
|
files_path = []
|
24
24
|
Lookfile.list_files.each do |file_path|
|
25
25
|
print "Restore file #{file_path} (Y/n): "
|
26
|
-
option = gets.chomp.upcase
|
26
|
+
option = $stdin.gets.chomp.upcase
|
27
27
|
option = 'Y' if option.empty?
|
28
28
|
files_path << file_path if option == 'Y'
|
29
29
|
end
|
@@ -22,7 +22,11 @@ class SetRepository < Command
|
|
22
22
|
|
23
23
|
def self.run(argv)
|
24
24
|
repository_ssh_name = argv.first
|
25
|
-
|
26
|
-
|
25
|
+
if !repository_ssh_name.nil? && !repository_ssh_name.strip.empty?
|
26
|
+
Lookfile.set_repository(repository_ssh_name)
|
27
|
+
puts "Setted repository to: #{repository_ssh_name}"
|
28
|
+
else
|
29
|
+
puts " Usage:\n\n#{options_messages}"
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
data/lib/lookfile/version.rb
CHANGED
data/lookfile.1
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4.
|
2
|
+
.TH USAGE: "1" "June 2016" "Usage: lookfile [option]" "User Commands"
|
3
|
+
.SH NAME
|
4
|
+
Lookfile - File versioning to save all files that you need a backup
|
5
|
+
.SH DESCRIPTION
|
6
|
+
$ lookfile [option]
|
7
|
+
.PP
|
8
|
+
[options]
|
9
|
+
.TP
|
10
|
+
init $ lookfile init
|
11
|
+
.IP
|
12
|
+
\- Initialize lookfile configurations
|
13
|
+
.TP
|
14
|
+
add $ lookfile add [file 0] [file 1] ... [file n]
|
15
|
+
.IP
|
16
|
+
\- Add files to lookfile
|
17
|
+
.TP
|
18
|
+
push $ lookfile push
|
19
|
+
.IP
|
20
|
+
\- Commit files on lookfile and push to repository
|
21
|
+
.TP
|
22
|
+
status $ lookfile status
|
23
|
+
.IP
|
24
|
+
\- Show status of files on lookfile
|
25
|
+
.TP
|
26
|
+
show $ lookfile show
|
27
|
+
.IP
|
28
|
+
\- Show all files that are on lookfile
|
29
|
+
.TP
|
30
|
+
restore $ lookfile restore
|
31
|
+
.IP
|
32
|
+
\- Restore files from lookfile to user pc
|
33
|
+
.TP
|
34
|
+
setrepo $ lookfile setrepo [repository_ssh]
|
35
|
+
.IP
|
36
|
+
\- Set lookfile repository to save files
|
37
|
+
.IP
|
38
|
+
\- repository_ssh: link ssh to repository
|
39
|
+
.TP
|
40
|
+
Attention: To push files every five minutes copy add the following
|
41
|
+
.IP
|
42
|
+
line on /etc/crontab:
|
43
|
+
.IP
|
44
|
+
*/5 * * * * luciano lookfile push
|
45
|
+
.SH "SEE ALSO"
|
46
|
+
The full documentation for
|
47
|
+
.B Lookfile
|
48
|
+
.TP
|
49
|
+
https://github.com/LucianoPC/lookfile
|
data/lookfile.gemspec
CHANGED
@@ -9,7 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['Luciano Prestes Cavalcanti']
|
10
10
|
spec.email = ['lucianopcbr@gmail.com']
|
11
11
|
|
12
|
-
spec.summary = '
|
12
|
+
spec.summary = 'File versioning to save all files that you need a ' \
|
13
|
+
'backup'
|
13
14
|
spec.description = 'Version files usage on day-to-day can be cansative ' \
|
14
15
|
'and exaustive, mainly because that files are on ' \
|
15
16
|
"diferent folders, and group there it's a hard work " \
|
@@ -19,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
19
20
|
'repository, and version all these files with a ' \
|
20
21
|
'single command.'
|
21
22
|
spec.homepage = 'https://github.com/LucianoPC/lookfile'
|
22
|
-
spec.license = '
|
23
|
+
spec.license = 'Expat'
|
23
24
|
|
24
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
26
|
f.match(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lookfile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- ".rspec"
|
69
69
|
- ".travis.yml"
|
70
70
|
- CODE_OF_CONDUCT.md
|
71
|
+
- ChangeLog
|
71
72
|
- Gemfile
|
72
73
|
- LICENSE
|
73
74
|
- README.md
|
@@ -87,10 +88,11 @@ files:
|
|
87
88
|
- lib/git.rb
|
88
89
|
- lib/lookfile.rb
|
89
90
|
- lib/lookfile/version.rb
|
91
|
+
- lookfile.1
|
90
92
|
- lookfile.gemspec
|
91
93
|
homepage: https://github.com/LucianoPC/lookfile
|
92
94
|
licenses:
|
93
|
-
-
|
95
|
+
- Expat
|
94
96
|
metadata: {}
|
95
97
|
post_install_message:
|
96
98
|
rdoc_options: []
|
@@ -111,5 +113,5 @@ rubyforge_project:
|
|
111
113
|
rubygems_version: 2.5.1
|
112
114
|
signing_key:
|
113
115
|
specification_version: 4
|
114
|
-
summary:
|
116
|
+
summary: File versioning to save all files that you need a backup
|
115
117
|
test_files: []
|