scharfie-bones 0.2.0 → 0.2.1
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.
data/bones.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "bones"
|
3
|
-
s.version = "0.2.
|
4
|
-
s.date = "2009-02-
|
3
|
+
s.version = "0.2.1"
|
4
|
+
s.date = "2009-02-10"
|
5
5
|
s.authors = ["Chris Scharf", "Ryan Heath"]
|
6
6
|
s.email = "scharfie@gmail.com"
|
7
7
|
|
@@ -70,4 +70,4 @@ Gem::Specification.new do |s|
|
|
70
70
|
# Dependencies
|
71
71
|
s.add_dependency("rack", ["= 0.3.0"])
|
72
72
|
s.add_dependency("activesupport", [">= 2.1.0"])
|
73
|
-
end
|
73
|
+
end
|
data/lib/bones/initializer.rb
CHANGED
@@ -37,25 +37,33 @@ class Bones
|
|
37
37
|
|
38
38
|
ensure_file(Bones.root / 'layouts' / 'application.html.erb') do |f|
|
39
39
|
f.write <<-HTML
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
40
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
41
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
42
|
+
<html>
|
43
|
+
<head>
|
44
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
45
|
+
<title>Welcome to bones</title>
|
46
|
+
<%= stylesheet_link_tag 'styles' %>
|
47
|
+
<%= javascript_include_tag %>
|
48
|
+
</head>
|
49
|
+
<body>
|
50
|
+
<h1>Welcome to <strong>bones</strong></h1>
|
51
|
+
<%= yield %>
|
52
|
+
</body>
|
53
|
+
</html>
|
54
54
|
HTML
|
55
55
|
end
|
56
56
|
|
57
57
|
ensure_file(Bones.root / 'public' / 'stylesheets' / 'styles.css')
|
58
58
|
|
59
|
+
ensure_file(Bones.root / 'helpers' / 'application_helper.rb') do |f|
|
60
|
+
f.write <<-HELPER
|
61
|
+
# Provide any custom helpers that want in this module
|
62
|
+
module ApplicationHelper
|
63
|
+
end
|
64
|
+
HELPER
|
65
|
+
end
|
66
|
+
|
59
67
|
ensure_file(Bones.root / 'Rakefile') do |f|
|
60
68
|
puts "** Adding Rakefile to parent directory"
|
61
69
|
f.write File.read(Bones.system_path / 'Rakefile')
|
data/lib/bones/template.rb
CHANGED
@@ -82,7 +82,10 @@ class Bones
|
|
82
82
|
|
83
83
|
if layout && File.file?(layout_filename)
|
84
84
|
erb = ERB.new(File.read(layout_filename))
|
85
|
-
erb.
|
85
|
+
eval(erb.src) do |key|
|
86
|
+
key = :layout if key.blank?
|
87
|
+
instance_variable_get(:"@content_for_#{key}")
|
88
|
+
end
|
86
89
|
else
|
87
90
|
@content_for_layout
|
88
91
|
end
|
data/lib/helpers/core_helper.rb
CHANGED
data/test/test_template.rb
CHANGED
@@ -65,5 +65,9 @@ context "Bones template 'about'" do
|
|
65
65
|
test "should use layout 'example_layout'" do
|
66
66
|
assert_equal 'example_layout', @template.layout
|
67
67
|
assert_include @response, 'Example Layout'
|
68
|
+
assert_include @response, 'About page'
|
69
|
+
assert_include @response, 'Chris'
|
70
|
+
|
71
|
+
assert 'Chris', @template.instance_variable_get(:@content_for_name)
|
68
72
|
end
|
69
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scharfie-bones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Scharf
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-02-
|
13
|
+
date: 2009-02-10 00:00:00 -08:00
|
14
14
|
default_executable: bones
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|