prow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/lib/prow/default_paths.rb +19 -0
- data/lib/prow/page_compiler.rb +33 -0
- data/lib/prow/page_configs.rb +15 -0
- data/lib/prow/pages_compiler.rb +29 -0
- data/lib/prow/renderer.rb +15 -0
- data/lib/prow/template.rb +27 -0
- data/lib/prow/templates.rb +35 -0
- data/lib/prow/version.rb +3 -0
- data/lib/prow.rb +13 -0
- data/prow.gemspec +37 -0
- data/spec/page_compiler_spec.rb +68 -0
- data/spec/pages_compiler_spec.rb +21 -0
- data/spec/spec_helper.rb +44 -0
- data/spec/support/pages.json +16 -0
- data/spec/support/public/.keep +0 -0
- data/spec/support/templates/index.mustache +3 -0
- data/spec/support/templates/layouts/default.mustache +14 -0
- data/spec/support/templates/layouts/foo.mustache +14 -0
- data/spec/support/templates/pages/bar.mustache +1 -0
- data/spec/support/templates/pages/foo.mustache +1 -0
- data/spec/support/templates/pages/index.mustache +4 -0
- data/spec/support/templates/partials/header.mustache +1 -0
- data/spec/support/templates/partials/things/it.mustache +1 -0
- data/spec/template_spec.rb +33 -0
- data/spec/templates_spec.rb +36 -0
- metadata +167 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d9f41da04659cd12b91b480085140b2aa08b2183
|
4
|
+
data.tar.gz: 1968e6faab6709adb7f59fc9069191db2cb0879e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 77b8bd8d581e538817c8bec5821d167404524646769d8a483b146ba78030994964a87ad9bd4b41d140391221f3715d7055a35780318bcf8dbc8b5c226d6c2633
|
7
|
+
data.tar.gz: 3f9cccc3e5142e43db96e7e160e25ee54d1d0baa4bf55c649dd2aae0f27642e31426217b9c0e0df58107066e0d506b9f978eaf827e651e06bd395d39eaea3d3d
|
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
|
24
|
+
spec/support/public
|
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
prow
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.5
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Kane Baccigalupi
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Prow
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'prow'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install prow
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/prow/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Prow
|
2
|
+
class DefaultPaths
|
3
|
+
def base_path
|
4
|
+
File.dirname(__FILE__) + "/.."
|
5
|
+
end
|
6
|
+
|
7
|
+
def config_path
|
8
|
+
"#{base_path}/pages.json"
|
9
|
+
end
|
10
|
+
|
11
|
+
def templates_path
|
12
|
+
"#{base_path}/templates"
|
13
|
+
end
|
14
|
+
|
15
|
+
def compiled_path
|
16
|
+
"#{base_path}/public"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Prow
|
2
|
+
class PageCompiler < Struct.new(:name, :config, :templates, :compile_dir)
|
3
|
+
def compile
|
4
|
+
File.open(path, 'w+') do |f|
|
5
|
+
f.write(render)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def renderer
|
10
|
+
return @renderer if defined?(@renderer)
|
11
|
+
@renderer = Renderer.new
|
12
|
+
@renderer.templates = templates
|
13
|
+
@renderer.page_name = name.split('.').first
|
14
|
+
@renderer
|
15
|
+
end
|
16
|
+
|
17
|
+
def render
|
18
|
+
renderer.render(layout.content, data)
|
19
|
+
end
|
20
|
+
|
21
|
+
def layout
|
22
|
+
templates.layout(config['layout'] || 'default')
|
23
|
+
end
|
24
|
+
|
25
|
+
def data
|
26
|
+
config['data'] || {}
|
27
|
+
end
|
28
|
+
|
29
|
+
def path
|
30
|
+
compile_dir + "/" + name
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Prow
|
2
|
+
class PagesCompiler
|
3
|
+
attr_reader :config_path, :templates_path, :compile_path
|
4
|
+
|
5
|
+
def initialize(config_path=nil, templates_path=nil, compile_path=nil)
|
6
|
+
@config_path = config_path || default_paths.config_path
|
7
|
+
@templates_path = templates_path || default_paths.templates_path
|
8
|
+
@compile_path = compile_path || default_paths.compile_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def compile
|
12
|
+
page_configs.each do |page_name, page_config|
|
13
|
+
PageCompiler.new(page_name, page_config, templates, compile_path).compile
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def page_configs
|
18
|
+
@page_configs ||= PageConfigs.new(config_path)
|
19
|
+
end
|
20
|
+
|
21
|
+
def templates
|
22
|
+
@templates ||= Templates.new(templates_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def default_paths
|
26
|
+
@default_paths ||= DefaultPaths.new
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Prow
|
2
|
+
class Renderer < Mustache
|
3
|
+
attr_accessor :templates, :page_name
|
4
|
+
|
5
|
+
def partial(name)
|
6
|
+
part = find_partial_template(name.to_s)
|
7
|
+
part && part.content
|
8
|
+
end
|
9
|
+
|
10
|
+
def find_partial_template(name)
|
11
|
+
return templates.page(page_name) if name == 'body'
|
12
|
+
templates.partial(name)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Prow
|
2
|
+
class Template < Struct.new(:path, :templates_path)
|
3
|
+
def type
|
4
|
+
path_parts.first
|
5
|
+
end
|
6
|
+
|
7
|
+
def name
|
8
|
+
name_path_parts.join('/')
|
9
|
+
end
|
10
|
+
|
11
|
+
def content
|
12
|
+
@content ||= File.read(path)
|
13
|
+
end
|
14
|
+
|
15
|
+
def partial_path
|
16
|
+
path.gsub(templates_path, '')
|
17
|
+
end
|
18
|
+
|
19
|
+
def path_parts
|
20
|
+
partial_path.split("/").select{|p| !p.empty? }
|
21
|
+
end
|
22
|
+
|
23
|
+
def name_path_parts
|
24
|
+
(path_parts - [type]).map {|e| e.split('.').first }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Prow
|
2
|
+
class Templates < Struct.new(:path)
|
3
|
+
def layout(name='default')
|
4
|
+
template('layouts', name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def page(name)
|
8
|
+
template('pages', name)
|
9
|
+
end
|
10
|
+
|
11
|
+
def partial(name)
|
12
|
+
partials.detect {|t| t.name == name}
|
13
|
+
end
|
14
|
+
|
15
|
+
def partials
|
16
|
+
collection.select {|template| template.type == 'partials' }
|
17
|
+
end
|
18
|
+
|
19
|
+
def template(type, name)
|
20
|
+
found = collection.detect { |template| template.type == type && template.name == name }
|
21
|
+
raise ArgumentError.new("#{type} #{name} not found") unless found
|
22
|
+
found
|
23
|
+
end
|
24
|
+
|
25
|
+
def collection
|
26
|
+
@collection ||= load
|
27
|
+
end
|
28
|
+
|
29
|
+
def load
|
30
|
+
Dir.glob("#{path}/**/*.mustache").map do |template_path|
|
31
|
+
Template.new(template_path, path)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/prow/version.rb
ADDED
data/lib/prow.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'forwardable'
|
3
|
+
|
4
|
+
require 'mustache'
|
5
|
+
|
6
|
+
require "prow/version"
|
7
|
+
require "prow/default_paths"
|
8
|
+
require "prow/page_configs"
|
9
|
+
require "prow/template"
|
10
|
+
require "prow/templates"
|
11
|
+
require "prow/renderer"
|
12
|
+
require "prow/page_compiler"
|
13
|
+
require "prow/pages_compiler"
|
data/prow.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'prow/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prow"
|
8
|
+
spec.version = Prow::VERSION
|
9
|
+
spec.authors = ["Kane Baccigalupi"]
|
10
|
+
spec.email = ["baccigalupi@gmail.com"]
|
11
|
+
spec.summary = %q{Prow is a front end development framework, that can also server static websites}
|
12
|
+
spec.description = %q{
|
13
|
+
Prow is solving the problem front-end developers have when they try to
|
14
|
+
start a project, and need a server mock to work with. It also solves the
|
15
|
+
problem of creating and serving a static HTML/CSS/JS that includes heavy
|
16
|
+
front-end development work.
|
17
|
+
|
18
|
+
Prow includes:
|
19
|
+
* Mustache to HTML file generation
|
20
|
+
* ShipdStyle compass plugin for getting easy responsive design widgets
|
21
|
+
* DeMedusa the slim, extensible, JS framework
|
22
|
+
}
|
23
|
+
spec.homepage = "https://github.com/shipd/prow"
|
24
|
+
spec.license = "MIT"
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0")
|
27
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_dependency "shipd_style"
|
32
|
+
spec.add_dependency "mustache"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
35
|
+
spec.add_development_dependency "rspec"
|
36
|
+
spec.add_development_dependency "rake"
|
37
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Prow::PageCompiler do
|
4
|
+
let(:compiler) { Prow::PageCompiler.new(name, config, templates, compile_dir) }
|
5
|
+
let(:full_configs) { JSON.parse(File.read(File.dirname(__FILE__) + "/support/pages.json"))['pages'] }
|
6
|
+
let(:config) { full_configs[name]}
|
7
|
+
let(:name) { 'index.html' }
|
8
|
+
let(:templates) { Prow::Templates.new(File.dirname(__FILE__) + "/support/templates") }
|
9
|
+
let(:compile_dir) { File.dirname(__FILE__) + "/support/public" }
|
10
|
+
let(:file_path) { File.dirname(__FILE__) + "/support/public/index.html" }
|
11
|
+
|
12
|
+
before { File.delete(file_path) if File.exist?(file_path) }
|
13
|
+
|
14
|
+
let(:content) { File.read(file_path) }
|
15
|
+
|
16
|
+
it "should generate the right path" do
|
17
|
+
expect(compiler.path).to eq(file_path)
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#compile' do
|
21
|
+
it 'should generate a file at the path' do
|
22
|
+
compiler.compile
|
23
|
+
expect(File.exist?(file_path)).to be(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'with default layout' do
|
27
|
+
it "should have layout content" do
|
28
|
+
compiler.compile
|
29
|
+
expect(content).to include("DEFAULT LAYOUT")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should render data into the layout" do
|
33
|
+
compiler.compile
|
34
|
+
expect(content).to include("hello Prow")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'with specified layout' do
|
39
|
+
let(:name) { 'foo.html' }
|
40
|
+
let(:content) { File.read(compile_dir + "/foo.html") }
|
41
|
+
|
42
|
+
it "should have layout content" do
|
43
|
+
compiler.compile
|
44
|
+
expect(content).to include("FOO LAYOUT")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should render the body view" do
|
49
|
+
compiler.compile
|
50
|
+
expect(content).to include("Hello, home page!")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should render the partials called from the layout" do
|
54
|
+
compiler.compile
|
55
|
+
expect(content).to include("Hello Header World")
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should render data in the body" do
|
59
|
+
compiler.compile
|
60
|
+
expect(content).to include("data sample")
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should render partials called from the body" do
|
64
|
+
compiler.compile
|
65
|
+
expect(content).to include("Hello, it!")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Prow::PagesCompiler do
|
4
|
+
let(:pages) { Prow::PagesCompiler.new(config_path, templates_path, public_path) }
|
5
|
+
let(:config_path) { File.dirname(__FILE__) + "/support/pages.json" }
|
6
|
+
let(:templates_path) { File.dirname(__FILE__) + "/support/templates" }
|
7
|
+
let(:public_path) { File.dirname(__FILE__) + "/support/public" }
|
8
|
+
|
9
|
+
describe '#compile' do
|
10
|
+
before { pages.compile }
|
11
|
+
|
12
|
+
it "compiles entries in pages.json" do
|
13
|
+
expect(File.exist?(public_path + "/index.html")).to be(true)
|
14
|
+
expect(File.exist?(public_path + "/foo.html")).to be(true)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "does not compile pages that are not included in pages.json" do
|
18
|
+
expect(File.exist?(public_path + "/bar.html")).to be(false)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require_relative "../lib/prow"
|
2
|
+
|
3
|
+
#require 'nokogiri'
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.expect_with :rspec do |expectations|
|
7
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
8
|
+
end
|
9
|
+
|
10
|
+
config.mock_with :rspec do |mocks|
|
11
|
+
mocks.verify_partial_doubles = true
|
12
|
+
end
|
13
|
+
|
14
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
15
|
+
# be too noisy due to issues in dependencies.
|
16
|
+
config.warnings = true
|
17
|
+
|
18
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
19
|
+
# file, and it's useful to allow more verbose output when running an
|
20
|
+
# individual spec file.
|
21
|
+
if config.files_to_run.one?
|
22
|
+
# Use the documentation formatter for detailed output,
|
23
|
+
# unless a formatter has already been configured
|
24
|
+
# (e.g. via a command-line flag).
|
25
|
+
config.default_formatter = 'doc'
|
26
|
+
end
|
27
|
+
|
28
|
+
# Print the 10 slowest examples and example groups at the
|
29
|
+
# end of the spec run, to help surface which specs are running
|
30
|
+
# particularly slow.
|
31
|
+
#config.profile_examples = 10
|
32
|
+
|
33
|
+
# Run specs in random order to surface order dependencies. If you find an
|
34
|
+
# order dependency and want to debug it, you can fix the order by providing
|
35
|
+
# the seed, which is printed after each run.
|
36
|
+
# --seed 1234
|
37
|
+
config.order = :random
|
38
|
+
|
39
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
40
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
41
|
+
# test failures related to randomization by passing the same `--seed` value
|
42
|
+
# as the one that triggered the failure.
|
43
|
+
Kernel.srand config.seed
|
44
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
I am bar!
|
@@ -0,0 +1 @@
|
|
1
|
+
I am foo!
|
@@ -0,0 +1 @@
|
|
1
|
+
<div id='header'>Hello Header World</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello, it!
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Prow::Template do
|
4
|
+
let(:template) { Prow::Template.new(path, templates_path) }
|
5
|
+
let(:path) { templates_path + "/layouts/default.mustache" }
|
6
|
+
let(:templates_path) { File.dirname(__FILE__) + "/support/templates" }
|
7
|
+
|
8
|
+
it "derives the type from the first directory name" do
|
9
|
+
expect(template.type).to eq("layouts")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns lazy the template content" do
|
13
|
+
expect(template.instance_variable_get('@content')).to eq(nil)
|
14
|
+
expect(template.content).to eq(File.read(path))
|
15
|
+
expect(template.instance_variable_get('@content')).not_to eq(nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "gets derives the name from the non-type end of the path" do
|
19
|
+
expect(template.name).to eq('default')
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when the path is nested' do
|
23
|
+
let(:path) { templates_path + "/partials/things/it.mustache" }
|
24
|
+
|
25
|
+
it "correctly gets the type" do
|
26
|
+
expect(template.type).to eq('partials')
|
27
|
+
end
|
28
|
+
|
29
|
+
it "correctly gets the name" do
|
30
|
+
expect(template.name).to eq("things/it")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Prow::Templates do
|
4
|
+
let(:templates) { Prow::Templates.new(templates_path) }
|
5
|
+
let(:templates_path) { File.dirname(__FILE__) + "/support/templates" }
|
6
|
+
|
7
|
+
describe '#layout' do
|
8
|
+
it "returns layouts via name" do
|
9
|
+
layout = templates.layout('default')
|
10
|
+
expect(layout).to be_a(Prow::Template)
|
11
|
+
expect(layout.name).to eq('default')
|
12
|
+
expect(layout.content).to eq(File.read(templates_path + "/layouts/default.mustache"))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "raises an error if named layout not found" do
|
16
|
+
expect { templates.layout('not-here') }.to raise_error
|
17
|
+
end
|
18
|
+
|
19
|
+
it "returns the default if no argument is passed in" do
|
20
|
+
expect(templates.layout).to eq(templates.layout('default'))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#page' do
|
25
|
+
it "returns the right partial" do
|
26
|
+
expect(templates.page('index').name).to eq('index')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#partials' do
|
31
|
+
it "returns all of the partials" do
|
32
|
+
expect(templates.partials.size).to eq(2)
|
33
|
+
expect(templates.partials.map(&:name)).to include("things/it", "header")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prow
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kane Baccigalupi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shipd_style
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mustache
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: "\n Prow is solving the problem front-end developers have when they
|
84
|
+
try to\n start a project, and need a server mock to work with. It also solves
|
85
|
+
the\n problem of creating and serving a static HTML/CSS/JS that includes heavy\n
|
86
|
+
\ front-end development work.\n\n Prow includes:\n * Mustache to HTML
|
87
|
+
file generation\n * ShipdStyle compass plugin for getting easy responsive design
|
88
|
+
widgets\n * DeMedusa the slim, extensible, JS framework\n "
|
89
|
+
email:
|
90
|
+
- baccigalupi@gmail.com
|
91
|
+
executables: []
|
92
|
+
extensions: []
|
93
|
+
extra_rdoc_files: []
|
94
|
+
files:
|
95
|
+
- ".gitignore"
|
96
|
+
- ".rspec"
|
97
|
+
- ".ruby-gemset"
|
98
|
+
- ".ruby-version"
|
99
|
+
- Gemfile
|
100
|
+
- LICENSE.txt
|
101
|
+
- README.md
|
102
|
+
- Rakefile
|
103
|
+
- lib/prow.rb
|
104
|
+
- lib/prow/default_paths.rb
|
105
|
+
- lib/prow/page_compiler.rb
|
106
|
+
- lib/prow/page_configs.rb
|
107
|
+
- lib/prow/pages_compiler.rb
|
108
|
+
- lib/prow/renderer.rb
|
109
|
+
- lib/prow/template.rb
|
110
|
+
- lib/prow/templates.rb
|
111
|
+
- lib/prow/version.rb
|
112
|
+
- prow.gemspec
|
113
|
+
- spec/page_compiler_spec.rb
|
114
|
+
- spec/pages_compiler_spec.rb
|
115
|
+
- spec/spec_helper.rb
|
116
|
+
- spec/support/pages.json
|
117
|
+
- spec/support/public/.keep
|
118
|
+
- spec/support/templates/index.mustache
|
119
|
+
- spec/support/templates/layouts/default.mustache
|
120
|
+
- spec/support/templates/layouts/foo.mustache
|
121
|
+
- spec/support/templates/pages/bar.mustache
|
122
|
+
- spec/support/templates/pages/foo.mustache
|
123
|
+
- spec/support/templates/pages/index.mustache
|
124
|
+
- spec/support/templates/partials/header.mustache
|
125
|
+
- spec/support/templates/partials/things/it.mustache
|
126
|
+
- spec/template_spec.rb
|
127
|
+
- spec/templates_spec.rb
|
128
|
+
homepage: https://github.com/shipd/prow
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.2.2
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: Prow is a front end development framework, that can also server static websites
|
152
|
+
test_files:
|
153
|
+
- spec/page_compiler_spec.rb
|
154
|
+
- spec/pages_compiler_spec.rb
|
155
|
+
- spec/spec_helper.rb
|
156
|
+
- spec/support/pages.json
|
157
|
+
- spec/support/public/.keep
|
158
|
+
- spec/support/templates/index.mustache
|
159
|
+
- spec/support/templates/layouts/default.mustache
|
160
|
+
- spec/support/templates/layouts/foo.mustache
|
161
|
+
- spec/support/templates/pages/bar.mustache
|
162
|
+
- spec/support/templates/pages/foo.mustache
|
163
|
+
- spec/support/templates/pages/index.mustache
|
164
|
+
- spec/support/templates/partials/header.mustache
|
165
|
+
- spec/support/templates/partials/things/it.mustache
|
166
|
+
- spec/template_spec.rb
|
167
|
+
- spec/templates_spec.rb
|