hydeweb 0.0.8.pre2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → HISTORY.md} +6 -0
- data/Rakefile +2 -52
- data/bin/hyde +3 -23
- data/bin/hyde01 +7 -0
- data/data/new_site/README.md +1 -1
- data/data/new_site/hyde.conf +9 -6
- data/lib/hyde/cli/helpers.rb +40 -0
- data/lib/hyde/cli.rb +86 -0
- data/lib/hyde/config.rb +37 -0
- data/lib/hyde/helpers.rb +6 -47
- data/lib/hyde/layout.rb +17 -9
- data/lib/hyde/meta.rb +5 -21
- data/lib/hyde/page.rb +207 -159
- data/lib/hyde/partial.rb +10 -5
- data/lib/hyde/project.rb +58 -208
- data/lib/hyde/server.rb +57 -0
- data/lib/hyde.rb +28 -51
- data/test/fixture/extensions/extensions/a/a.rb +1 -0
- data/test/fixture/extensions/hyde.conf +8 -0
- data/test/fixture/extensions/site/index.haml +1 -0
- data/test/fixture/fail_type/control/about/index.html +2 -0
- data/test/fixture/fail_type/control/about/us.html +2 -0
- data/test/fixture/fail_type/control/index.html +1 -0
- data/test/fixture/fail_type/hyde.conf +8 -0
- data/test/fixture/fail_type/site/index.haml +4 -0
- data/test/fixture/nested_layout/control/index.html +2 -0
- data/test/fixture/nested_layout/hyde.conf +8 -0
- data/test/fixture/nested_layout/layouts/default.haml +2 -0
- data/test/{fixtures/content_for/site/default.html.haml → fixture/nested_layout/layouts/post.haml} +1 -0
- data/test/fixture/nested_layout/site/index.haml +4 -0
- data/test/fixture/one/control/about/index.css +2 -0
- data/test/fixture/one/control/cheers.html +5 -0
- data/test/fixture/one/control/css/style.css +2 -0
- data/test/fixture/one/control/hello.html +5 -0
- data/test/fixture/one/control/hi.html +1 -0
- data/test/fixture/one/control/index.html +7 -0
- data/test/fixture/one/hyde.conf +9 -0
- data/test/fixture/one/layouts/default.haml +4 -0
- data/test/fixture/one/partials/menu.haml +3 -0
- data/test/fixture/one/site/about/index.scss +1 -0
- data/test/fixture/one/site/cheers.html.haml +1 -0
- data/test/fixture/one/site/css/style.scss +2 -0
- data/test/fixture/one/site/hello.haml +1 -0
- data/test/fixture/one/site/hi.html +1 -0
- data/test/fixture/one/site/index.haml +7 -0
- data/test/fixture/parent/control/about/index.html +2 -0
- data/test/fixture/parent/control/about/us.html +2 -0
- data/test/fixture/parent/control/index.html +1 -0
- data/test/fixture/parent/hyde.conf +8 -0
- data/test/fixture/parent/site/about/index.haml +3 -0
- data/test/fixture/parent/site/about/us.haml +3 -0
- data/test/fixture/parent/site/index.haml +3 -0
- data/test/fixture/sort/hyde.conf +8 -0
- data/test/fixture/sort/site/about/hardy.haml +4 -0
- data/test/fixture/sort/site/about/intrepid.haml +4 -0
- data/test/fixture/sort/site/about.haml +3 -0
- data/test/fixture/subclass/control/index.html +1 -0
- data/test/fixture/subclass/extensions/a/a.rb +12 -0
- data/test/fixture/subclass/hyde.conf +8 -0
- data/test/fixture/subclass/layouts/default.haml +1 -0
- data/test/fixture/subclass/layouts/post.haml +1 -0
- data/test/fixture/subclass/site/index.haml +4 -0
- data/test/helper.rb +15 -21
- data/test/unit/extensions_test.rb +16 -0
- data/test/unit/fixture_test.rb +77 -0
- data/test/unit/hyde_test.rb +30 -0
- metadata +107 -153
- data/.yardopts +0 -5
- data/LICENSE +0 -20
- data/VERSION +0 -1
- data/data/new_site/.gitignore +0 -24
- data/data/pages/404.html +0 -3
- data/hydeweb.gemspec +0 -159
- data/lib/hyde/clicommand.rb +0 -60
- data/lib/hyde/clicommands.rb +0 -128
- data/lib/hyde/ostruct.rb +0 -13
- data/lib/hyde/page_factory.rb +0 -90
- data/lib/hyde/renderer.rb +0 -133
- data/lib/hyde/renderers.rb +0 -100
- data/lib/hyde/sinatra/init.rb +0 -64
- data/lib/hyde/utils.rb +0 -43
- data/lib/hyde_misc/console.rb +0 -4
- data/manual/Extending/ExtendingHyde.md +0 -118
- data/manual/Hyde.md +0 -63
- data/manual/Introduction/Configuration.md +0 -70
- data/manual/Introduction/GettingStarted.md +0 -64
- data/manual/Introduction/Installation.md +0 -16
- data/manual/Introduction/Layouts.md +0 -14
- data/manual/Introduction/Metadata.md +0 -94
- data/manual/Introduction/Partials.md +0 -73
- data/manual/Introduction/TemplateLanguages.md +0 -59
- data/manual/Tips/Tips.md +0 -42
- data/test/fixtures/content_for/_config.yml +0 -8
- data/test/fixtures/content_for/layouts/cf-args.haml +0 -2
- data/test/fixtures/content_for/layouts/cf.haml +0 -14
- data/test/fixtures/content_for/layouts/default.haml +0 -4
- data/test/fixtures/content_for/layouts/shared/test.haml +0 -4
- data/test/fixtures/content_for/site/cf-args-default.haml +0 -2
- data/test/fixtures/content_for/site/cf-args.haml +0 -5
- data/test/fixtures/content_for/site/cf.haml +0 -6
- data/test/fixtures/content_for/site/cf2.haml +0 -3
- data/test/fixtures/content_for/site/index.html.haml +0 -9
- data/test/fixtures/content_for/site/var.html.haml +0 -5
- data/test/fixtures/content_for/www_control/cf-args-default.html +0 -1
- data/test/fixtures/content_for/www_control/cf-args.html +0 -2
- data/test/fixtures/content_for/www_control/cf.html +0 -17
- data/test/fixtures/content_for/www_control/cf2.html +0 -19
- data/test/fixtures/content_for/www_control/default.html +0 -2
- data/test/fixtures/content_for/www_control/index.html +0 -10
- data/test/fixtures/content_for/www_control/var.html +0 -2
- data/test/fixtures/custom/_config.yml +0 -8
- data/test/fixtures/custom/extensions/custom/custom.rb +0 -9
- data/test/fixtures/custom/layouts/default.haml +0 -8
- data/test/fixtures/custom/layouts/erbtest.erb +0 -2
- data/test/fixtures/custom/layouts/shared/sidebar.haml +0 -4
- data/test/fixtures/custom/site/about/index.html +0 -1
- data/test/fixtures/custom/site/assets/common.css.less +0 -1
- data/test/fixtures/custom/site/assets/style.css.less +0 -3
- data/test/fixtures/custom/site/foo.html.haml +0 -3
- data/test/fixtures/custom/site/index.html.haml +0 -6
- data/test/fixtures/custom/site/layout_test.html.haml +0 -6
- data/test/fixtures/custom/site/lol.html.erb +0 -7
- data/test/fixtures/custom/site/markdown.html.md +0 -8
- data/test/fixtures/custom/site/yes.html +0 -2
- data/test/fixtures/custom/www_control/about/index.html +0 -1
- data/test/fixtures/custom/www_control/assets/common.css +0 -1
- data/test/fixtures/custom/www_control/assets/style.css +0 -6
- data/test/fixtures/custom/www_control/foo.html +0 -1
- data/test/fixtures/custom/www_control/index.html +0 -16
- data/test/fixtures/custom/www_control/layout_test.html +0 -16
- data/test/fixtures/custom/www_control/lol.html +0 -5
- data/test/fixtures/custom/www_control/markdown.html +0 -17
- data/test/fixtures/custom/www_control/yes.html +0 -2
- data/test/fixtures/default/_config.yml +0 -8
- data/test/fixtures/default/extensions/custom/custom.rb +0 -2
- data/test/fixtures/default/layouts/default.haml +0 -5
- data/test/fixtures/default/site/about/index.html +0 -1
- data/test/fixtures/default/site/foo.html.haml +0 -3
- data/test/fixtures/default/site/index.html.haml +0 -6
- data/test/fixtures/default/site/layout_test.html.haml +0 -6
- data/test/fixtures/default/site/yes.html +0 -2
- data/test/fixtures/default/www_control/about/index.html +0 -1
- data/test/fixtures/default/www_control/foo.html +0 -1
- data/test/fixtures/default/www_control/index.html +0 -9
- data/test/fixtures/default/www_control/layout_test.html +0 -9
- data/test/fixtures/default/www_control/yes.html +0 -2
- data/test/test_all_fixtures.rb +0 -51
- data/test/test_build.rb +0 -20
- data/test/test_hyde.rb +0 -75
- data/test/test_page.rb +0 -26
- data/test/test_utils.rb +0 -22
data/lib/hyde/project.rb
CHANGED
@@ -1,223 +1,73 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# The configuration k/v storage (OStruct)
|
11
|
-
#
|
12
|
-
attr_accessor :config
|
13
|
-
|
14
|
-
# The root path (String).
|
15
|
-
#
|
16
|
-
# @example
|
17
|
-
# root
|
18
|
-
# root :layouts
|
19
|
-
# root :site, 'blah'
|
20
|
-
#
|
21
|
-
def root(*args)
|
22
|
-
where = ''
|
23
|
-
where = @config.send("#{args.shift.to_s}_path") if args[0].class == Symbol
|
24
|
-
path = args
|
25
|
-
File.expand_path File.join([@root, where, path].reject { |s| s.empty? })
|
26
|
-
end
|
27
|
-
|
28
|
-
# Can raise a NoRootError
|
29
|
-
#
|
30
|
-
def initialize(root = Dir.pwd)
|
31
|
-
@config = OStruct.new defaults
|
32
|
-
@root, @config_file = find_root_from root
|
33
|
-
@config.merge! YAML::load_file(@config_file)
|
34
|
-
|
35
|
-
# Check for version
|
36
|
-
raise IncompatibleError, "This project requires at least Hyde v#{@config.hyde_requirement}." \
|
37
|
-
unless @config.hyde_requirement.nil? or \
|
38
|
-
::Hyde.compatible_with?(@config.hyde_requirement)
|
39
|
-
|
40
|
-
load_extensions
|
41
|
-
end
|
42
|
-
|
43
|
-
# Returns an object in the project.
|
44
|
-
# Can be a page, layout, template...
|
45
|
-
#
|
46
|
-
# @example
|
47
|
-
# @project['index.html']
|
48
|
-
# @project['default', :Layout]
|
49
|
-
# @project['widgets/sidebar', :Partial]
|
50
|
-
#
|
51
|
-
def [](name, default_class=Page)
|
52
|
-
default_class = ::Hyde.const_get(default_class) if default_class.is_a? Symbol
|
53
|
-
Hyde::Page[name, self, default_class]
|
54
|
-
end
|
55
|
-
|
56
|
-
# Returns all pages.
|
57
|
-
#
|
58
|
-
# @example
|
59
|
-
# @project.all #=> [1, 2, 3]
|
60
|
-
# @project.all(Hyde::Post) #=> [1]
|
61
|
-
#
|
62
|
-
def all(type=nil)
|
63
|
-
unless type
|
64
|
-
@all = files.map { |f| self[f] }
|
65
|
-
else
|
66
|
-
all.select { |page| page.class == type }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Writes the output files.
|
71
|
-
# @param
|
72
|
-
# ostream - (Stream) Where to send the messages
|
73
|
-
#
|
74
|
-
def build(ostream = nil)
|
75
|
-
if File.exists? root(:output)
|
76
|
-
raise Errno::EEXISTS unless File.directory? root(:output)
|
77
|
-
else
|
78
|
-
Dir.mkdir root(:output)
|
79
|
-
end
|
80
|
-
|
81
|
-
begin
|
82
|
-
all.each do |page|
|
83
|
-
ostream << " * #{page.output_path}\n" if ostream
|
84
|
-
|
85
|
-
begin
|
86
|
-
rendered = page.render
|
87
|
-
force_file_open(page.output_path) { |file| file << rendered }
|
88
|
-
|
89
|
-
rescue RenderError => e
|
90
|
-
ostream << " *** Error: #{e.to_s}".gsub("\n", "\n *** ") << "\n"
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
rescue NoGemError => e
|
95
|
-
ostream << " *** Error: #{e.message}\n"
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
# Returns a list of all URL paths
|
100
|
-
#
|
101
|
-
def files
|
102
|
-
@files = Dir[File.join(root(:site), '**', '*')].inject([]) do |a, match|
|
103
|
-
# Make sure its the canonical name
|
104
|
-
path = File.expand_path(match)
|
105
|
-
file = path.gsub /^#{Regexp.escape root(:site)}\/?/, ''
|
106
|
-
ext = File.extname(file)[1..-1]
|
107
|
-
|
108
|
-
if ignored_files.include?(path) or File.directory?(match)
|
109
|
-
# pass
|
110
|
-
elsif not get_renderer(ext).nil? # Has a renderer associated
|
111
|
-
fname = file.chomp(".#{ext}")
|
112
|
-
fname += get_renderer(ext).default_ext unless File.basename(fname).include?('.')
|
113
|
-
a << fname
|
114
|
-
else
|
115
|
-
a << file
|
116
|
-
end
|
117
|
-
a
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
# Returns a list of file specs to be excluded from processing.
|
122
|
-
# @see {#ignored_files}
|
123
|
-
#
|
124
|
-
def ignore_list
|
125
|
-
@ignore_list ||= [
|
126
|
-
root(:layouts, '**/*'),
|
127
|
-
root(:extensions, '**/*'),
|
128
|
-
root(:output, '**/*'),
|
129
|
-
custom_ignored_files,
|
130
|
-
@config_file
|
131
|
-
].flatten.uniq
|
132
|
-
end
|
133
|
-
|
134
|
-
def custom_ignored_files
|
135
|
-
list = @config.send("ignore")
|
136
|
-
return [] unless list.is_a?(Array)
|
137
|
-
Dir[*(list.map { |path| root(:site, path) })]
|
138
|
-
end
|
1
|
+
class Hyde
|
2
|
+
class Project
|
3
|
+
def initialize(root=Dir.pwd)
|
4
|
+
@root = root
|
5
|
+
$project = self
|
6
|
+
|
7
|
+
validate_version
|
8
|
+
load_extensions
|
9
|
+
end
|
139
10
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
11
|
+
def validate_version
|
12
|
+
return unless config_file?
|
13
|
+
req = config.hyde_requirement.to_s
|
14
|
+
if req < "0.1"
|
15
|
+
raise LegacyError, "This is a legacy project"
|
16
|
+
elsif req > Hyde.version
|
17
|
+
raise VersionError, "You will need Hyde version >= #{req} for this project."
|
147
18
|
end
|
19
|
+
end
|
148
20
|
|
149
|
-
|
150
|
-
|
151
|
-
|
21
|
+
def load_extensions
|
22
|
+
path = path(:extensions)
|
23
|
+
Dir[path(:extensions, '*', '*.rb')].each { |f| require f } if path
|
24
|
+
end
|
152
25
|
|
153
|
-
|
26
|
+
def config_file
|
27
|
+
try = lambda { |path| p = root(path); p if File.file?(p) }
|
28
|
+
try['hyde.conf'] || try['.hyderc']
|
29
|
+
end
|
154
30
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
check = File.expand_path(start)
|
159
|
-
ret = nil
|
160
|
-
while ret.nil?
|
161
|
-
# See if any of these files exist
|
162
|
-
self.class.config_filenames.each do |config_name|
|
163
|
-
config_file = File.join(check, config_name)
|
164
|
-
ret ||= [check, config_file] if File.exists? config_file
|
165
|
-
end
|
31
|
+
def config_file?
|
32
|
+
config_file
|
33
|
+
end
|
166
34
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
raise NoRootError if check == old_check
|
171
|
-
end
|
172
|
-
ret
|
173
|
-
end
|
35
|
+
def config
|
36
|
+
@config ||= Config.load(config_file)
|
37
|
+
end
|
174
38
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
39
|
+
# Returns the path for a certain aspect.
|
40
|
+
# @example path(:site)
|
41
|
+
def path(what, *a)
|
42
|
+
return nil unless [:output, :site, :layouts, :extensions, :partials].include?(what)
|
43
|
+
path = config.send(:"#{what}_path")
|
44
|
+
root path, *a if path
|
45
|
+
end
|
180
46
|
|
181
|
-
|
182
|
-
|
47
|
+
def root(*args)
|
48
|
+
File.join @root, *(args.compact)
|
49
|
+
end
|
183
50
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
ext = File.basename(dir)
|
51
|
+
def pages
|
52
|
+
files.map { |f| Page[f, self] }.compact
|
53
|
+
end
|
188
54
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
File.join(dir, "#{ext}.rb"),
|
193
|
-
File.join(dir, 'lib', "#{ext}.rb")
|
194
|
-
]
|
195
|
-
ext_files.reject! { |f| not File.exists? f }
|
196
|
-
require ext_files[0] if ext_files[0]
|
197
|
-
end
|
198
|
-
end
|
55
|
+
def files
|
56
|
+
Dir[File.join(path(:site), '**', '*')] - ignored_files
|
57
|
+
end
|
199
58
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
'output_path' => 'public',
|
206
|
-
'port' => 4833,
|
207
|
-
'gems' => []
|
208
|
-
}
|
59
|
+
def ignored_files
|
60
|
+
specs = [*config.ignore].map { |s| root(s) }
|
61
|
+
specs << config_file
|
62
|
+
[:layouts, :extensions, :partials, :output].each do |aspect|
|
63
|
+
specs << path(aspect, '**/*') if path(aspect)
|
209
64
|
end
|
65
|
+
specs.compact.map { |s| Dir[s] }.flatten.uniq
|
66
|
+
end
|
210
67
|
|
211
|
-
|
212
|
-
|
213
|
-
def get_renderer(name)
|
214
|
-
begin
|
215
|
-
class_name = name.to_s.capitalize.to_sym
|
216
|
-
renderer = ::Hyde::Renderers.const_get(class_name)
|
217
|
-
rescue NameError
|
218
|
-
renderer = nil
|
219
|
-
end
|
220
|
-
renderer
|
221
|
-
end
|
68
|
+
def build_cleanup
|
69
|
+
FileUtils.rm_rf '.sass_cache'
|
222
70
|
end
|
223
71
|
end
|
72
|
+
end
|
73
|
+
|
data/lib/hyde/server.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'cuba'
|
2
|
+
require 'rack'
|
3
|
+
require 'hyde'
|
4
|
+
|
5
|
+
class Hyde
|
6
|
+
Server = Cuba.dup
|
7
|
+
|
8
|
+
module Server; end
|
9
|
+
|
10
|
+
module Server::PageHelpers
|
11
|
+
def not_found
|
12
|
+
show_status nil
|
13
|
+
res.status = 404
|
14
|
+
res.write "404"
|
15
|
+
end
|
16
|
+
|
17
|
+
def show_status(page)
|
18
|
+
path = env['PATH_INFO']
|
19
|
+
return if path == '/favicon.ico'
|
20
|
+
|
21
|
+
status = page ? "\033[0;32m[ OK ]" : "\033[0;31m[404 ]"
|
22
|
+
verb = get ? 'GET ' : (post ? 'POST' : '')
|
23
|
+
puts "%s\033[0;m %s %s" % [ status, verb, env['PATH_INFO'] ]
|
24
|
+
puts " Source: #{page.file.sub(page.project.path(:site), '')} (#{page.tilt_engine_name})" if page.tilt?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
module Hyde::Server
|
29
|
+
Ron.send :include, PageHelpers
|
30
|
+
|
31
|
+
define do
|
32
|
+
on default do
|
33
|
+
page = Hyde::Page[env['PATH_INFO']] or break not_found
|
34
|
+
res.write page.to_html
|
35
|
+
show_status page
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Hyde::Server
|
42
|
+
# :Host, :Port
|
43
|
+
def self.run!(options={})
|
44
|
+
handler = rack_handler or return false
|
45
|
+
handler.run self, options
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.rack_handler
|
49
|
+
%w(thin mongrel webrick).each do |svr|
|
50
|
+
begin
|
51
|
+
return Rack::Handler.get(svr)
|
52
|
+
rescue LoadError
|
53
|
+
rescue NameError
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/hyde.rb
CHANGED
@@ -1,55 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Hyde
|
4
|
-
LIB_PATH = File.dirname(__FILE__)
|
5
|
-
|
6
|
-
autoload :OStruct, "#{LIB_PATH}/hyde/ostruct"
|
7
|
-
autoload :Project, "#{LIB_PATH}/hyde/project"
|
8
|
-
autoload :Layout, "#{LIB_PATH}/hyde/layout"
|
9
|
-
autoload :Page, "#{LIB_PATH}/hyde/page"
|
10
|
-
autoload :PageFactory, "#{LIB_PATH}/hyde/page_factory"
|
11
|
-
autoload :Renderer, "#{LIB_PATH}/hyde/renderer"
|
12
|
-
autoload :Renderers, "#{LIB_PATH}/hyde/renderers"
|
13
|
-
autoload :Utils, "#{LIB_PATH}/hyde/utils"
|
14
|
-
autoload :Meta, "#{LIB_PATH}/hyde/meta"
|
15
|
-
autoload :CLICommand, "#{LIB_PATH}/hyde/clicommand"
|
16
|
-
autoload :CLICommands, "#{LIB_PATH}/hyde/clicommands"
|
17
|
-
autoload :Helpers, "#{LIB_PATH}/hyde/helpers"
|
18
|
-
autoload :Partial, "#{LIB_PATH}/hyde/partial"
|
1
|
+
$:.push *Dir[File.expand_path('../../vendor/*/lib', __FILE__)]
|
19
2
|
|
20
|
-
|
21
|
-
NoGemError = Class.new(Error)
|
22
|
-
NotFound = Class.new(Error)
|
23
|
-
NoRootError = Class.new(Error)
|
24
|
-
IncompatibleError = Class.new(Error)
|
3
|
+
gem 'shake', '~> 0.1'
|
25
4
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
def compatible_with?(given_version)
|
53
|
-
Gem::Version.new(version) >= Gem::Version.new(given_version)
|
5
|
+
require 'fileutils'
|
6
|
+
require 'ostruct'
|
7
|
+
require 'yaml'
|
8
|
+
require 'tilt'
|
9
|
+
require 'shake'
|
10
|
+
|
11
|
+
class Hyde
|
12
|
+
VERSION = "0.1.0"
|
13
|
+
PREFIX = File.expand_path('../', __FILE__)
|
14
|
+
|
15
|
+
Error = Class.new(StandardError)
|
16
|
+
LegacyError = Class.new(Error)
|
17
|
+
VersionError = Class.new(Error)
|
18
|
+
NoGemError = Class.new(Error)
|
19
|
+
|
20
|
+
autoload :Project, "#{PREFIX}/hyde/project"
|
21
|
+
autoload :Page, "#{PREFIX}/hyde/page"
|
22
|
+
autoload :Meta, "#{PREFIX}/hyde/meta"
|
23
|
+
autoload :Config, "#{PREFIX}/hyde/config"
|
24
|
+
autoload :CLI, "#{PREFIX}/hyde/cli"
|
25
|
+
autoload :Layout, "#{PREFIX}/hyde/layout"
|
26
|
+
autoload :Partial, "#{PREFIX}/hyde/partial"
|
27
|
+
autoload :Helpers, "#{PREFIX}/hyde/helpers"
|
28
|
+
|
29
|
+
def self.version
|
30
|
+
VERSION
|
54
31
|
end
|
55
32
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
$extension_loaded = 'aoeu'
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 hey
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Yo</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello.
|
@@ -0,0 +1 @@
|
|
1
|
+
div { color: red; }
|
@@ -0,0 +1 @@
|
|
1
|
+
lo.
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 Welcome!
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello.
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Yo</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div id='post'><h1>hello-there</h1></div>
|