glynn 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/glynn +23 -31
  3. data/lib/glynn/version.rb +1 -1
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3187c7199a57f5a3bb9327a331d650bc2e48b84
4
- data.tar.gz: 6b45a7a682a883b089db39ae3a12ef80588c4412
3
+ metadata.gz: 40d3add92259243508f8487f677cf5eb367d1c2c
4
+ data.tar.gz: c0102f947af45c1d93fc30f182dea522b48b4233
5
5
  SHA512:
6
- metadata.gz: 765eb83f089e88906d531c02c47a5f96dd2cf8cc88467f71e0d0cd4a80c802efe0bc7f47333dea6cd383d193d323b69a015f4b093ce70cd580527cffccb4bb69
7
- data.tar.gz: e78de1a3d63724e717699fb788acada85e6cd8a21cf051f0c3fad02da043f517b8dfd67735d4f3034bfab04e914384c1e80b214924e35134cae7e499eb58f268
6
+ metadata.gz: ce0a531620c4ececdd165a87214707d057fa3c6914cb9719c59489b233a9c8556dc5214240825a6f52384958fe6962f3ebc3a64f62859ac39bd4db14038c06d8
7
+ data.tar.gz: 8fd4934e0d04b71ad1c62710db80354370fe712e3eef74f751d05273654f49303a6a1b1bc62ab113ca61bce25baa4daa319eb576d7d0bf681a3af916a0d33de2
data/bin/glynn CHANGED
@@ -25,15 +25,15 @@ case ARGV.size
25
25
  options['ftp_password'] = ARGV[3]
26
26
  end
27
27
  options = Jekyll.configuration(options)
28
- ftp_port = (options['ftp_port'] || 21).to_i
29
- passive = options['ftp_passive'] || true
30
- ftp_secure = options['ftp_secure'] || false
31
-
32
28
  # If _glynn.yml exists, load and merge these options
33
29
  if File.file?('_glynn.yml')
34
30
  options = options.merge(YAML.load_file('_glynn.yml'))
35
31
  end
36
32
 
33
+ ftp_port = (options['ftp_port'] || 21).to_i
34
+ passive = options['ftp_passive'] || true
35
+ ftp_secure = options['ftp_secure'] || false
36
+
37
37
  # Include Username/Password from .netrc file if available
38
38
  if n = netrc[options['ftp_host']]
39
39
  if options['ftp_username'] || options['ftp_password']
@@ -46,36 +46,28 @@ if n = netrc[options['ftp_host']]
46
46
  options = (Hash[['ftp_username', 'ftp_password'].zip n]).merge options
47
47
  end
48
48
 
49
- puts "Building site: #{options['source']} -> #{options['destination']}"
49
+ cli.say "Building site: #{options['source']} -> #{options['destination']}"
50
50
  jekyll = Glynn::Jekyll.new
51
51
  jekyll.build
52
- puts "Successfully generated site"
52
+ cli.say cli.color("Successfully generated site", :green)
53
53
 
54
- puts "Sending site over FTP (host: #{options['ftp_host']}, port: #{ftp_port}, ftps: #{ftp_secure})"
55
- begin
56
- if options['ftp_username'].nil?
57
- print "FTP Username: "
58
- username = $stdin.gets.chomp
59
- else
60
- username = options['ftp_username']
61
- end
54
+ cli.say "Sending site over FTP (host: #{options['ftp_host']}, port: #{ftp_port}, ftps: #{ftp_secure})"
55
+
56
+ if options['ftp_username'].nil?
57
+ username = cli.ask "FTP Username: "
58
+ else
59
+ username = options['ftp_username']
60
+ end
62
61
 
63
- if options['ftp_password'].nil?
64
- print "FTP Password: "
65
- # Get the password without echoing characters
66
- password = $stdin.noecho(&:gets).chomp
67
- if cli.agree("Would you like to save this password to #{Netrc.default_path}?")
68
- netrc[options['ftp_host']] = username, password
69
- netrc.save
70
- end
71
- else
72
- password = options['ftp_password']
62
+ if options['ftp_password'].nil?
63
+ # Get the password without echoing characters
64
+ password = cli.ask("FTP Password: ") { |q| q.echo = false }
65
+ if cli.agree("Would you like to save this password to #{Netrc.default_path}?")
66
+ netrc[options['ftp_host']] = username, password
67
+ netrc.save
73
68
  end
74
- rescue NoMethodError, Interrupt
75
- # When the process is exited, we display the characters again
76
- # And we exit
77
- system "stty echo"
78
- exit
69
+ else
70
+ password = options['ftp_password']
79
71
  end
80
72
 
81
73
  ftp = Glynn::Ftp.new(options['ftp_host'], ftp_port, {
@@ -84,6 +76,6 @@ ftp = Glynn::Ftp.new(options['ftp_host'], ftp_port, {
84
76
  :passive => passive,
85
77
  :secure => ftp_secure
86
78
  })
87
- puts "\r\nConnected to server. Sending site"
79
+ cli.say "Connected to server. Sending site"
88
80
  ftp.sync(options['destination'], options['ftp_dir'])
89
- puts "Successfully sent site"
81
+ cli.say cli.color("Successfully sent site", :green)
@@ -1,3 +1,3 @@
1
1
  module Glynn
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glynn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien MATHIEU
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-08 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,3 +131,4 @@ signing_key:
131
131
  specification_version: 4
132
132
  summary: Deploy a jekyll weblog through ftp
133
133
  test_files: []
134
+ has_rdoc: