glynn 1.0.0 → 1.0.1

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/.gitignore CHANGED
@@ -2,4 +2,6 @@ _site/*
2
2
  pkg/*
3
3
  *.kpf
4
4
  *.tmproj
5
- .DS_Store
5
+ .DS_Store
6
+ vendor/gems/*
7
+ bin/*
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'vendor/gems/environment'
2
2
  require 'spec/rake/spectask'
3
3
 
4
4
  begin
@@ -10,7 +10,7 @@ begin
10
10
  gemspec.email = "42@dmathieu.com"
11
11
  gemspec.homepage = "http://github.com/dmathieu/glynn"
12
12
  gemspec.authors = ["Damien MATHIEU"]
13
- gemspec.version = '1.0.0'
13
+ gemspec.version = '1.0.1'
14
14
 
15
15
  gemspec.add_dependency('jekyll', '>= 0.5.4')
16
16
  end
data/bin/glynn CHANGED
@@ -24,14 +24,22 @@ puts "Successfully generated site"
24
24
 
25
25
  puts "Sending site over FTP (host: #{options['ftp_host']})"
26
26
  begin
27
- print "FTP Username: "
28
- username = $stdin.gets.chomp
27
+ if options['ftp_username'].nil?
28
+ print "FTP Username: "
29
+ username = $stdin.gets.chomp
30
+ else
31
+ username = options['username']
32
+ end
29
33
 
30
- print "FTP Password: "
31
- # We hide the entered characters before to ask for the password
32
- system "stty -echo"
33
- password = $stdin.gets.chomp
34
- system "stty echo"
34
+ if options['password'].nil?
35
+ print "FTP Password: "
36
+ # We hide the entered characters before to ask for the password
37
+ system "stty -echo"
38
+ password = $stdin.gets.chomp
39
+ system "stty echo"
40
+ else
41
+ password = options['password']
42
+ end
35
43
  rescue NoMethodError, Interrupt
36
44
  # When the process is exited, we display the characters again
37
45
  # And we exit
data/glynn.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{glynn}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Damien MATHIEU"]
data/lib/glynn/ftp.rb CHANGED
@@ -34,7 +34,7 @@ module Glynn
34
34
  # If the file/directory is hidden (first character is a dot), we ignore it
35
35
  next if file_name =~ /^\./
36
36
 
37
- if File.stat(local + "/" + file_name).directory?
37
+ if ::File.stat(local + "/" + file_name).directory?
38
38
  # It is a directory, we recursively send it
39
39
  begin
40
40
  ftp.mkdir(distant + "/" + file_name)
@@ -45,7 +45,11 @@ module Glynn
45
45
  send_dir(ftp, local + "/" + file_name, distant + "/" + file_name)
46
46
  else
47
47
  # It's a file, we just send it
48
- ftp.puttextfile(local + "/" + file_name, distant + "/" + file_name)
48
+ if Glynn::File.is_bin?(local + "/" + file_name)
49
+ ftp.putbinaryfile(local + "/" + file_name, distant + "/" + file_name)
50
+ else
51
+ ftp.puttextfile(local + "/" + file_name, distant + "/" + file_name)
52
+ end
49
53
  end
50
54
  end
51
55
 
data/lib/glynn.rb CHANGED
@@ -2,4 +2,5 @@ $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
2
2
  require 'rubygems'
3
3
 
4
4
  require 'glynn/jekyll'
5
+ require 'glynn/file'
5
6
  require 'glynn/ftp'
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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien MATHIEU
@@ -45,10 +45,8 @@ files:
45
45
  - spec/lib/jekyll.rb
46
46
  - spec/spec.opts
47
47
  - spec/spec_helper.rb
48
- has_rdoc: true
48
+ has_rdoc: false
49
49
  homepage: http://github.com/dmathieu/glynn
50
- licenses: []
51
-
52
50
  post_install_message:
53
51
  rdoc_options:
54
52
  - --charset=UTF-8
@@ -69,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
67
  requirements: []
70
68
 
71
69
  rubyforge_project:
72
- rubygems_version: 1.3.5
70
+ rubygems_version: 1.3.1
73
71
  signing_key:
74
72
  specification_version: 3
75
73
  summary: Deploy a jekyll weblog through ftp