glynn 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/glynn/ftp.rb +1 -0
- data/lib/glynn/version.rb +3 -0
- metadata +19 -75
- data/.rvmrc +0 -2
- data/Gemfile +0 -19
- data/Gemfile.lock +0 -59
- data/LICENSE +0 -20
- data/README.md +0 -48
- data/Rakefile +0 -35
- data/VERSION +0 -1
- data/bin/glynn +0 -58
- data/glynn.gemspec +0 -78
- data/spec/lib/file_spec.rb +0 -20
- data/spec/lib/ftp_spec.rb +0 -79
- data/spec/lib/jekyll_spec.rb +0 -28
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -7
data/lib/glynn/ftp.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.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,102 +9,53 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-20 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: bundler
|
16
|
+
requirement: &70114419072340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
|
-
type: :
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70171743230860
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: jekyll
|
27
|
-
requirement: &70171743230160 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70171743230160
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: jeweler
|
38
|
-
requirement: &70171743229540 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ! '>='
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0'
|
44
|
-
type: :runtime
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70171743229540
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: sdoc
|
49
|
-
requirement: &70171743228960 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
type: :runtime
|
22
|
+
type: :development
|
56
23
|
prerelease: false
|
57
|
-
version_requirements: *
|
24
|
+
version_requirements: *70114419072340
|
58
25
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
60
|
-
requirement: &
|
26
|
+
name: minitest
|
27
|
+
requirement: &70114419105440 !ruby/object:Gem::Requirement
|
61
28
|
none: false
|
62
29
|
requirements:
|
63
30
|
- - ! '>='
|
64
31
|
- !ruby/object:Gem::Version
|
65
32
|
version: '0'
|
66
|
-
type: :
|
33
|
+
type: :development
|
67
34
|
prerelease: false
|
68
|
-
version_requirements: *
|
35
|
+
version_requirements: *70114419105440
|
69
36
|
- !ruby/object:Gem::Dependency
|
70
37
|
name: jekyll
|
71
|
-
requirement: &
|
38
|
+
requirement: &70114419104920 !ruby/object:Gem::Requirement
|
72
39
|
none: false
|
73
40
|
requirements:
|
74
41
|
- - ! '>='
|
75
42
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0
|
43
|
+
version: '0'
|
77
44
|
type: :runtime
|
78
45
|
prerelease: false
|
79
|
-
version_requirements: *
|
46
|
+
version_requirements: *70114419104920
|
80
47
|
description: Deploy a jekyll weblog through ftp
|
81
48
|
email: 42@dmathieu.com
|
82
|
-
executables:
|
83
|
-
- glynn
|
49
|
+
executables: []
|
84
50
|
extensions: []
|
85
|
-
extra_rdoc_files:
|
86
|
-
- LICENSE
|
87
|
-
- README.md
|
51
|
+
extra_rdoc_files: []
|
88
52
|
files:
|
89
|
-
- .rvmrc
|
90
|
-
- Gemfile
|
91
|
-
- Gemfile.lock
|
92
|
-
- LICENSE
|
93
|
-
- README.md
|
94
|
-
- Rakefile
|
95
|
-
- VERSION
|
96
|
-
- bin/glynn
|
97
|
-
- glynn.gemspec
|
98
53
|
- lib/glynn.rb
|
99
54
|
- lib/glynn/file.rb
|
100
55
|
- lib/glynn/ftp.rb
|
101
56
|
- lib/glynn/jekyll.rb
|
102
|
-
-
|
103
|
-
|
104
|
-
- spec/lib/jekyll_spec.rb
|
105
|
-
- spec/spec.opts
|
106
|
-
- spec/spec_helper.rb
|
107
|
-
homepage: http://github.com/dmathieu/glynn
|
57
|
+
- lib/glynn/version.rb
|
58
|
+
homepage: https://github.com/dmathieu/glynn
|
108
59
|
licenses: []
|
109
60
|
post_install_message:
|
110
61
|
rdoc_options: []
|
@@ -116,9 +67,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
67
|
- - ! '>='
|
117
68
|
- !ruby/object:Gem::Version
|
118
69
|
version: '0'
|
119
|
-
segments:
|
120
|
-
- 0
|
121
|
-
hash: 3112693191030928112
|
122
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
71
|
none: false
|
124
72
|
requirements:
|
@@ -127,12 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
75
|
version: '0'
|
128
76
|
requirements: []
|
129
77
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.17
|
131
79
|
signing_key:
|
132
80
|
specification_version: 3
|
133
81
|
summary: Deploy a jekyll weblog through ftp
|
134
|
-
test_files:
|
135
|
-
- spec/lib/file_spec.rb
|
136
|
-
- spec/lib/ftp_spec.rb
|
137
|
-
- spec/lib/jekyll_spec.rb
|
138
|
-
- spec/spec_helper.rb
|
82
|
+
test_files: []
|
data/.rvmrc
DELETED
data/Gemfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
source "http://gemcutter.org"
|
2
|
-
#
|
3
|
-
# Required on every environment
|
4
|
-
#
|
5
|
-
gem "rdiscount"
|
6
|
-
gem "jekyll"
|
7
|
-
gem "jeweler"
|
8
|
-
gem "sdoc"
|
9
|
-
gem "sdoc-helpers"
|
10
|
-
|
11
|
-
#
|
12
|
-
# Required only for tests
|
13
|
-
#
|
14
|
-
group :test do
|
15
|
-
gem "rspec"
|
16
|
-
gem "mocha"
|
17
|
-
gem "fakefs",
|
18
|
-
:git => 'https://github.com/dmathieu/fakefs.git'
|
19
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/dmathieu/fakefs.git
|
3
|
-
revision: 09f238b23772d95e8790235b7d3eee99e431deac
|
4
|
-
specs:
|
5
|
-
fakefs (0.3.1)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://gemcutter.org/
|
9
|
-
specs:
|
10
|
-
classifier (1.3.3)
|
11
|
-
fast-stemmer (>= 1.0.0)
|
12
|
-
diff-lcs (1.1.2)
|
13
|
-
directory_watcher (1.4.0)
|
14
|
-
fast-stemmer (1.0.0)
|
15
|
-
git (1.2.5)
|
16
|
-
jekyll (0.10.0)
|
17
|
-
classifier (>= 1.3.1)
|
18
|
-
directory_watcher (>= 1.1.1)
|
19
|
-
liquid (>= 1.9.0)
|
20
|
-
maruku (>= 0.5.9)
|
21
|
-
jeweler (1.5.2)
|
22
|
-
bundler (~> 1.0.0)
|
23
|
-
git (>= 1.2.5)
|
24
|
-
rake
|
25
|
-
json (1.5.1)
|
26
|
-
liquid (2.2.2)
|
27
|
-
maruku (0.6.0)
|
28
|
-
syntax (>= 1.0.0)
|
29
|
-
mocha (0.9.12)
|
30
|
-
rake (0.8.7)
|
31
|
-
rdiscount (1.6.8)
|
32
|
-
rdoc (2.4.3)
|
33
|
-
rspec (2.5.0)
|
34
|
-
rspec-core (~> 2.5.0)
|
35
|
-
rspec-expectations (~> 2.5.0)
|
36
|
-
rspec-mocks (~> 2.5.0)
|
37
|
-
rspec-core (2.5.1)
|
38
|
-
rspec-expectations (2.5.0)
|
39
|
-
diff-lcs (~> 1.1.2)
|
40
|
-
rspec-mocks (2.5.0)
|
41
|
-
sdoc (0.2.20)
|
42
|
-
json (>= 1.1.3)
|
43
|
-
rdoc (= 2.4.3)
|
44
|
-
sdoc-helpers (0.1.4)
|
45
|
-
sdoc (~> 0.2)
|
46
|
-
syntax (1.0.0)
|
47
|
-
|
48
|
-
PLATFORMS
|
49
|
-
ruby
|
50
|
-
|
51
|
-
DEPENDENCIES
|
52
|
-
fakefs!
|
53
|
-
jekyll
|
54
|
-
jeweler
|
55
|
-
mocha
|
56
|
-
rdiscount
|
57
|
-
rspec
|
58
|
-
sdoc
|
59
|
-
sdoc-helpers
|
data/LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2009 Damien MATHIEU
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
Glynn
|
2
|
-
=====
|
3
|
-
|
4
|
-
Glynn offers you a bin to easily send a jekyll powered blog to your host through FTP.
|
5
|
-
[![Travis](http://travis-ci.org/dmathieu/glynn.png)](http://travis-ci.org/dmathieu/glynn)
|
6
|
-
|
7
|
-
Installation
|
8
|
-
------------
|
9
|
-
|
10
|
-
Glynn comes as a gem. It has no dependencies other than the ruby default libraries.
|
11
|
-
Install it with gem install.
|
12
|
-
|
13
|
-
gem install glynn --source http://gemcutter.org
|
14
|
-
|
15
|
-
That's it ! You now have the Glynn executable on your machine.
|
16
|
-
Go to your jekyll project, configure the host and distant directory where the files will be sent.
|
17
|
-
For example, this is my _config.yml file :
|
18
|
-
|
19
|
-
markdown: rdiscount
|
20
|
-
pygments: true
|
21
|
-
auto: true
|
22
|
-
ftp_host: dmathieu.com
|
23
|
-
ftp_dir: /web/portfolio
|
24
|
-
|
25
|
-
Glynn will connect itself to the host "dmathieu.com" and send every file to the FTP directory /web/portfolio.
|
26
|
-
To do yo, you just need to be at the top of your jekyll project. And in a console, enter the following :
|
27
|
-
|
28
|
-
glynn
|
29
|
-
|
30
|
-
Quite simple again. It'll connect to the remote host, ask you for login and password and send the files :)
|
31
|
-
|
32
|
-
Contributing
|
33
|
-
------------
|
34
|
-
|
35
|
-
If you think Glynn is great but can be improved, feel free to contribute.
|
36
|
-
To do so, you can :
|
37
|
-
|
38
|
-
* [Fork](http://help.github.com/forking/) the project
|
39
|
-
* Do your changes and commit them to your repository
|
40
|
-
* Test your changes. We won't accept any untested contributions (except if they're not testable).
|
41
|
-
* Create an [issue](http://github.com/dmathieu/glynn/issues) with a link to your commits.
|
42
|
-
|
43
|
-
And that's it! I'll soon take a look at your issue and review your changes.
|
44
|
-
|
45
|
-
Author
|
46
|
-
------------------
|
47
|
-
|
48
|
-
Damien MATHIEU :: 42 (AT|CHEZ) dmathieu.com
|
data/Rakefile
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'jeweler'
|
5
|
-
Jeweler::Tasks.new do |gemspec|
|
6
|
-
gemspec.name = "glynn"
|
7
|
-
gemspec.summary = "Deploy a jekyll weblog through ftp"
|
8
|
-
gemspec.description = "Deploy a jekyll weblog through ftp"
|
9
|
-
gemspec.email = "42@dmathieu.com"
|
10
|
-
gemspec.homepage = "http://github.com/dmathieu/glynn"
|
11
|
-
gemspec.authors = ["Damien MATHIEU"]
|
12
|
-
|
13
|
-
gemspec.add_dependency('jekyll', '>= 0.5.4')
|
14
|
-
end
|
15
|
-
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with:"
|
17
|
-
puts "gem install jeweler"
|
18
|
-
end
|
19
|
-
|
20
|
-
#
|
21
|
-
# The rspec tasks
|
22
|
-
#
|
23
|
-
require 'rspec/core'
|
24
|
-
require 'rspec/core/rake_task'
|
25
|
-
task :default => :spec
|
26
|
-
RSpec::Core::RakeTask.new(:spec)
|
27
|
-
|
28
|
-
#
|
29
|
-
# The sdoc generator
|
30
|
-
#
|
31
|
-
begin
|
32
|
-
require 'sdoc_helpers'
|
33
|
-
rescue LoadError
|
34
|
-
puts "sdoc support not enabled. Please gem install sdoc-helpers."
|
35
|
-
end
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.9
|
data/bin/glynn
DELETED
@@ -1,58 +0,0 @@
|
|
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/glynn.gemspec
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = "glynn"
|
8
|
-
s.version = "1.0.9"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Damien MATHIEU"]
|
12
|
-
s.date = "2012-01-31"
|
13
|
-
s.description = "Deploy a jekyll weblog through ftp"
|
14
|
-
s.email = "42@dmathieu.com"
|
15
|
-
s.executables = ["glynn"]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"LICENSE",
|
18
|
-
"README.md"
|
19
|
-
]
|
20
|
-
s.files = [
|
21
|
-
".rvmrc",
|
22
|
-
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
|
-
"LICENSE",
|
25
|
-
"README.md",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"bin/glynn",
|
29
|
-
"glynn.gemspec",
|
30
|
-
"lib/glynn.rb",
|
31
|
-
"lib/glynn/file.rb",
|
32
|
-
"lib/glynn/ftp.rb",
|
33
|
-
"lib/glynn/jekyll.rb",
|
34
|
-
"spec/lib/file_spec.rb",
|
35
|
-
"spec/lib/ftp_spec.rb",
|
36
|
-
"spec/lib/jekyll_spec.rb",
|
37
|
-
"spec/spec.opts",
|
38
|
-
"spec/spec_helper.rb"
|
39
|
-
]
|
40
|
-
s.homepage = "http://github.com/dmathieu/glynn"
|
41
|
-
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version = "1.8.10"
|
43
|
-
s.summary = "Deploy a jekyll weblog through ftp"
|
44
|
-
s.test_files = [
|
45
|
-
"spec/lib/file_spec.rb",
|
46
|
-
"spec/lib/ftp_spec.rb",
|
47
|
-
"spec/lib/jekyll_spec.rb",
|
48
|
-
"spec/spec_helper.rb"
|
49
|
-
]
|
50
|
-
|
51
|
-
if s.respond_to? :specification_version then
|
52
|
-
s.specification_version = 3
|
53
|
-
|
54
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
|
-
s.add_runtime_dependency(%q<rdiscount>, [">= 0"])
|
56
|
-
s.add_runtime_dependency(%q<jekyll>, [">= 0"])
|
57
|
-
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
58
|
-
s.add_runtime_dependency(%q<sdoc>, [">= 0"])
|
59
|
-
s.add_runtime_dependency(%q<sdoc-helpers>, [">= 0"])
|
60
|
-
s.add_runtime_dependency(%q<jekyll>, [">= 0.5.4"])
|
61
|
-
else
|
62
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
63
|
-
s.add_dependency(%q<jekyll>, [">= 0"])
|
64
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
65
|
-
s.add_dependency(%q<sdoc>, [">= 0"])
|
66
|
-
s.add_dependency(%q<sdoc-helpers>, [">= 0"])
|
67
|
-
s.add_dependency(%q<jekyll>, [">= 0.5.4"])
|
68
|
-
end
|
69
|
-
else
|
70
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
71
|
-
s.add_dependency(%q<jekyll>, [">= 0"])
|
72
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
73
|
-
s.add_dependency(%q<sdoc>, [">= 0"])
|
74
|
-
s.add_dependency(%q<sdoc-helpers>, [">= 0"])
|
75
|
-
s.add_dependency(%q<jekyll>, [">= 0.5.4"])
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
data/spec/lib/file_spec.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "File module" do
|
4
|
-
before(:all) do
|
5
|
-
FakeFS.activate!
|
6
|
-
end
|
7
|
-
after(:all) do
|
8
|
-
FakeFS.deactivate!
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should return file is text" do
|
12
|
-
File.open('/test/README', 'w') { |f| f.write 'N/A' }
|
13
|
-
Glynn::File.is_bin?('/test/README').should eql(true)
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return file is binary" do
|
17
|
-
File.open('/test/README', 'w') { |f| f.write ['0', '1', '2', '3'].pack('A3A3A3') }
|
18
|
-
Glynn::File.is_bin?('/test/README').should eql(true)
|
19
|
-
end
|
20
|
-
end
|
data/spec/lib/ftp_spec.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "FTP Interface" do
|
4
|
-
before(:each) do
|
5
|
-
# We mock the FTP server
|
6
|
-
@mock = mock('Ftp server').as_null_object
|
7
|
-
|
8
|
-
# And the puttextfile method
|
9
|
-
class Net::FTP
|
10
|
-
def puttextfile; true; end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should connect to ftp server' do
|
15
|
-
Net::FTP.should_receive(:open).with('localhost').and_return(@mock)
|
16
|
-
|
17
|
-
Glynn::Ftp.new('localhost').send(:connect) do |ftp|
|
18
|
-
ftp.should eql(@mock)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should login to ftp server' do
|
23
|
-
Net::FTP.should_receive(:open).with('localhost').and_return(@mock)
|
24
|
-
|
25
|
-
Glynn::Ftp.new('localhost').send(:connect) do |ftp|
|
26
|
-
@mock.should_receive(:login).with(nil, nil)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'should use the given port' do
|
31
|
-
Net::FTP.should_receive(:open).with('localhost').and_return(@mock)
|
32
|
-
|
33
|
-
Glynn::Ftp.new('localhost', 1234).send(:connect) do |ftp|
|
34
|
-
@mock.should_receive(:connect).with('localhost', 1234)
|
35
|
-
ftp.should eql(@mock)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should accept a username and password' do
|
40
|
-
Net::FTP.should_receive(:open).with('localhost').and_return(@mock)
|
41
|
-
|
42
|
-
Glynn::Ftp.new('localhost', 21, {:username => 'username', :password => 'password'}).send(:connect) do |ftp|
|
43
|
-
@mock.should_receive(:login).with('username', 'password')
|
44
|
-
ftp.should eql(@mock)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should recursively send a directory' do
|
49
|
-
# We expect NET/FTP to create every file
|
50
|
-
@mock.should_receive(:putbinaryfile).with('/test/README', '/blah/README').and_return(true)
|
51
|
-
@mock.should_receive(:putbinaryfile).with('/test/subdir/README', '/blah/subdir/README').and_return(true)
|
52
|
-
@mock.should_receive(:mkdir).with('/blah')
|
53
|
-
@mock.should_receive(:mkdir).with('/blah/subdir').twice
|
54
|
-
|
55
|
-
FakeFS do
|
56
|
-
# We create the fake files and directories
|
57
|
-
Dir.mkdir('/test') unless File.exists?('/test')
|
58
|
-
Dir.mkdir('/test/subdir') unless File.exists?('/test')
|
59
|
-
File.open('/test/README', 'w') { |f| f.write 'N/A' }
|
60
|
-
File.open('/test/subdir/README', 'w') { |f| f.write 'N/A' }
|
61
|
-
|
62
|
-
# And send them
|
63
|
-
Glynn::Ftp.new('localhost').send(:send_dir, @mock, '/test', '/blah')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'should connect itself to the server and send the local file to distant directory' do
|
68
|
-
FakeFS do
|
69
|
-
Net::FTP.should_receive(:open).with('localhost').and_return(@mock)
|
70
|
-
interface = Glynn::Ftp.new('localhost') do |ftp|
|
71
|
-
@mock.should_receive(:connect).with('localhost', 21)
|
72
|
-
@mock.should_receive(:login).with(nil, nil)
|
73
|
-
interface.should_receive(:send_dir).with(@mock, '/test', '/blah')
|
74
|
-
end
|
75
|
-
|
76
|
-
interface.sync '/test', '/blah'
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/spec/lib/jekyll_spec.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "Relation between glynn and jekyll" do
|
4
|
-
before(:all) do
|
5
|
-
FakeFS.activate!
|
6
|
-
File.open('/_config.yml', 'w') { |f| f.write 'auto: true' }
|
7
|
-
end
|
8
|
-
after(:all) do
|
9
|
-
FakeFS.deactivate!
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should create a new website' do
|
13
|
-
jekyll = Glynn::Jekyll.new({ 'source' => '/' })
|
14
|
-
jekyll.build
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should accept the ftp host option' do
|
18
|
-
File.open('/_config.yml', 'w') { |f| f.write 'ftp_host: example.com' }
|
19
|
-
options = Jekyll.configuration({'source' => '/'})
|
20
|
-
options['ftp_host'].should eql('example.com')
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should accept the fto dir option' do
|
24
|
-
File.open('/_config.yml', 'w') { |f| f.write 'ftp_dir: /home/glynn' }
|
25
|
-
options = Jekyll.configuration({'source' => '/'})
|
26
|
-
options['ftp_dir'].should eql('/home/glynn')
|
27
|
-
end
|
28
|
-
end
|
data/spec/spec.opts
DELETED