glynn 1.2.1 → 1.2.2

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 +20 -0
  3. data/lib/glynn/version.rb +1 -1
  4. metadata +31 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fe3f3fa0c4de4001f14909dc1bdf2a0b342a8a6
4
- data.tar.gz: c7e46abf98fb70885f861c3689c7cd965b5be2ea
3
+ metadata.gz: d3187c7199a57f5a3bb9327a331d650bc2e48b84
4
+ data.tar.gz: 6b45a7a682a883b089db39ae3a12ef80588c4412
5
5
  SHA512:
6
- metadata.gz: 10c3b169b3852b37c81614848c768e3ab81dba823491e52c8dc6b0451f4677c76e4471a93ef5b89f99a7146943f1f7470cafb561769d2edddce916f876a79222
7
- data.tar.gz: 77d4304c5fa8dce3d039395a7a4403039d25e8ae876b55e59ffb680f4c216c9911d3f37cb1edee06f047d7b040bbca83f83c0e75bead1d93872f7f8c37d76c24
6
+ metadata.gz: 765eb83f089e88906d531c02c47a5f96dd2cf8cc88467f71e0d0cd4a80c802efe0bc7f47333dea6cd383d193d323b69a015f4b093ce70cd580527cffccb4bb69
7
+ data.tar.gz: e78de1a3d63724e717699fb788acada85e6cd8a21cf051f0c3fad02da043f517b8dfd67735d4f3034bfab04e914384c1e80b214924e35134cae7e499eb58f268
data/bin/glynn CHANGED
@@ -1,10 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
3
  require 'jekyll'
4
+ require 'netrc'
4
5
  require 'glynn'
6
+ require 'highline'
5
7
  require 'io/console'
6
8
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
7
9
 
10
+ netrc = Netrc.read
11
+ cli = HighLine.new
8
12
 
9
13
  options = {}
10
14
  case ARGV.size
@@ -30,6 +34,18 @@ if File.file?('_glynn.yml')
30
34
  options = options.merge(YAML.load_file('_glynn.yml'))
31
35
  end
32
36
 
37
+ # Include Username/Password from .netrc file if available
38
+ if n = netrc[options['ftp_host']]
39
+ if options['ftp_username'] || options['ftp_password']
40
+ cli.say cli.color(
41
+ "The username and password settings from the configuration file" +
42
+ " take precedence over those in the netrc file!",
43
+ :yellow
44
+ )
45
+ end
46
+ options = (Hash[['ftp_username', 'ftp_password'].zip n]).merge options
47
+ end
48
+
33
49
  puts "Building site: #{options['source']} -> #{options['destination']}"
34
50
  jekyll = Glynn::Jekyll.new
35
51
  jekyll.build
@@ -48,6 +64,10 @@ begin
48
64
  print "FTP Password: "
49
65
  # Get the password without echoing characters
50
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
51
71
  else
52
72
  password = options['ftp_password']
53
73
  end
@@ -1,3 +1,3 @@
1
1
  module Glynn
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
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.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien MATHIEU
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-10 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.1.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: netrc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: highline
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '1.5'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '1.5'
69
97
  description: Deploy a jekyll weblog through ftp
70
98
  email: 42@dmathieu.com
71
99
  executables:
@@ -98,9 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
126
  version: '0'
99
127
  requirements: []
100
128
  rubyforge_project:
101
- rubygems_version: 2.4.5.1
129
+ rubygems_version: 2.5.1
102
130
  signing_key:
103
131
  specification_version: 4
104
132
  summary: Deploy a jekyll weblog through ftp
105
133
  test_files: []
106
- has_rdoc: