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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bb133639dd73f281038157b744388e3b3b00435
4
- data.tar.gz: d203dcc60e0391acc09ff7c50c3dc9d275d1f7bb
3
+ metadata.gz: ce9191567c230128333e294860e28e5ac8a3bd84
4
+ data.tar.gz: c0ed5b2d5f54bb581a0279f83d81272922be5e40
5
5
  SHA512:
6
- metadata.gz: 03632a0c55a6a4af86f9957bd9b375e123c7320b3403bf66b1054ea6bc774c5b0b5f4cec11d37afaecda7c49328ac0af15f864702ecf419cd778b5b9dbac39ec
7
- data.tar.gz: 8ae3f51c2b2a032ed0214e90d566dca3bd30ffe87bc4eda99c0965e9925f6f86c0d6f0a4aea71abd2b4f2027ed596d75db757e784630396a63f41da941ce1dcf
6
+ metadata.gz: 250c2bfb54cb3c54ef387de079e6e27c0cac068654751309b55810a047c52defac37b634bac54f4582a5cc49146fc12de26592632ce9ec21b779f2128691380c
7
+ data.tar.gz: 28eb3c258ee06b8a4f61d93a31ce811f45add4bf4ca7d727ecb4ac1aed538adac21cfe4e829fe4343016035e1f4f014656b0880722e037ea4c9bde617852f966
data/ChangeLog ADDED
@@ -0,0 +1,3 @@
1
+ Sun Jun 26 10:21:55 BRT 2016 Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
2
+
3
+ * Initial Release
data/LICENSE CHANGED
@@ -1,21 +1,22 @@
1
- The MIT License (MIT)
1
+ Copyright © Luciano Prestes
2
2
 
3
- Copyright (c) 2016 Luciano
3
+ Expat (aka MIT) License
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
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 included in all
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, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
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
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'bundler/setup'
4
3
  require 'commands/look'
5
4
 
6
5
  def main
data/lib/command.rb CHANGED
@@ -13,17 +13,21 @@ class Command
13
13
  end
14
14
 
15
15
  def self.parent
16
- raise 'return the parent command'
16
+ nil
17
17
  end
18
18
 
19
19
  def self.childrens
20
- raise 'return the childrens commands'
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
@@ -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
- Lookfile.set_repository(repository_ssh_name)
26
- puts "Setted repository to: #{repository_ssh_name}"
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
@@ -1,3 +1,3 @@
1
1
  module Lookfile
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
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 = 'Version all files that you need'
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 = 'MIT'
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.3
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-22 00:00:00.000000000 Z
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
- - MIT
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: Version all files that you need
116
+ summary: File versioning to save all files that you need a backup
115
117
  test_files: []