oleg 0.8.0 → 0.9.0
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.
- checksums.yaml +4 -4
- data/lib/leg.rb +1 -0
- data/lib/leg/commands.rb +1 -0
- data/lib/leg/commands/base_command.rb +10 -0
- data/lib/leg/commands/deploy.rb +33 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eed44d55e531af33f1af968ab032e572e8b67603
|
4
|
+
data.tar.gz: 304c2bbb2d683678264bb8b77e7b8eee870fc737
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a716d582f3817f63035131082860a415d0c5bb6d8be2980a0d97c375ab945a2cff3facb528683caf113b1da885fa6f8be1dae21c81e4e4620fefac00444b9b02
|
7
|
+
data.tar.gz: e84c918bff6a8e24f1fbda04de66dccdf6d200ecbdb9f6f3816473246fded075ce7df66bab4e8a134bb41cd67cd88f0b8f507dfb6c625a9613fe6ac67981fa53
|
data/lib/leg.rb
CHANGED
data/lib/leg/commands.rb
CHANGED
@@ -36,6 +36,12 @@ class Leg::Commands::BaseCommand
|
|
36
36
|
},
|
37
37
|
doc: {
|
38
38
|
true: "There is no doc folder."
|
39
|
+
},
|
40
|
+
doc_out: {
|
41
|
+
true: "There are no doc output files."
|
42
|
+
},
|
43
|
+
ftp: {
|
44
|
+
true: "There is no ftp.yml file."
|
39
45
|
}
|
40
46
|
}
|
41
47
|
|
@@ -63,6 +69,10 @@ class Leg::Commands::BaseCommand
|
|
63
69
|
valid = true if File.exist?(File.join(@config[:path], "steps.diff"))
|
64
70
|
when :doc
|
65
71
|
valid = true if File.exist?(File.join(@config[:path], "doc"))
|
72
|
+
when :doc_out
|
73
|
+
valid = true if File.exist?(File.join(@config[:path], "doc/html_out"))
|
74
|
+
when :ftp
|
75
|
+
valid = true if File.exist?(File.join(@config[:path], "ftp.yml"))
|
66
76
|
else
|
67
77
|
raise NotImplementedError
|
68
78
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Leg::Commands::Deploy < Leg::Commands::BaseCommand
|
2
|
+
def self.name
|
3
|
+
"deploy"
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.summary
|
7
|
+
"Pushes output files in doc/ to production server"
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
needs! :config, :doc, :doc_out, :ftp
|
12
|
+
|
13
|
+
only = @args.empty? ? nil : @args
|
14
|
+
|
15
|
+
FileUtils.cd(File.join(@config[:path], "doc/html_out")) do
|
16
|
+
ftp_config = YAML.load(File.read(File.join(@config[:path], "ftp.yml")))
|
17
|
+
Net::FTP.open(ftp_config[:host], ftp_config[:username], ftp_config[:password]) do |ftp|
|
18
|
+
ftp.chdir(ftp_config[:root])
|
19
|
+
Dir["**/*"].each do |f|
|
20
|
+
if only.nil? || only.any? { |o| f[o] }
|
21
|
+
puts f
|
22
|
+
if File.directory?(f)
|
23
|
+
ftp.mkdir(f) rescue Net::FTPPermError
|
24
|
+
elsif File.file?(f)
|
25
|
+
ftp.putbinaryfile(f)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oleg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Ruten
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- lib/leg/cli.rb
|
65
65
|
- lib/leg/commands.rb
|
66
66
|
- lib/leg/commands/base_command.rb
|
67
|
+
- lib/leg/commands/deploy.rb
|
67
68
|
- lib/leg/commands/diff.rb
|
68
69
|
- lib/leg/commands/doc.rb
|
69
70
|
- lib/leg/commands/fancy.rb
|