hyde-ftp 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/hyde-ftp.gemspec +1 -1
- data/lib/hyde.rb +24 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -13,6 +13,10 @@ Usage: `hyde deploy _config.yml`
|
|
13
13
|
Create a new Jekyll site.
|
14
14
|
Usage: `hyde new site_name`
|
15
15
|
|
16
|
+
##`hyde cleandir`
|
17
|
+
Clears remote directory.
|
18
|
+
Usage: `hyde cleandir _config.yml`
|
19
|
+
|
16
20
|
#How to Set Up Your Config
|
17
21
|
Your config can be the same as the one in your Jekyll site's folder. Just add these lines at the end of `_config.yml` file. (no quotes needed)
|
18
22
|
|
data/hyde-ftp.gemspec
CHANGED
data/lib/hyde.rb
CHANGED
@@ -69,6 +69,26 @@ class Jekyll
|
|
69
69
|
puts " new_site siteName"
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
def clean!
|
74
|
+
config = YAML.load(File.read(ARGV[1]))
|
75
|
+
|
76
|
+
@ftp_server = config['server']
|
77
|
+
@username = config['username']
|
78
|
+
@password = config['password']
|
79
|
+
@remote_dir = config['remote_dir']
|
80
|
+
|
81
|
+
# Initialize FTP
|
82
|
+
ftp = Net::FTP.new(@ftp_server);
|
83
|
+
ftp.login(@username, @password)
|
84
|
+
ftp.chdir(@remote_dir)
|
85
|
+
|
86
|
+
clean_ftp(ftp)
|
87
|
+
|
88
|
+
puts "Directory cleared."
|
89
|
+
rescue
|
90
|
+
puts " Incorrectly configured or nonexistant config file."
|
91
|
+
end
|
72
92
|
end
|
73
93
|
|
74
94
|
command1 = ARGV[0]
|
@@ -77,6 +97,10 @@ when "deploy"
|
|
77
97
|
$jekyll.deploy
|
78
98
|
when "new_site"
|
79
99
|
$jekyll.new_site(ARGV[1])
|
100
|
+
when "cleardir"
|
101
|
+
$jekyll.clean!
|
102
|
+
when "cleandir"
|
103
|
+
$jekyll.clean!
|
80
104
|
when "help"
|
81
105
|
$jekyll.help
|
82
106
|
when "list"
|