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
2
|
# File:: AbstractStringBasedProcessor.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
|
# Defines an abstract processor that runs by loading an entire file into
|
8
8
|
# memory as a string. Since most files we're looking at are very small
|
@@ -21,6 +21,10 @@ module SiteFuel
|
|
21
21
|
'String'
|
22
22
|
end
|
23
23
|
|
24
|
+
def processor_symbol
|
25
|
+
'S'
|
26
|
+
end
|
27
|
+
|
24
28
|
# lightweight wrapper for opening a resource and generating the file
|
25
29
|
def self.process_file(filename, config = {})
|
26
30
|
proc = self.new()
|
@@ -50,6 +54,8 @@ module SiteFuel
|
|
50
54
|
|
51
55
|
# opens a resource from a file
|
52
56
|
def open_file(filename)
|
57
|
+
info "#{self.class} opening #{filename}"
|
58
|
+
|
53
59
|
self.document = File.read(filename)
|
54
60
|
self.original_size = File.size(filename)
|
55
61
|
self.resource_name = filename
|
@@ -59,9 +65,11 @@ module SiteFuel
|
|
59
65
|
|
60
66
|
# opens a resource directly from a string
|
61
67
|
def open_string(string)
|
68
|
+
info "#{self.class} opening in embedded mode"
|
69
|
+
|
62
70
|
self.document = string
|
63
71
|
self.original_size = string.length
|
64
|
-
self.resource_name = '<<
|
72
|
+
self.resource_name = '<<embedded string>>'
|
65
73
|
end
|
66
74
|
|
67
75
|
# generates the actual string
|
@@ -77,6 +85,15 @@ module SiteFuel
|
|
77
85
|
generate_string
|
78
86
|
return self
|
79
87
|
end
|
88
|
+
|
89
|
+
def save(file_tree)
|
90
|
+
file_name = create_file(file_tree)
|
91
|
+
File.open(file_name, 'w') do |file|
|
92
|
+
file << @document
|
93
|
+
end
|
94
|
+
|
95
|
+
info "Wrote document into #{file}"
|
96
|
+
end
|
80
97
|
|
81
98
|
attr_reader :document
|
82
99
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# File:: CSSProcessor.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
|
# Rather lightweight CSS processor; primarily intended to minify CSS, but has
|
8
8
|
# basic support for beautifcation as well
|
@@ -0,0 +1,94 @@
|
|
1
|
+
#
|
2
|
+
# File:: Configurable.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
|
+
#
|
7
|
+
# Implements a general abstraction for configuring a class instance
|
8
|
+
#
|
9
|
+
|
10
|
+
module SiteFuel
|
11
|
+
module Processor
|
12
|
+
module Configurable
|
13
|
+
|
14
|
+
class UnknownConfigurationOption < StandardError
|
15
|
+
attr_reader :class_name, :option_name
|
16
|
+
def initialize(class_name, option_name)
|
17
|
+
@class_name = class_name
|
18
|
+
@option_name = option_name
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_s
|
22
|
+
"Class #{class_name} has no known option '#{option_name}'"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
# gives a list of all configurable options for this class
|
29
|
+
def configuration_options
|
30
|
+
names = methods.map do |name|
|
31
|
+
if name =~ /^configure_(.*)$/
|
32
|
+
$1.to_sym
|
33
|
+
else
|
34
|
+
nil
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
names.compact
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def pre_configuration
|
43
|
+
# stub to be overriden by child classes
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def post_configuration
|
48
|
+
# stub to be overriden by child classes
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
# configures a particular instance given a hash; runs #pre_configuration
|
53
|
+
# before running any particular config method and #post_configuration
|
54
|
+
# afterwards
|
55
|
+
def configure(config = {})
|
56
|
+
pre_configuration
|
57
|
+
|
58
|
+
unless config == nil or config == {}
|
59
|
+
config.each_pair do |k, v|
|
60
|
+
set_configuration(k, v)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
post_configuration
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
# ensures the given option name is configurable; otherwise
|
69
|
+
# raises a UnknownConfigurationOption exception
|
70
|
+
def ensure_configurable_option (name)
|
71
|
+
if configuration_options.include?(name.to_sym)
|
72
|
+
return true
|
73
|
+
else
|
74
|
+
raise UnknownConfigurationOption.new(self.class, name)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
# sets the configuration for a single option
|
80
|
+
def set_configuration(key, value)
|
81
|
+
ensure_configurable_option(key)
|
82
|
+
method = "configure_" + key.to_s
|
83
|
+
|
84
|
+
case value
|
85
|
+
when Array
|
86
|
+
send(method.to_sym, *value)
|
87
|
+
|
88
|
+
else
|
89
|
+
send(method.to_sym, value)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: HAMLProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# processes .haml source files to generate the associated HTML
|
8
8
|
#
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# File:: HTMLProcessor.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
|
# Defines an HTMLProcessor class that is used to compress and cleanup HTML
|
8
8
|
# files for deployment with sitefuel. Uses hpricot to process the HTML.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# File:: PHPProcessor.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
|
# Defines a PHPProcessor class; but it's really a very lightweight alias
|
8
8
|
# around the HTMLProcessor
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# File:: RHTMLProcessor.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
|
# Defines the RHTMLProcessor class. This is a lightweight wrapper
|
8
8
|
# around the HTMLProcessor class
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
|
-
# File::
|
3
|
-
# Author::
|
4
|
-
# Copyright::
|
5
|
-
# License::
|
2
|
+
# File:: SASSProcessor.rb
|
3
|
+
# Author:: wkm
|
4
|
+
# Copyright:: 2009, Zanoccio LLC.
|
5
|
+
# License:: GPL version 2.0 (see LICENSE.rb)
|
6
6
|
#
|
7
7
|
# processes .sass stylesheets to generate the associated CSS
|
8
8
|
#
|
File without changes
|
File without changes
|
data/test/processor_listing.rb
CHANGED
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
### This file is an example authorization file for svnserve.
|
2
|
+
### Its format is identical to that of mod_authz_svn authorization
|
3
|
+
### files.
|
4
|
+
### As shown below each section defines authorizations for the path and
|
5
|
+
### (optional) repository specified by the section name.
|
6
|
+
### The authorizations follow. An authorization line can refer to:
|
7
|
+
### - a single user,
|
8
|
+
### - a group of users defined in a special [groups] section,
|
9
|
+
### - an alias defined in a special [aliases] section,
|
10
|
+
### - all authenticated users, using the '$authenticated' token,
|
11
|
+
### - only anonymous users, using the '$anonymous' token,
|
12
|
+
### - anyone, using the '*' wildcard.
|
13
|
+
###
|
14
|
+
### A match can be inverted by prefixing the rule with '~'. Rules can
|
15
|
+
### grant read ('r') access, read-write ('rw') access, or no access
|
16
|
+
### ('').
|
17
|
+
|
18
|
+
[aliases]
|
19
|
+
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
|
20
|
+
|
21
|
+
[groups]
|
22
|
+
# harry_and_sally = harry,sally
|
23
|
+
# harry_sally_and_joe = harry,sally,&joe
|
24
|
+
|
25
|
+
# [/foo/bar]
|
26
|
+
# harry = rw
|
27
|
+
# &joe = r
|
28
|
+
# * =
|
29
|
+
|
30
|
+
# [repository:/baz/fuz]
|
31
|
+
# @harry_and_sally = rw
|
32
|
+
# * = r
|
@@ -0,0 +1,8 @@
|
|
1
|
+
### This file is an example password file for svnserve.
|
2
|
+
### Its format is similar to that of svnserve.conf. As shown in the
|
3
|
+
### example below it contains one section labelled [users].
|
4
|
+
### The name and password for each user follow, one account per line.
|
5
|
+
|
6
|
+
[users]
|
7
|
+
# harry = harryssecret
|
8
|
+
# sally = sallyssecret
|
@@ -0,0 +1,47 @@
|
|
1
|
+
### This file controls the configuration of the svnserve daemon, if you
|
2
|
+
### use it to allow access to this repository. (If you only allow
|
3
|
+
### access through http: and/or file: URLs, then this file is
|
4
|
+
### irrelevant.)
|
5
|
+
|
6
|
+
### Visit http://subversion.tigris.org/ for more information.
|
7
|
+
|
8
|
+
[general]
|
9
|
+
### These options control access to the repository for unauthenticated
|
10
|
+
### and authenticated users. Valid values are "write", "read",
|
11
|
+
### and "none". The sample settings below are the defaults.
|
12
|
+
# anon-access = read
|
13
|
+
# auth-access = write
|
14
|
+
### The password-db option controls the location of the password
|
15
|
+
### database file. Unless you specify a path starting with a /,
|
16
|
+
### the file's location is relative to the directory containing
|
17
|
+
### this configuration file.
|
18
|
+
### If SASL is enabled (see below), this file will NOT be used.
|
19
|
+
### Uncomment the line below to use the default password file.
|
20
|
+
# password-db = passwd
|
21
|
+
### The authz-db option controls the location of the authorization
|
22
|
+
### rules for path-based access control. Unless you specify a path
|
23
|
+
### starting with a /, the file's location is relative to the the
|
24
|
+
### directory containing this file. If you don't specify an
|
25
|
+
### authz-db, no path-based access control is done.
|
26
|
+
### Uncomment the line below to use the default authorization file.
|
27
|
+
# authz-db = authz
|
28
|
+
### This option specifies the authentication realm of the repository.
|
29
|
+
### If two repositories have the same authentication realm, they should
|
30
|
+
### have the same password database, and vice versa. The default realm
|
31
|
+
### is repository's uuid.
|
32
|
+
# realm = My First Repository
|
33
|
+
|
34
|
+
[sasl]
|
35
|
+
### This option specifies whether you want to use the Cyrus SASL
|
36
|
+
### library for authentication. Default is false.
|
37
|
+
### This section will be ignored if svnserve is not built with Cyrus
|
38
|
+
### SASL support; to check, run 'svnserve --version' and look for a line
|
39
|
+
### reading 'Cyrus SASL authentication is available.'
|
40
|
+
# use-sasl = true
|
41
|
+
### These options specify the desired strength of the security layer
|
42
|
+
### that you want SASL to provide. 0 means no encryption, 1 means
|
43
|
+
### integrity-checking only, values larger than 1 are correlated
|
44
|
+
### to the effective key length for encryption (e.g. 128 means 128-bit
|
45
|
+
### encryption). The values below are the defaults.
|
46
|
+
# min-encryption = 0
|
47
|
+
# max-encryption = 256
|
@@ -0,0 +1 @@
|
|
1
|
+
1
|
@@ -0,0 +1 @@
|
|
1
|
+
fsfs
|
@@ -0,0 +1,37 @@
|
|
1
|
+
### This file controls the configuration of the FSFS filesystem.
|
2
|
+
|
3
|
+
[memcached-servers]
|
4
|
+
### These options name memcached servers used to cache internal FSFS
|
5
|
+
### data. See http://www.danga.com/memcached/ for more information on
|
6
|
+
### memcached. To use memcached with FSFS, run one or more memcached
|
7
|
+
### servers, and specify each of them as an option like so:
|
8
|
+
# first-server = 127.0.0.1:11211
|
9
|
+
# remote-memcached = mymemcached.corp.example.com:11212
|
10
|
+
### The option name is ignored; the value is of the form HOST:PORT.
|
11
|
+
### memcached servers can be shared between multiple repositories;
|
12
|
+
### however, if you do this, you *must* ensure that repositories have
|
13
|
+
### distinct UUIDs and paths, or else cached data from one repository
|
14
|
+
### might be used by another accidentally. Note also that memcached has
|
15
|
+
### no authentication for reads or writes, so you must ensure that your
|
16
|
+
### memcached servers are only accessible by trusted users.
|
17
|
+
|
18
|
+
[caches]
|
19
|
+
### When a cache-related error occurs, normally Subversion ignores it
|
20
|
+
### and continues, logging an error if the server is appropriately
|
21
|
+
### configured (and ignoring it with file:// access). To make
|
22
|
+
### Subversion never ignore cache errors, uncomment this line.
|
23
|
+
# fail-stop = true
|
24
|
+
|
25
|
+
[rep-sharing]
|
26
|
+
### To conserve space, the filesystem can optionally avoid storing
|
27
|
+
### duplicate representations. This comes at a slight cost in performace,
|
28
|
+
### as maintaining a database of shared representations can increase
|
29
|
+
### commit times. The space savings are dependent upon the size of the
|
30
|
+
### repository, the number of objects it contains and the amount of
|
31
|
+
### duplication between them, usually a function of the branching and
|
32
|
+
### merging process.
|
33
|
+
###
|
34
|
+
### The following parameter enables rep-sharing in the repository. It can
|
35
|
+
### be switched on and off at will, but for best space-saving results
|
36
|
+
### should be enabled consistently over the life of the repository.
|
37
|
+
# enable-rep-sharing = false
|