rbfs 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rbfs +10 -0
- data/lib/rbfs.rb +1 -0
- data/lib/rbfs/args.rb +30 -0
- data/lib/rbfs/command.rb +12 -0
- data/lib/rbfs/config.rb +13 -0
- data/lib/rbfs/host.rb +23 -0
- data/lib/rbfs/hosts.rb +17 -0
- data/lib/rbfs/rsync.rb +10 -0
- data/lib/rbfs/version.rb +1 -1
- metadata +15 -7
data/bin/rbfs
ADDED
data/lib/rbfs.rb
CHANGED
data/lib/rbfs/args.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module Rbfs
|
4
|
+
class Args
|
5
|
+
def parse
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
OptionParser.new do |opts|
|
9
|
+
opts.banner = "Usage: rbfs [options]"
|
10
|
+
opts.on("-c", "--config FILE", "Configuration file") do |v|
|
11
|
+
options[:config] = v
|
12
|
+
end
|
13
|
+
opts.on("-h", "--hosts FILE", "Hosts file") do |v|
|
14
|
+
options[:hosts] = v
|
15
|
+
end
|
16
|
+
opts.on("-r", "--root ROOT", "Root path to sync") do |v|
|
17
|
+
options[:root] = v
|
18
|
+
end
|
19
|
+
opts.on("-v", "--[no-]verbose", "Print extra debugging info") do |v|
|
20
|
+
options[:verbose] = v
|
21
|
+
end
|
22
|
+
opts.on("-d", "--dry", "Test config settings") do |v|
|
23
|
+
options[:dry] = v
|
24
|
+
end
|
25
|
+
end.parse!
|
26
|
+
|
27
|
+
options
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/rbfs/command.rb
ADDED
data/lib/rbfs/config.rb
ADDED
data/lib/rbfs/host.rb
ADDED
data/lib/rbfs/hosts.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rbfs/host"
|
2
|
+
|
3
|
+
module Rbfs
|
4
|
+
class Hosts
|
5
|
+
def initialize(file_name)
|
6
|
+
@file_name = file_name
|
7
|
+
end
|
8
|
+
|
9
|
+
def each(&block)
|
10
|
+
lines = File.read(@file_name).split("\n")
|
11
|
+
lines.reject! {|line| line.strip.start_with? "#"}
|
12
|
+
lines.each do |line|
|
13
|
+
yield(Host.new(line))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/rbfs/rsync.rb
ADDED
data/lib/rbfs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-18 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &17891980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17891980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &17891020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,11 +32,12 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17891020
|
36
36
|
description: Ruby File Sync
|
37
37
|
email:
|
38
38
|
- jbussdieker@gmail.com
|
39
|
-
executables:
|
39
|
+
executables:
|
40
|
+
- rbfs
|
40
41
|
extensions: []
|
41
42
|
extra_rdoc_files: []
|
42
43
|
files:
|
@@ -44,7 +45,14 @@ files:
|
|
44
45
|
- Gemfile
|
45
46
|
- README.md
|
46
47
|
- Rakefile
|
48
|
+
- bin/rbfs
|
47
49
|
- lib/rbfs.rb
|
50
|
+
- lib/rbfs/args.rb
|
51
|
+
- lib/rbfs/command.rb
|
52
|
+
- lib/rbfs/config.rb
|
53
|
+
- lib/rbfs/host.rb
|
54
|
+
- lib/rbfs/hosts.rb
|
55
|
+
- lib/rbfs/rsync.rb
|
48
56
|
- lib/rbfs/version.rb
|
49
57
|
- rbfs.gemspec
|
50
58
|
homepage: ''
|