forked from rwz/nestive
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pavel Pravosud
committed
Feb 26, 2012
1 parent
c597616
commit 403cda4
Showing
24 changed files
with
258 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,110 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
nestive (0.0.1.pre) | ||
nestive (0.1.0) | ||
rails (~> 3.0) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
abstract (1.0.0) | ||
actionmailer (3.0.7) | ||
actionpack (= 3.0.7) | ||
mail (~> 2.2.15) | ||
actionpack (3.0.7) | ||
activemodel (= 3.0.7) | ||
activesupport (= 3.0.7) | ||
builder (~> 2.1.2) | ||
erubis (~> 2.6.6) | ||
i18n (~> 0.5.0) | ||
rack (~> 1.2.1) | ||
rack-mount (~> 0.6.14) | ||
rack-test (~> 0.5.7) | ||
tzinfo (~> 0.3.23) | ||
activemodel (3.0.7) | ||
activesupport (= 3.0.7) | ||
builder (~> 2.1.2) | ||
i18n (~> 0.5.0) | ||
activerecord (3.0.7) | ||
activemodel (= 3.0.7) | ||
activesupport (= 3.0.7) | ||
arel (~> 2.0.2) | ||
tzinfo (~> 0.3.23) | ||
activeresource (3.0.7) | ||
activemodel (= 3.0.7) | ||
activesupport (= 3.0.7) | ||
activesupport (3.0.7) | ||
arel (2.0.10) | ||
builder (2.1.2) | ||
erubis (2.6.6) | ||
abstract (>= 1.0.0) | ||
i18n (0.5.0) | ||
mail (2.2.19) | ||
activesupport (>= 2.3.6) | ||
actionmailer (3.2.1) | ||
actionpack (= 3.2.1) | ||
mail (~> 2.4.0) | ||
actionpack (3.2.1) | ||
activemodel (= 3.2.1) | ||
activesupport (= 3.2.1) | ||
builder (~> 3.0.0) | ||
erubis (~> 2.7.0) | ||
journey (~> 1.0.1) | ||
rack (~> 1.4.0) | ||
rack-cache (~> 1.1) | ||
rack-test (~> 0.6.1) | ||
sprockets (~> 2.1.2) | ||
activemodel (3.2.1) | ||
activesupport (= 3.2.1) | ||
builder (~> 3.0.0) | ||
activerecord (3.2.1) | ||
activemodel (= 3.2.1) | ||
activesupport (= 3.2.1) | ||
arel (~> 3.0.0) | ||
tzinfo (~> 0.3.29) | ||
activeresource (3.2.1) | ||
activemodel (= 3.2.1) | ||
activesupport (= 3.2.1) | ||
activesupport (3.2.1) | ||
i18n (~> 0.6) | ||
multi_json (~> 1.0) | ||
arel (3.0.2) | ||
builder (3.0.0) | ||
combustion (0.3.1) | ||
rails (>= 3.1.0) | ||
thor (>= 0.14.6) | ||
diff-lcs (1.1.3) | ||
erubis (2.7.0) | ||
hike (1.2.1) | ||
i18n (0.6.0) | ||
journey (1.0.3) | ||
json (1.6.5) | ||
mail (2.4.1) | ||
i18n (>= 0.4.0) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
mime-types (1.16) | ||
polyglot (0.3.1) | ||
rack (1.2.3) | ||
rack-mount (0.6.14) | ||
rack (>= 1.0.0) | ||
rack-test (0.5.7) | ||
mime-types (1.17.2) | ||
multi_json (1.1.0) | ||
polyglot (0.3.3) | ||
rack (1.4.1) | ||
rack-cache (1.1) | ||
rack (>= 0.4) | ||
rack-ssl (1.3.2) | ||
rack | ||
rack-test (0.6.1) | ||
rack (>= 1.0) | ||
rails (3.0.7) | ||
actionmailer (= 3.0.7) | ||
actionpack (= 3.0.7) | ||
activerecord (= 3.0.7) | ||
activeresource (= 3.0.7) | ||
activesupport (= 3.0.7) | ||
rails (3.2.1) | ||
actionmailer (= 3.2.1) | ||
actionpack (= 3.2.1) | ||
activerecord (= 3.2.1) | ||
activeresource (= 3.2.1) | ||
activesupport (= 3.2.1) | ||
bundler (~> 1.0) | ||
railties (= 3.0.7) | ||
railties (3.0.7) | ||
actionpack (= 3.0.7) | ||
activesupport (= 3.0.7) | ||
railties (= 3.2.1) | ||
railties (3.2.1) | ||
actionpack (= 3.2.1) | ||
activesupport (= 3.2.1) | ||
rack-ssl (~> 1.3.2) | ||
rake (>= 0.8.7) | ||
thor (~> 0.14.4) | ||
rake (0.9.0) | ||
rdoc (~> 3.4) | ||
thor (~> 0.14.6) | ||
rake (0.9.2.2) | ||
rdoc (3.12) | ||
json (~> 1.4) | ||
rspec (2.8.0) | ||
rspec-core (~> 2.8.0) | ||
rspec-expectations (~> 2.8.0) | ||
rspec-mocks (~> 2.8.0) | ||
rspec-core (2.8.0) | ||
rspec-expectations (2.8.0) | ||
diff-lcs (~> 1.1.2) | ||
rspec-mocks (2.8.0) | ||
rspec-rails (2.8.1) | ||
actionpack (>= 3.0) | ||
activesupport (>= 3.0) | ||
railties (>= 3.0) | ||
rspec (~> 2.8.0) | ||
sprockets (2.1.2) | ||
hike (~> 1.2) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
thor (0.14.6) | ||
treetop (1.4.9) | ||
tilt (1.3.3) | ||
treetop (1.4.10) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
tzinfo (0.3.27) | ||
tzinfo (0.3.31) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
combustion | ||
nestive! | ||
rails (~> 3.0) | ||
rspec-rails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'rubygems' | ||
require 'bundler' | ||
|
||
Bundler.require :default, :development | ||
|
||
Combustion.initialize! | ||
run Combustion::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
require 'spec_helper' | ||
|
||
describe NestiveController do | ||
render_views | ||
|
||
context '#area' do | ||
it 'is empty by default' do | ||
get :index | ||
assert_select '#empty-area', '' | ||
end | ||
|
||
it 'shows initial value if any' do | ||
get :index | ||
assert_select 'title', 'Nestive' | ||
end | ||
|
||
it 'can accept blocks as initial value' do | ||
get :index | ||
assert_select '#some-area', 'Some content' | ||
end | ||
end | ||
|
||
context '#append' do | ||
it 'appends content to area as a string' do | ||
get :append | ||
assert_select 'title', 'Nestive is awesome' | ||
end | ||
|
||
it 'appends content to area as a block' do | ||
get :append | ||
assert_select '#some-area', "Some content\n Another content" | ||
end | ||
end | ||
|
||
context '#prepend' do | ||
it 'prepends content to area as a string' do | ||
get :prepend | ||
assert_select 'title', 'Awesome Nestive' | ||
end | ||
|
||
it 'prepends content to area as a block' do | ||
get :prepend | ||
assert_select '#some-area', "Prepended\n Some content" | ||
end | ||
end | ||
|
||
context '#replace' do | ||
it 'replaces area content with string' do | ||
get :replace | ||
assert_select 'title', 'Lolwut' | ||
end | ||
|
||
it 'replaces area content with block' do | ||
get :replace | ||
assert_select '#some-area', 'replaced' | ||
end | ||
end | ||
|
||
context '#extends' do | ||
it 'extends layouts' do | ||
get :extended_one | ||
assert_select 'p', 'extended: one' | ||
assert_select 'title', 'extended: one' | ||
assert_select 'h2', 'extended: one' | ||
end | ||
|
||
it 'can extend already extended layouts' do | ||
get :extended_two | ||
assert_select 'p', 'extended: two' | ||
assert_select 'title', 'extended: one' | ||
assert_select '#some-area', 'extended: two' | ||
assert_select 'h2', 'extended: one' | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ApplicationController < ActionController::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class NestiveController < ApplicationController | ||
def extended_one | ||
render layout: 'extend_one' | ||
end | ||
|
||
def extended_two | ||
render layout: 'extend_two' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= extends :nestive do %> | ||
<% replace :title, 'extended: one' %> | ||
|
||
<h2>extended: one</h2> | ||
|
||
<%= yield %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%= extends :extend_one do %> | ||
<%= replace :some_area do %> | ||
extended: two | ||
<% end %> | ||
<%= yield %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title><%= area :title, 'Nestive' %></title> | ||
</head> | ||
<body> | ||
<%= yield %> | ||
<div id="some-area"> | ||
<%= area :some_area do -%> | ||
Some content | ||
<%- end -%> | ||
</div> | ||
<div id="empty-area"><%= area :empty_area %></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<h1>here we'll be appending to areas</h1> | ||
|
||
<% append :title, ' is awesome' %> | ||
<% append :some_area do %> | ||
Another content | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>extended: one</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>extended: two</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello World</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<h1>here we'll be prepending stuff to areas</h1> | ||
|
||
<% prepend :title, 'Awesome ' %> | ||
<% prepend :some_area do %> | ||
Prepended | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1>replacing areas</h1> | ||
|
||
<% replace :title, 'Lolwut' %> | ||
<%= replace :some_area do %> | ||
replaced | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test: | ||
adapter: sqlite3 | ||
database: db/combustion_test.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.routes.draw do | ||
match ':controller/:action' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ActiveRecord::Schema.define do | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.log |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'bundler/setup' | ||
require 'rails' | ||
require 'combustion' | ||
|
||
require File.expand_path('../../lib/nestive', __FILE__) | ||
|
||
Combustion.initialize! :action_controller | ||
|
||
require 'rspec/rails' |
Oops, something went wrong.