proton 0.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +6 -0
- data/HISTORY.md +200 -0
- data/README.md +75 -0
- data/Rakefile +5 -0
- data/TODO.md +6 -0
- data/bin/proton +7 -0
- data/data/new_site/Protonfile +12 -0
- data/data/new_site/README.md +10 -0
- data/data/new_site/_layouts/default.haml +28 -0
- data/data/new_site/index.haml +5 -0
- data/data/rack/Gemfile +2 -0
- data/data/rack/Gemfile.lock +40 -0
- data/data/rack/config.ru +24 -0
- data/lib/proton.rb +78 -0
- data/lib/proton/cli.rb +227 -0
- data/lib/proton/cli/helpers.rb +89 -0
- data/lib/proton/compass_support.rb +8 -0
- data/lib/proton/config.rb +116 -0
- data/lib/proton/helpers.rb +126 -0
- data/lib/proton/layout.rb +20 -0
- data/lib/proton/meta.rb +17 -0
- data/lib/proton/page.rb +431 -0
- data/lib/proton/partial.rb +12 -0
- data/lib/proton/project.rb +176 -0
- data/lib/proton/server.rb +99 -0
- data/lib/proton/set.rb +32 -0
- data/lib/proton/version.rb +13 -0
- data/test/fixture/build_options/control/page.html +0 -0
- data/test/fixture/build_options/control/style.css +1 -0
- data/test/fixture/build_options/hyde.conf +18 -0
- data/test/fixture/build_options/site/page.haml +0 -0
- data/test/fixture/build_options/site/style.scss +1 -0
- data/test/fixture/compass/hyde.conf +4 -0
- data/test/fixture/compass/site/style.scss +5 -0
- data/test/fixture/empty_config/hyde.conf +0 -0
- data/test/fixture/extensions/control/index.html +1 -0
- data/test/fixture/extensions/extensions/a/a.rb +1 -0
- data/test/fixture/extensions/extensions/hi.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/high_version/hyde.conf +1 -0
- data/test/fixture/high_version_2/hyde.conf +1 -0
- data/test/fixture/html/control/index.html +2 -0
- data/test/fixture/html/hyde.conf +8 -0
- data/test/fixture/html/site/index.html +2 -0
- data/test/fixture/ignores/control/about.html +1 -0
- data/test/fixture/ignores/hyde.conf +10 -0
- data/test/fixture/ignores/site/about.haml +1 -0
- data/test/fixture/ignores/site/hi.haml +1 -0
- data/test/fixture/metadata/control/index.html +4 -0
- data/test/fixture/metadata/hyde.conf +8 -0
- data/test/fixture/metadata/site/index.haml +8 -0
- data/test/fixture/nested_layout/control/index.html +2 -0
- data/test/fixture/nested_layout/hyde.conf +9 -0
- data/test/fixture/nested_layout/layouts/default.haml +2 -0
- data/test/fixture/nested_layout/layouts/post.haml +3 -0
- data/test/fixture/nested_layout/site/index.haml +4 -0
- data/test/fixture/one/control/about/index.css +1 -0
- data/test/fixture/one/control/about/us.html +1 -0
- data/test/fixture/one/control/cheers.html +5 -0
- data/test/fixture/one/control/css/bar.css +0 -0
- data/test/fixture/one/control/css/style.css +1 -0
- data/test/fixture/one/control/hello.html +5 -0
- data/test/fixture/one/control/hi.html +1 -0
- data/test/fixture/one/control/images/bar.gif +0 -0
- data/test/fixture/one/control/images/baz.png +0 -0
- data/test/fixture/one/control/images/foo.jpg +0 -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/public/about/index.css +1 -0
- data/test/fixture/one/public/about/us.html +1 -0
- data/test/fixture/one/public/cheers.html +5 -0
- data/test/fixture/one/public/css/bar.css +0 -0
- data/test/fixture/one/public/css/style.css +1 -0
- data/test/fixture/one/public/hello.html +5 -0
- data/test/fixture/one/public/hi.html +1 -0
- data/test/fixture/one/public/images/bar.gif +0 -0
- data/test/fixture/one/public/images/baz.png +0 -0
- data/test/fixture/one/public/images/foo.jpg +0 -0
- data/test/fixture/one/public/index.html +7 -0
- data/test/fixture/one/site/about/index.scss +1 -0
- data/test/fixture/one/site/about/us.haml +3 -0
- data/test/fixture/one/site/cheers.html.haml +1 -0
- data/test/fixture/one/site/css/bar.scss +0 -0
- data/test/fixture/one/site/css/style.scss +2 -0
- data/test/fixture/one/site/hello.haml +3 -0
- data/test/fixture/one/site/hi.html +3 -0
- data/test/fixture/one/site/images/bar.gif +0 -0
- data/test/fixture/one/site/images/baz.png +0 -0
- data/test/fixture/one/site/images/foo.jpg +0 -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/control/about.html +6 -0
- data/test/fixture/sort/control/about/hardy.html +1 -0
- data/test/fixture/sort/control/about/intrepid.html +1 -0
- data/test/fixture/sort/hyde.conf +8 -0
- data/test/fixture/sort/site/about.haml +3 -0
- data/test/fixture/sort/site/about/hardy.haml +4 -0
- data/test/fixture/sort/site/about/intrepid.haml +4 -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 +9 -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 +36 -0
- data/test/unit/build_options_test.rb +18 -0
- data/test/unit/extensions_test.rb +17 -0
- data/test/unit/fixture_test.rb +122 -0
- data/test/unit/page_test.rb +58 -0
- data/test/unit/proton_test.rb +27 -0
- data/test/unit/set_test.rb +26 -0
- metadata +301 -0
@@ -0,0 +1 @@
|
|
1
|
+
<h1>ello</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 ello
|
@@ -0,0 +1 @@
|
|
1
|
+
xxx
|
@@ -0,0 +1 @@
|
|
1
|
+
div{color:red}
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>hi</h1>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
dir{color:#332211}
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello.
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
div{color:red}
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>hi</h1>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
dir{color:#332211}
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello.
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
div { color: red; }
|
@@ -0,0 +1 @@
|
|
1
|
+
lo.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Yo</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
...
|
@@ -0,0 +1 @@
|
|
1
|
+
...
|
@@ -0,0 +1 @@
|
|
1
|
+
<div id='post'><h1>hello-there</h1></div>
|
@@ -0,0 +1 @@
|
|
1
|
+
Wrong!
|
@@ -0,0 +1 @@
|
|
1
|
+
#post!= yield
|
data/test/helper.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
$:.push File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'rubygems' if !Object.respond_to?(:gem)
|
4
|
+
|
5
|
+
gem "contest", "~> 0.1"
|
6
|
+
|
7
|
+
require 'proton'
|
8
|
+
require 'contest'
|
9
|
+
|
10
|
+
class TestCase < Test::Unit::TestCase
|
11
|
+
# Shorthand
|
12
|
+
Page = Proton::Page
|
13
|
+
Project = Proton::Project
|
14
|
+
|
15
|
+
def fixture(*a)
|
16
|
+
path = File.expand_path('../fixture', __FILE__)
|
17
|
+
File.join path, *a
|
18
|
+
end
|
19
|
+
|
20
|
+
def build(path)
|
21
|
+
@project = Proton::Project.new(path)
|
22
|
+
@project.pages.each { |p| p.write }
|
23
|
+
@project
|
24
|
+
end
|
25
|
+
|
26
|
+
def unbuild(project=@project)
|
27
|
+
FileUtils.rm_rf project.path(:output)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Proton::Set
|
32
|
+
# Because 1.8.6 doesn't support map(&:path)
|
33
|
+
def paths
|
34
|
+
map { |page| page.path }
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
require File.expand_path('../../helper', __FILE__)
|
3
|
+
|
4
|
+
class BuildOptionsTest < TestCase
|
5
|
+
setup do
|
6
|
+
@path = fixture('build_options')
|
7
|
+
@project = Project.new(@path)
|
8
|
+
Dir.chdir @path
|
9
|
+
end
|
10
|
+
|
11
|
+
test "yada" do
|
12
|
+
raw = Page['/style.css'].to_html
|
13
|
+
built = Page['/style.css'].to_html({}, :build => true)
|
14
|
+
|
15
|
+
assert !built.include?("line 1")
|
16
|
+
assert raw.include?("line 1")
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path('../../helper', __FILE__)
|
2
|
+
|
3
|
+
class ExtensionsTest < TestCase
|
4
|
+
setup do
|
5
|
+
$extension_loaded = nil
|
6
|
+
@project = build fixture('extensions')
|
7
|
+
end
|
8
|
+
|
9
|
+
teardown do
|
10
|
+
unbuild @project
|
11
|
+
end
|
12
|
+
|
13
|
+
test "extensions" do
|
14
|
+
assert $extension_loaded == "aoeu"
|
15
|
+
assert $hi == 1
|
16
|
+
end
|
17
|
+
end
|