hyde-ftp 0.2.2 → 0.3.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.
Files changed (4) hide show
  1. data/README.md +4 -0
  2. data/hyde-ftp.gemspec +1 -1
  3. data/lib/hyde.rb +24 -0
  4. 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
 
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'hyde-ftp'
7
- s.version = '0.2.2'
7
+ s.version = '0.3.0'
8
8
  s.license = 'MIT'
9
9
  s.date = '2013-06-11'
10
10
 
@@ -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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyde-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: