glynn 1.0.10 → 1.0.11
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.
- data/bin/glynn +58 -0
- data/lib/glynn/version.rb +1 -1
- metadata +11 -9
data/bin/glynn
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'jekyll'
|
4
|
+
require 'glynn'
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
+
|
7
|
+
|
8
|
+
options = {}
|
9
|
+
case ARGV.size
|
10
|
+
when 0
|
11
|
+
when 1
|
12
|
+
options['destination'] = ARGV[0]
|
13
|
+
when 2
|
14
|
+
options['source'] = ARGV[0]
|
15
|
+
options['destination'] = ARGV[1]
|
16
|
+
when 4
|
17
|
+
options['source'] = ARGV[0]
|
18
|
+
options['destination'] = ARGV[1]
|
19
|
+
options['ftp_username'] = ARGV[2]
|
20
|
+
options['ftp_password'] = ARGV[3]
|
21
|
+
end
|
22
|
+
options = Jekyll.configuration(options)
|
23
|
+
ftp_port = (options['ftp_port'] || 21).to_i
|
24
|
+
|
25
|
+
puts "Building site: #{options['source']} -> #{options['destination']}"
|
26
|
+
jekyll = Glynn::Jekyll.new
|
27
|
+
jekyll.build
|
28
|
+
puts "Successfully generated site"
|
29
|
+
|
30
|
+
puts "Sending site over FTP (host: #{options['ftp_host']}, port: #{ftp_port})"
|
31
|
+
begin
|
32
|
+
if options['ftp_username'].nil?
|
33
|
+
print "FTP Username: "
|
34
|
+
username = $stdin.gets.chomp
|
35
|
+
else
|
36
|
+
username = options['ftp_username']
|
37
|
+
end
|
38
|
+
|
39
|
+
if options['ftp_password'].nil?
|
40
|
+
print "FTP Password: "
|
41
|
+
# We hide the entered characters before to ask for the password
|
42
|
+
system "stty -echo"
|
43
|
+
password = $stdin.gets.chomp
|
44
|
+
system "stty echo"
|
45
|
+
else
|
46
|
+
password = options['ftp_password']
|
47
|
+
end
|
48
|
+
rescue NoMethodError, Interrupt
|
49
|
+
# When the process is exited, we display the characters again
|
50
|
+
# And we exit
|
51
|
+
system "stty echo"
|
52
|
+
exit
|
53
|
+
end
|
54
|
+
|
55
|
+
ftp = Glynn::Ftp.new(options['ftp_host'], ftp_port, {:username => username, :password => password})
|
56
|
+
puts "\r\nConnected to server. Sending site"
|
57
|
+
ftp.sync(options['destination'], options['ftp_dir'])
|
58
|
+
puts "Successfully sent site"
|
data/lib/glynn/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glynn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
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: 2012-05-
|
12
|
+
date: 2012-05-26 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70365074332120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70365074332120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest
|
27
|
-
requirement: &
|
27
|
+
requirement: &70365074485020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70365074485020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jekyll
|
38
|
-
requirement: &
|
38
|
+
requirement: &70365074484500 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,11 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70365074484500
|
47
47
|
description: Deploy a jekyll weblog through ftp
|
48
48
|
email: 42@dmathieu.com
|
49
|
-
executables:
|
49
|
+
executables:
|
50
|
+
- glynn
|
50
51
|
extensions: []
|
51
52
|
extra_rdoc_files: []
|
52
53
|
files:
|
@@ -55,6 +56,7 @@ files:
|
|
55
56
|
- lib/glynn/ftp.rb
|
56
57
|
- lib/glynn/jekyll.rb
|
57
58
|
- lib/glynn/version.rb
|
59
|
+
- bin/glynn
|
58
60
|
homepage: https://github.com/dmathieu/glynn
|
59
61
|
licenses: []
|
60
62
|
post_install_message:
|