orthorings 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -6
- data/VERSION +1 -1
- data/lib/orthor/object.rb +3 -4
- data/orthorings.gemspec +2 -2
- data/spec/orthor/dsl_spec.rb +8 -3
- data/spec/orthor_helper_spec.rb +3 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -9,7 +9,7 @@ The 2 main things you can do with Orthorings are:
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
As a gem
|
12
|
+
As a gem
|
13
13
|
|
14
14
|
gem install orthorings
|
15
15
|
|
@@ -36,14 +36,14 @@ Here is some example usage (more docs to come, this is still a WIP and some aspe
|
|
36
36
|
keywords "your, site, specific, keywords"
|
37
37
|
description "what's your site doing?"
|
38
38
|
|
39
|
-
page "/", "
|
40
|
-
page "/about"
|
39
|
+
page "/", "home"
|
40
|
+
page "/about"
|
41
41
|
|
42
|
-
feed "/blog.rss", "
|
43
|
-
|
42
|
+
feed "/blog.rss", "our-blog" do
|
43
|
+
name "Our Blog Feed"
|
44
44
|
end
|
45
45
|
|
46
|
-
static_page "/about-us"
|
46
|
+
static_page "/about-us" do
|
47
47
|
view "public/about_us"
|
48
48
|
end
|
49
49
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/orthor/object.rb
CHANGED
@@ -6,11 +6,10 @@ module Orthor
|
|
6
6
|
attr_accessor :path
|
7
7
|
dsl_accessor :name, :id, :view
|
8
8
|
|
9
|
-
def initialize(path,
|
9
|
+
def initialize(path, id = nil, &block)
|
10
10
|
@path = path
|
11
11
|
raise "Path required" unless @path
|
12
|
-
@id = @path.split("/").last
|
13
|
-
name(object_name)
|
12
|
+
@id = id || @path.split("/").last
|
14
13
|
|
15
14
|
instance_eval &block if block_given?
|
16
15
|
end
|
@@ -27,4 +26,4 @@ module Orthor
|
|
27
26
|
raise "This must be overriden in any Orthor::Object subclass"
|
28
27
|
end
|
29
28
|
end
|
30
|
-
end
|
29
|
+
end
|
data/orthorings.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{orthorings}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Anthony Langhorne"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-06}
|
13
13
|
s.email = %q{anthony@orthor.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
data/spec/orthor/dsl_spec.rb
CHANGED
@@ -173,8 +173,10 @@ describe Orthor::Site, "orthor site dsl" do
|
|
173
173
|
describe "pages" do
|
174
174
|
before(:all) do
|
175
175
|
Orthor::Site.define do
|
176
|
-
page "/about-us", "
|
177
|
-
|
176
|
+
page "/about-us", "about" do
|
177
|
+
name "About us"
|
178
|
+
end
|
179
|
+
page "/contact"
|
178
180
|
page "/" do
|
179
181
|
name "Home"
|
180
182
|
cache_for 3600
|
@@ -205,9 +207,12 @@ describe Orthor::Site, "orthor site dsl" do
|
|
205
207
|
end
|
206
208
|
|
207
209
|
it "id should be inferred from the path if none is given" do
|
208
|
-
@page_1.id.should == "about-us"
|
209
210
|
@page_2.id.should == "contact"
|
210
211
|
end
|
212
|
+
|
213
|
+
it "id should be 2nd argument if any is given" do
|
214
|
+
@page_1.id.should == "about"
|
215
|
+
end
|
211
216
|
|
212
217
|
it 'should allow setting specific http cache lengths' do
|
213
218
|
@page_1.cache_for.should == 0 # sites default
|
data/spec/orthor_helper_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthorings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Langhorne
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-04-
|
12
|
+
date: 2010-04-06 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|