sitefuel 0.0.0b → 0.1.0a
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +81 -0
- data/{RELEASE_NOTES → RELEASE_NOTES.rdoc} +0 -0
- data/bin/sitefuel +64 -111
- data/lib/sitefuel/CommandLine.rb +142 -0
- data/lib/sitefuel/Configuration.rb +49 -13
- data/lib/sitefuel/License.rb +292 -0
- data/lib/sitefuel/SiteFuelLogger.rb +34 -5
- data/lib/sitefuel/SiteFuelRuntime.rb +217 -44
- data/lib/sitefuel/extensions/ArrayComparisons.rb +2 -2
- data/lib/sitefuel/extensions/ColumnPrinter.rb +276 -0
- data/lib/sitefuel/extensions/DynamicClassMethods.rb +2 -2
- data/lib/sitefuel/extensions/FileComparison.rb +2 -2
- data/lib/sitefuel/extensions/FileTree.rb +94 -0
- data/lib/sitefuel/extensions/Silently.rb +2 -2
- data/lib/sitefuel/extensions/StringFormatting.rb +52 -8
- data/lib/sitefuel/extensions/SymbolComparison.rb +4 -2
- data/lib/sitefuel/extensions/TerminalInfo.rb +53 -0
- data/lib/sitefuel/external/AbstractExternalProgram.rb +65 -11
- data/lib/sitefuel/external/ExternalProgramTestCase.rb +2 -2
- data/lib/sitefuel/external/GIT.rb +50 -3
- data/lib/sitefuel/external/JPEGTran.rb +2 -2
- data/lib/sitefuel/external/PNGCrush.rb +2 -2
- data/lib/sitefuel/external/SVN.rb +57 -0
- data/lib/sitefuel/processors/AbstractExternalProgramProcessor.rb +17 -4
- data/lib/sitefuel/processors/AbstractProcessor.rb +64 -47
- data/lib/sitefuel/processors/AbstractStringBasedProcessor.rb +20 -3
- data/lib/sitefuel/processors/CSSProcessor.rb +2 -2
- data/lib/sitefuel/processors/Configurable.rb +94 -0
- data/lib/sitefuel/processors/HAMLProcessor.rb +4 -4
- data/lib/sitefuel/processors/HTMLProcessor.rb +2 -2
- data/lib/sitefuel/processors/JavaScriptProcessor.rb +2 -2
- data/lib/sitefuel/processors/PHPProcessor.rb +2 -2
- data/lib/sitefuel/processors/PNGProcessor.rb +2 -2
- data/lib/sitefuel/processors/RHTMLProcessor.rb +2 -2
- data/lib/sitefuel/processors/SASSProcessor.rb +4 -4
- data/test/{test_images → images}/sample_jpg01.jpg +0 -0
- data/test/{test_images → images}/sample_png01.png +0 -0
- data/test/processor_listing.rb +2 -2
- data/test/{test_programs → programs}/versioning.rb +2 -2
- data/test/repositories/git/few_files/deployment.yml +0 -0
- data/test/repositories/git/few_files/index.html +10 -0
- data/test/repositories/git/few_files/style.css +2 -0
- data/test/repositories/svn/testrepo1/README.txt +5 -0
- data/test/repositories/svn/testrepo1/conf/authz +32 -0
- data/test/repositories/svn/testrepo1/conf/passwd +8 -0
- data/test/repositories/svn/testrepo1/conf/svnserve.conf +47 -0
- data/test/repositories/svn/testrepo1/db/current +1 -0
- data/test/repositories/svn/testrepo1/db/format +2 -0
- data/test/repositories/svn/testrepo1/db/fs-type +1 -0
- data/test/repositories/svn/testrepo1/db/fsfs.conf +37 -0
- data/test/repositories/svn/testrepo1/db/min-unpacked-rev +1 -0
- data/test/repositories/svn/testrepo1/db/rep-cache.db +0 -0
- data/test/repositories/svn/testrepo1/db/revprops/0/0 +5 -0
- data/test/repositories/svn/testrepo1/db/revprops/0/1 +13 -0
- data/test/repositories/svn/testrepo1/db/revs/0/0 +11 -0
- data/test/repositories/svn/testrepo1/db/revs/0/1 +0 -0
- data/test/repositories/svn/testrepo1/db/txn-current +1 -0
- data/test/repositories/svn/testrepo1/db/txn-current-lock +0 -0
- data/test/repositories/svn/testrepo1/db/uuid +1 -0
- data/test/repositories/svn/testrepo1/db/write-lock +0 -0
- data/test/repositories/svn/testrepo1/format +1 -0
- data/test/repositories/svn/testrepo1/hooks/post-commit.tmpl +50 -0
- data/test/repositories/svn/testrepo1/hooks/post-lock.tmpl +45 -0
- data/test/repositories/svn/testrepo1/hooks/post-revprop-change.tmpl +57 -0
- data/test/repositories/svn/testrepo1/hooks/post-unlock.tmpl +43 -0
- data/test/repositories/svn/testrepo1/hooks/pre-commit.tmpl +85 -0
- data/test/repositories/svn/testrepo1/hooks/pre-lock.tmpl +71 -0
- data/test/repositories/svn/testrepo1/hooks/pre-revprop-change.tmpl +66 -0
- data/test/repositories/svn/testrepo1/hooks/pre-unlock.tmpl +63 -0
- data/test/repositories/svn/testrepo1/hooks/start-commit.tmpl +68 -0
- data/test/repositories/svn/testrepo1/locks/db-logs.lock +3 -0
- data/test/repositories/svn/testrepo1/locks/db.lock +3 -0
- data/test/sites/simplehtml/deployment.yml +19 -0
- data/test/{test_sites → sites}/simplehtml/index.html +0 -0
- data/test/{test_sites → sites}/simplehtml/style.css +0 -0
- data/test/sites/sitefuelteaser/deployment.yml +13 -0
- data/test/sites/sitefuelteaser/img/hd.png +0 -0
- data/test/sites/sitefuelteaser/img/logo.png +0 -0
- data/test/sites/sitefuelteaser/img/uses-sitefuel.png +0 -0
- data/test/sites/sitefuelteaser/index.html +1 -1
- data/test/sites/sitefuelteaser/master.css +18 -0
- data/test/test_AbstractExternalProgram.rb +5 -5
- data/test/test_AbstractProcessor.rb +4 -4
- data/test/test_AbstractStringBasedProcessor.rb +2 -2
- data/test/test_AllProcessors.rb +4 -4
- data/test/test_ArrayComparisons.rb +4 -4
- data/test/test_CSSProcessor.rb +4 -4
- data/test/test_ColumnPrinter.rb +40 -0
- data/test/test_Configurable.rb +106 -0
- data/test/test_FileComparisons.rb +4 -4
- data/test/test_GIT.rb +41 -0
- data/test/{test_HAMLProcessor.rb.rb → test_HAMLProcessor.rb} +4 -4
- data/test/test_HTMLProcessor.rb +4 -4
- data/test/test_JPEGTran.rb +4 -4
- data/test/test_JavaScriptProcessor.rb +3 -2
- data/test/test_PHPProcessor.rb +4 -4
- data/test/test_PNGCrush.rb +8 -8
- data/test/test_PNGProcessor.rb +5 -5
- data/test/test_RHTMLProcessor.rb +4 -4
- data/test/test_SASSProcessor.rb +4 -4
- data/test/test_SVN.rb +44 -0
- data/test/test_SiteFuelLogging.rb +4 -4
- data/test/test_SiteFuelRuntime.rb +42 -4
- data/test/test_StringFormatting.rb +27 -4
- data/test/test_SymbolComparison.rb +4 -4
- data/test/ts_all.rb +2 -2
- metadata +94 -20
- data/README +0 -86
- data/test/test_sites/simplehtml/deployment.yml +0 -22
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_FileComparisons.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for File.equivalent? class method. The method is
|
8
8
|
# heuristic based so lots of tests are needed, although perhaps
|
data/test/test_GIT.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# File:: test_GIT.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
|
+
#
|
7
|
+
# Unit tests for the Git version system abstraction
|
8
|
+
#
|
9
|
+
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
11
|
+
|
12
|
+
require 'test/unit'
|
13
|
+
require 'sitefuel/external/GIT'
|
14
|
+
|
15
|
+
include SiteFuel::External
|
16
|
+
|
17
|
+
class GIT
|
18
|
+
def self.capture_stderr
|
19
|
+
true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class TestGIT < Test::Unit::TestCase
|
24
|
+
TEST_REPOSITORIES = File.join(File.dirname(__FILE__), 'repositories', 'git')
|
25
|
+
|
26
|
+
def test_checkout
|
27
|
+
dir = GIT.shallow_clone(File.join(TEST_REPOSITORIES, 'few_files'))
|
28
|
+
files = Dir[File.join(dir, "**/*")]
|
29
|
+
files.collect! do |f|
|
30
|
+
File.basename(f)
|
31
|
+
end
|
32
|
+
|
33
|
+
assert files.include? 'style.css'
|
34
|
+
assert files.include? 'deployment.yml'
|
35
|
+
assert files.include? 'index.html'
|
36
|
+
|
37
|
+
assert_raises(ProgramExitedWithFailure) do
|
38
|
+
GIT.shallow_clone File.join(TEST_REPOSITORIES, 'this_repo_no_exist')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_HAMLProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the HAMLProcessor
|
8
8
|
#
|
data/test/test_HTMLProcessor.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_HTMLProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the HTMLProcessor
|
8
8
|
#
|
data/test/test_JPEGTran.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# File:: test_JPEGTran.rb
|
3
3
|
# Author:: wkm
|
4
|
-
# Copyright:: 2009
|
5
|
-
# License:: GPL
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the JPEGTran wrapper.
|
8
8
|
#
|
@@ -17,7 +17,7 @@ include SiteFuel::External
|
|
17
17
|
class TestJPEGTran < Test::Unit::TestCase
|
18
18
|
include ExternalProgramTestCase
|
19
19
|
|
20
|
-
SAMPLE_IMAGE = 'test/
|
20
|
+
SAMPLE_IMAGE = 'test/images/sample_jpg01.jpg'
|
21
21
|
|
22
22
|
def test_options
|
23
23
|
assert JPEGTran.option?(:version)
|
@@ -31,7 +31,7 @@ class TestJPEGTran < Test::Unit::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_lossless
|
34
|
-
new_image = 'test/
|
34
|
+
new_image = 'test/images/tmp-sample_jpg01-lossless.jpg'
|
35
35
|
JPEGTran.compress_losslessly SAMPLE_IMAGE, new_image
|
36
36
|
|
37
37
|
|
data/test/test_PHPProcessor.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_PHPProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the PHPProcessor
|
8
8
|
#
|
data/test/test_PNGCrush.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_PNGCrush.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the PNGCrush wrapper.
|
8
8
|
#
|
@@ -17,7 +17,7 @@ include SiteFuel::External
|
|
17
17
|
class TestPNGCrush < Test::Unit::TestCase
|
18
18
|
include ExternalProgramTestCase
|
19
19
|
|
20
|
-
SAMPLE_IMAGE = 'test/
|
20
|
+
SAMPLE_IMAGE = 'test/images/sample_png01.png'
|
21
21
|
|
22
22
|
def test_option
|
23
23
|
# test that we have all options
|
@@ -34,7 +34,7 @@ class TestPNGCrush < Test::Unit::TestCase
|
|
34
34
|
|
35
35
|
def test_brute
|
36
36
|
# test the crush capability against one of the test files
|
37
|
-
new_image = './test/
|
37
|
+
new_image = './test/images/tmp-sample_png01-brute.png'
|
38
38
|
PNGCrush.brute SAMPLE_IMAGE, new_image
|
39
39
|
|
40
40
|
assert File.size(SAMPLE_IMAGE) > File.size(new_image)
|
@@ -42,14 +42,14 @@ class TestPNGCrush < Test::Unit::TestCase
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_quick
|
45
|
-
new_image = './test/
|
45
|
+
new_image = './test/images/tmp-sample_png01-quick.png'
|
46
46
|
PNGCrush.quick SAMPLE_IMAGE, new_image
|
47
47
|
|
48
48
|
assert File.size(SAMPLE_IMAGE) > File.size(new_image)
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_chainsaw
|
52
|
-
new_image = './test/
|
52
|
+
new_image = './test/images/tmp-sample_png01-chainsaw.png'
|
53
53
|
PNGCrush.chainsaw SAMPLE_IMAGE, new_image
|
54
54
|
|
55
55
|
assert File.size(SAMPLE_IMAGE) > File.size(new_image)
|
data/test/test_PNGProcessor.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_PNGProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the PNGProcessor
|
8
8
|
#
|
@@ -27,6 +27,6 @@ class TestPNGProcessor < Test::Unit::TestCase
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_crush
|
30
|
-
PNGProcessor.process_file('test/
|
30
|
+
PNGProcessor.process_file('test/images/sample_png01.png')
|
31
31
|
end
|
32
32
|
end
|
data/test/test_RHTMLProcessor.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_RHTMLProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the RHTMLProcessor
|
8
8
|
#
|
data/test/test_SASSProcessor.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_SASSProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the SASSProcessor
|
8
8
|
#
|
data/test/test_SVN.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# File:: test_SVN.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
|
+
#
|
7
|
+
# Unit tests for the SVN version system abstraction
|
8
|
+
#
|
9
|
+
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
11
|
+
|
12
|
+
require 'test/unit'
|
13
|
+
require 'sitefuel/external/SVN'
|
14
|
+
|
15
|
+
include SiteFuel::External
|
16
|
+
|
17
|
+
# just for testing we capture stderr since the negative tests
|
18
|
+
# get rather verbose
|
19
|
+
class SVN
|
20
|
+
def self.capture_stderr
|
21
|
+
true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class TestSVN < Test::Unit::TestCase
|
26
|
+
TEST_REPOSITORIES = File.expand_path(File.join(File.dirname(__FILE__), 'repositories', 'svn'))
|
27
|
+
|
28
|
+
def test_checkout
|
29
|
+
dir = SVN.export 'file://'+File.join(TEST_REPOSITORIES, 'testrepo1')
|
30
|
+
files = Dir[File.join(dir, "**/*")].map do |f|
|
31
|
+
File.basename(f)
|
32
|
+
end
|
33
|
+
|
34
|
+
assert files.include? 'style.css'
|
35
|
+
assert files.include? 'deployment.yml'
|
36
|
+
assert files.include? 'index.html'
|
37
|
+
|
38
|
+
|
39
|
+
# now let's test a checkout where the repo doesn't exist...
|
40
|
+
assert_raises(ProgramExitedWithFailure) do
|
41
|
+
SVN.export 'file://'+File.join(TEST_REPOSITORIES, 'nonexistentrepo')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_SiteFuelLogging.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the sitefuel logging class
|
8
8
|
#
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_SiteFuelRuntime.m
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the SiteFuelRuntime class.
|
8
8
|
#
|
@@ -91,6 +91,44 @@ class TestSiteFuelRuntime < Test::Unit::TestCase
|
|
91
91
|
assert_equal warnings+1, SiteFuelLogger.instance.warn_count
|
92
92
|
|
93
93
|
assert_equal Processor::HTMLProcessor, @runtime.choose_processor("foo.htm")
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
def test_repository_system_classification
|
98
|
+
assert_equal :git, @runtime.classify_repository_system('ssh://host/path/repo.git')
|
99
|
+
assert_equal :git, @runtime.classify_repository_system('SSH://host/path/repo.git')
|
100
|
+
assert_equal :git, @runtime.classify_repository_system('git://host/path/repo')
|
101
|
+
assert_equal :git, @runtime.classify_repository_system('GIT://host/path/repo')
|
102
|
+
assert_equal :git, @runtime.classify_repository_system('rsync://host/path/repo')
|
103
|
+
assert_equal :git, @runtime.classify_repository_system('RSYNC://host/path/repo')
|
104
|
+
|
105
|
+
|
106
|
+
assert_equal :svn, @runtime.classify_repository_system('svn+ssh://host/path/repo')
|
107
|
+
assert_equal :svn, @runtime.classify_repository_system('SVN+ssh://host/path/repo')
|
108
|
+
assert_equal :svn, @runtime.classify_repository_system('SVN://host/path/repo')
|
109
|
+
assert_equal :svn, @runtime.classify_repository_system('svn://host/path/repo')
|
110
|
+
assert_equal :svn, @runtime.classify_repository_system('FILE://path/repo')
|
111
|
+
assert_equal :svn, @runtime.classify_repository_system('file:///path/repo')
|
112
|
+
|
113
|
+
# if it ends with .git, it's GIT
|
114
|
+
assert_equal :git, @runtime.classify_repository_system('host/path/repo.git')
|
115
|
+
assert_equal :git, @runtime.classify_repository_system('http://host/path/repo.git')
|
116
|
+
assert_equal :git, @runtime.classify_repository_system('https://host/path/repo.git')
|
117
|
+
|
118
|
+
# vanilla file system deployments
|
119
|
+
assert_equal :filesystem, @runtime.classify_repository_system('./dir')
|
120
|
+
assert_equal :filesystem, @runtime.classify_repository_system('/var/www/dir')
|
121
|
+
assert_equal :filesystem, @runtime.classify_repository_system('dir/')
|
122
|
+
assert_equal :filesystem, @runtime.classify_repository_system('../.dir/')
|
123
|
+
assert_equal :filesystem, @runtime.classify_repository_system('../.dir/somehandle')
|
124
|
+
|
125
|
+
# these shouldn't be classified, or are ambiguous
|
126
|
+
assert_raises(UnknownVersioningSystem) do
|
127
|
+
@runtime.classify_repository_system('http://host/repo')
|
128
|
+
end
|
129
|
+
assert_raises(UnknownVersioningSystem) do
|
130
|
+
@runtime.classify_repository_system('https://host/repo')
|
131
|
+
end
|
94
132
|
|
95
133
|
end
|
96
134
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_StringFormatting.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for String#cabbrev, String#labbrev, and String#rabbrev
|
8
8
|
# methods. The main thing these look for is off-by-one errors.
|
@@ -10,6 +10,10 @@
|
|
10
10
|
|
11
11
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
12
12
|
|
13
|
+
require 'term/ansicolor'
|
14
|
+
|
15
|
+
include Term::ANSIColor
|
16
|
+
|
13
17
|
require 'test/unit'
|
14
18
|
require 'sitefuel/extensions/StringFormatting'
|
15
19
|
|
@@ -48,4 +52,23 @@ class TestString < Test::Unit::TestCase
|
|
48
52
|
}.align
|
49
53
|
)
|
50
54
|
end
|
55
|
+
|
56
|
+
def test_visual_length
|
57
|
+
assert_equal(
|
58
|
+
'hello world'.length,
|
59
|
+
'hello world'.visual_length
|
60
|
+
)
|
61
|
+
|
62
|
+
assert_equal(
|
63
|
+
'hello world'.length,
|
64
|
+
'hello world'.blue.visual_length
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_visual_ljust
|
69
|
+
assert_equal(
|
70
|
+
'123'.ljust(5),
|
71
|
+
'123'.blue.visual_ljust(5).uncolored
|
72
|
+
)
|
73
|
+
end
|
51
74
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: test_SymbolComparisons.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# Unit tests for the spaceship method and hence sorting of symbols
|
8
8
|
#
|
data/test/ts_all.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitefuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wkm
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-30 00:00:00 -06:00
|
13
13
|
default_executable: sitefuel
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -53,8 +53,8 @@ dependencies:
|
|
53
53
|
version: "2.2"
|
54
54
|
version:
|
55
55
|
description: |
|
56
|
-
SiteFuel is a program and lightweight
|
57
|
-
behind
|
56
|
+
SiteFuel is a Ruby program and lightweight API for processing the source code
|
57
|
+
behind your static and dynamic websites. SiteFuel can remove comments and
|
58
58
|
unneeded whitespace from your CSS, HTML, and JavaScript files (as well as
|
59
59
|
fragments in RHTML and PHP) files. It can also losslessly compress your PNG and
|
60
60
|
JPEG images. SiteFuel can also deploy your website from SVN or GIT. Support for
|
@@ -66,75 +66,149 @@ executables:
|
|
66
66
|
extensions: []
|
67
67
|
|
68
68
|
extra_rdoc_files:
|
69
|
-
- README
|
70
|
-
- RELEASE_NOTES
|
69
|
+
- README.rdoc
|
70
|
+
- RELEASE_NOTES.rdoc
|
71
71
|
files:
|
72
72
|
- bin/sitefuel
|
73
73
|
- test/test_AbstractExternalProgram.rb
|
74
|
+
- test/programs/versioning.rb
|
74
75
|
- test/test_RHTMLProcessor.rb
|
75
76
|
- test/processor_listing.rb
|
77
|
+
- test/test_HAMLProcessor.rb
|
78
|
+
- test/repositories/git/few_files/style.css
|
79
|
+
- test/repositories/git/few_files/deployment.yml
|
80
|
+
- test/repositories/git/few_files/index.html
|
81
|
+
- test/repositories/svn/testrepo1/conf/svnserve.conf
|
82
|
+
- test/repositories/svn/testrepo1/conf/passwd
|
83
|
+
- test/repositories/svn/testrepo1/conf/authz
|
84
|
+
- test/repositories/svn/testrepo1/README.txt
|
85
|
+
- test/repositories/svn/testrepo1/hooks/start-commit.tmpl
|
86
|
+
- test/repositories/svn/testrepo1/hooks/post-commit.tmpl
|
87
|
+
- test/repositories/svn/testrepo1/hooks/pre-commit.tmpl
|
88
|
+
- test/repositories/svn/testrepo1/hooks/pre-revprop-change.tmpl
|
89
|
+
- test/repositories/svn/testrepo1/hooks/post-lock.tmpl
|
90
|
+
- test/repositories/svn/testrepo1/hooks/pre-lock.tmpl
|
91
|
+
- test/repositories/svn/testrepo1/hooks/pre-unlock.tmpl
|
92
|
+
- test/repositories/svn/testrepo1/hooks/post-unlock.tmpl
|
93
|
+
- test/repositories/svn/testrepo1/hooks/post-revprop-change.tmpl
|
94
|
+
- test/repositories/svn/testrepo1/locks/db-logs.lock
|
95
|
+
- test/repositories/svn/testrepo1/locks/db.lock
|
96
|
+
- test/repositories/svn/testrepo1/format
|
97
|
+
- test/repositories/svn/testrepo1/db/revprops/0/1
|
98
|
+
- test/repositories/svn/testrepo1/db/revprops/0/0
|
99
|
+
- test/repositories/svn/testrepo1/db/write-lock
|
100
|
+
- test/repositories/svn/testrepo1/db/current
|
101
|
+
- test/repositories/svn/testrepo1/db/format
|
102
|
+
- test/repositories/svn/testrepo1/db/fs-type
|
103
|
+
- test/repositories/svn/testrepo1/db/uuid
|
104
|
+
- test/repositories/svn/testrepo1/db/fsfs.conf
|
105
|
+
- test/repositories/svn/testrepo1/db/rep-cache.db
|
106
|
+
- test/repositories/svn/testrepo1/db/revs/0/1
|
107
|
+
- test/repositories/svn/testrepo1/db/revs/0/0
|
108
|
+
- test/repositories/svn/testrepo1/db/min-unpacked-rev
|
109
|
+
- test/repositories/svn/testrepo1/db/txn-current
|
110
|
+
- test/repositories/svn/testrepo1/db/txn-current-lock
|
111
|
+
- test/images/sample_png01.png
|
112
|
+
- test/images/sample_jpg01.jpg
|
76
113
|
- test/test_AllProcessors.rb
|
77
114
|
- test/test_SymbolComparison.rb
|
115
|
+
- test/test_GIT.rb
|
116
|
+
- test/sites/sitefuelteaser/img/logo.png
|
117
|
+
- test/sites/sitefuelteaser/img/hd.png
|
118
|
+
- test/sites/sitefuelteaser/img/uses-sitefuel.png
|
119
|
+
- test/sites/sitefuelteaser/deployment.yml
|
120
|
+
- test/sites/sitefuelteaser/master.css
|
121
|
+
- test/sites/sitefuelteaser/index.html
|
122
|
+
- test/sites/simplehtml/style.css
|
123
|
+
- test/sites/simplehtml/deployment.yml
|
124
|
+
- test/sites/simplehtml/index.html
|
78
125
|
- test/test_PNGProcessor.rb
|
79
126
|
- test/test_CSSProcessor.rb
|
80
|
-
- test/
|
81
|
-
- test/test_images/sample_jpg01.jpg
|
127
|
+
- test/test_Configurable.rb
|
82
128
|
- test/test_ArrayComparisons.rb
|
83
129
|
- test/ts_all.rb
|
84
130
|
- test/test_SiteFuelRuntime.rb
|
85
131
|
- test/test_AbstractStringBasedProcessor.rb
|
86
132
|
- test/test_SiteFuelLogging.rb
|
87
133
|
- test/test_AbstractProcessor.rb
|
88
|
-
- test/test_sites/simplehtml/style.css
|
89
|
-
- test/test_sites/simplehtml/deployment.yml
|
90
|
-
- test/test_sites/simplehtml/index.html
|
91
134
|
- test/test_JavaScriptProcessor.rb
|
92
135
|
- test/test_SASSProcessor.rb
|
93
|
-
- test/
|
136
|
+
- test/test_SVN.rb
|
94
137
|
- test/test_FileComparisons.rb
|
95
|
-
- test/
|
138
|
+
- test/test_ColumnPrinter.rb
|
96
139
|
- test/test_HTMLProcessor.rb
|
97
140
|
- test/test_StringFormatting.rb
|
98
141
|
- test/test_PHPProcessor.rb
|
99
142
|
- test/test_JPEGTran.rb
|
100
143
|
- test/test_PNGCrush.rb
|
144
|
+
- lib/sitefuel/License.rb
|
101
145
|
- lib/sitefuel/SiteFuelRuntime.rb
|
102
146
|
- lib/sitefuel/extensions/DynamicClassMethods.rb
|
103
147
|
- lib/sitefuel/extensions/ArrayComparisons.rb
|
104
148
|
- lib/sitefuel/extensions/Silently.rb
|
105
149
|
- lib/sitefuel/extensions/SymbolComparison.rb
|
106
150
|
- lib/sitefuel/extensions/StringFormatting.rb
|
151
|
+
- lib/sitefuel/extensions/TerminalInfo.rb
|
152
|
+
- lib/sitefuel/extensions/ColumnPrinter.rb
|
107
153
|
- lib/sitefuel/extensions/FileComparison.rb
|
154
|
+
- lib/sitefuel/extensions/FileTree.rb
|
108
155
|
- lib/sitefuel/processors/AbstractStringBasedProcessor.rb
|
109
156
|
- lib/sitefuel/processors/HTMLProcessor.rb
|
110
157
|
- lib/sitefuel/processors/CSSProcessor.rb
|
111
158
|
- lib/sitefuel/processors/JavaScriptProcessor.rb
|
112
159
|
- lib/sitefuel/processors/PNGProcessor.rb
|
113
160
|
- lib/sitefuel/processors/PHPProcessor.rb
|
161
|
+
- lib/sitefuel/processors/Configurable.rb
|
114
162
|
- lib/sitefuel/processors/AbstractProcessor.rb
|
115
163
|
- lib/sitefuel/processors/RHTMLProcessor.rb
|
116
164
|
- lib/sitefuel/processors/SASSProcessor.rb
|
117
165
|
- lib/sitefuel/processors/HAMLProcessor.rb
|
118
166
|
- lib/sitefuel/processors/AbstractExternalProgramProcessor.rb
|
167
|
+
- lib/sitefuel/CommandLine.rb
|
119
168
|
- lib/sitefuel/Configuration.rb
|
120
169
|
- lib/sitefuel/external/PNGCrush.rb
|
121
170
|
- lib/sitefuel/external/ExternalProgramTestCase.rb
|
171
|
+
- lib/sitefuel/external/SVN.rb
|
122
172
|
- lib/sitefuel/external/JPEGTran.rb
|
123
173
|
- lib/sitefuel/external/AbstractExternalProgram.rb
|
124
174
|
- lib/sitefuel/external/GIT.rb
|
125
175
|
- lib/sitefuel/SiteFuelLogger.rb
|
126
|
-
- README
|
127
|
-
- RELEASE_NOTES
|
176
|
+
- README.rdoc
|
177
|
+
- RELEASE_NOTES.rdoc
|
128
178
|
has_rdoc: true
|
129
179
|
homepage: http://sitefuel.org
|
130
180
|
licenses: []
|
131
181
|
|
132
182
|
post_install_message: |
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
183
|
+
======================================================
|
184
|
+
Thank you for installing SiteFuel 0.1.0.
|
185
|
+
|
186
|
+
Please use caution when using this version of
|
187
|
+
SiteFuel to deploy your websites. This should be
|
188
|
+
considered an alpha release of SiteFuel and there
|
189
|
+
may be bugs which will destroy your code.
|
190
|
+
|
191
|
+
To get started see http://sitefuel.org/getstarted
|
192
|
+
|
193
|
+
SiteFuel comes as an executable program:
|
194
|
+
|
195
|
+
$ sitefuel --help
|
196
|
+
$ sitefuel stage website_source
|
197
|
+
$ sitefuel deploy website_source webserver_directory
|
198
|
+
|
199
|
+
And also as a Ruby library:
|
200
|
+
|
201
|
+
require 'rubygems'
|
202
|
+
require 'sitefuel'
|
203
|
+
|
204
|
+
runtime = SiteFuel::SiteFuelRuntime.new
|
205
|
+
# ...
|
206
|
+
|
207
|
+
If you're installing on Ubuntu you may need to adjust
|
208
|
+
your $PATH environment variable for programs
|
209
|
+
distributed with gems to work.
|
210
|
+
(see http://sitefuel.org/ubuntu_installation)
|
211
|
+
|
138
212
|
=======================================================
|
139
213
|
|
140
214
|
rdoc_options: []
|