hyde-ftp 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -1
- data/bin/hyde +1 -76
- data/hyde-ftp.gemspec +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/bin/hyde
CHANGED
@@ -6,79 +6,4 @@ require 'yaml'
|
|
6
6
|
require 'hyde/ftp-transfer'
|
7
7
|
require 'hyde/ftp-transfer.rb'
|
8
8
|
require 'hyde'
|
9
|
-
|
10
|
-
class Jekyll
|
11
|
-
$jekyll = Jekyll.new()
|
12
|
-
|
13
|
-
def initialize()
|
14
|
-
nil
|
15
|
-
end
|
16
|
-
|
17
|
-
def exists()
|
18
|
-
@jekyll_version = %x( jekyll -version )
|
19
|
-
|
20
|
-
if @jekyll_version[1] = "j"
|
21
|
-
nil
|
22
|
-
else
|
23
|
-
%x( gem install jekyll )
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def new_site(name)
|
28
|
-
$jekyll.exists()
|
29
|
-
%x( jekyll new #{name} )
|
30
|
-
puts "Site created."
|
31
|
-
end
|
32
|
-
|
33
|
-
def deploy()
|
34
|
-
# Build Site
|
35
|
-
%x( jekyll build )
|
36
|
-
|
37
|
-
# Declare Instance Variables
|
38
|
-
config = YAML.load(File.read(ARGV[1]))
|
39
|
-
|
40
|
-
@ftp_server = config['server']
|
41
|
-
@username = config['username']
|
42
|
-
@password = config['password']
|
43
|
-
@remote_dir = config['remote_dir']
|
44
|
-
@local_dir = config['local_dir']
|
45
|
-
|
46
|
-
# Initialize FTP
|
47
|
-
ftp = Net::FTP.new(@ftp_server);
|
48
|
-
ftp.login(@username, @password)
|
49
|
-
ftp.chdir(@remote_dir)
|
50
|
-
|
51
|
-
$jekyll.clean_ftp(ftp)
|
52
|
-
|
53
|
-
$jekyll.mirror @local_dir, ftp
|
54
|
-
|
55
|
-
ftp.quit
|
56
|
-
end
|
57
|
-
|
58
|
-
def help()
|
59
|
-
command2 = ARGV[1]
|
60
|
-
case command2
|
61
|
-
when "deploy"
|
62
|
-
puts "Build Jekyll site and deploy via FTP."
|
63
|
-
puts "Usage: hyde deploy _config.yml"
|
64
|
-
when "new_site"
|
65
|
-
puts "Create a new Jekyll site."
|
66
|
-
puts "Usage: hyde new site_name"
|
67
|
-
else
|
68
|
-
puts "Commands:"
|
69
|
-
puts " deploy\n new_site"
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
command1 = ARGV[0]
|
75
|
-
case command1
|
76
|
-
when "deploy"
|
77
|
-
$jekyll.deploy
|
78
|
-
when "new_site"
|
79
|
-
$jekyll.new_site
|
80
|
-
when "help"
|
81
|
-
$jekyll.help
|
82
|
-
else
|
83
|
-
puts "You didn't give me a command.\nRun 'hyde help' to see a command list."
|
84
|
-
end
|
9
|
+
require 'hyde.rb'
|
data/hyde-ftp.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyde-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jesse Herrick
|