dynamicmatic 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -4
- data/Rakefile +2 -2
- data/VERSION.yml +3 -2
- data/dynamicmatic.gemspec +14 -5
- data/lib/sinatra/dynamicmatic.rb +5 -0
- data/lib/sinatra/dynamicmatic/middleware.rb +14 -0
- metadata +25 -5
data/README.md
CHANGED
@@ -61,8 +61,10 @@ StaticMatic is configured using `src/configuration.rb`.
|
|
61
61
|
Sinatra is configured using the `set` method.
|
62
62
|
In other words, configuration happens as usual.
|
63
63
|
|
64
|
-
|
65
|
-
Currently it only has one option:
|
64
|
+
## Preview
|
66
65
|
|
67
|
-
|
68
|
-
|
66
|
+
When you run your app in development mode,
|
67
|
+
your static pages are actually generated dynamically on each request,
|
68
|
+
just like with `staticmatic preview`.
|
69
|
+
Once you're in production, though,
|
70
|
+
they're all served swiftly from the `site` folder.
|
data/Rakefile
CHANGED
@@ -11,8 +11,8 @@ DESCRIPTION
|
|
11
11
|
gemspec.email = "nex342@gmail.com"
|
12
12
|
gemspec.homepage = "http://github.com/nex3/dynamicmatic"
|
13
13
|
gemspec.authors = ["Nathan Weizenbaum"]
|
14
|
-
|
15
|
-
|
14
|
+
gemspec.add_dependency 'sinatra', '>= 0.10.1'
|
15
|
+
gemspec.add_dependency 'staticmatic', '>= 0.10.7'
|
16
16
|
gemspec.has_rdoc = false
|
17
17
|
end
|
18
18
|
Jeweler::GemcutterTasks.new
|
data/VERSION.yml
CHANGED
data/dynamicmatic.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dynamicmatic}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nathan Weizenbaum"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-23}
|
13
13
|
s.description = %q{DynamicMatic is a tiny Sinatra extension that integrates Sinatra with StaticMatic.
|
14
14
|
It allows most of your site to be static
|
15
15
|
while having a few dynamic pages that can use the StaticMatic layouts and partials.
|
@@ -25,8 +25,10 @@ while having a few dynamic pages that can use the StaticMatic layouts and partia
|
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION.yml",
|
27
27
|
"dynamicmatic.gemspec",
|
28
|
-
"lib/sinatra/dynamicmatic.rb"
|
28
|
+
"lib/sinatra/dynamicmatic.rb",
|
29
|
+
"lib/sinatra/dynamicmatic/middleware.rb"
|
29
30
|
]
|
31
|
+
s.has_rdoc = false
|
30
32
|
s.homepage = %q{http://github.com/nex3/dynamicmatic}
|
31
33
|
s.rdoc_options = ["--charset=UTF-8"]
|
32
34
|
s.require_paths = ["lib"]
|
@@ -38,8 +40,15 @@ while having a few dynamic pages that can use the StaticMatic layouts and partia
|
|
38
40
|
s.specification_version = 3
|
39
41
|
|
40
42
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
43
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0.10.1"])
|
44
|
+
s.add_runtime_dependency(%q<staticmatic>, [">= 0.10.7"])
|
41
45
|
else
|
46
|
+
s.add_dependency(%q<sinatra>, [">= 0.10.1"])
|
47
|
+
s.add_dependency(%q<staticmatic>, [">= 0.10.7"])
|
42
48
|
end
|
43
49
|
else
|
50
|
+
s.add_dependency(%q<sinatra>, [">= 0.10.1"])
|
51
|
+
s.add_dependency(%q<staticmatic>, [">= 0.10.7"])
|
44
52
|
end
|
45
53
|
end
|
54
|
+
|
data/lib/sinatra/dynamicmatic.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'sinatra/base'
|
2
2
|
require 'staticmatic'
|
3
|
+
require File.dirname(__FILE__) + '/dynamicmatic/middleware'
|
3
4
|
|
4
5
|
module Sinatra
|
5
6
|
module DynamicMatic
|
@@ -7,6 +8,10 @@ module Sinatra
|
|
7
8
|
app.set :lock, true
|
8
9
|
app.set :public, Proc.new {app.root && File.join(app.root, 'site')}
|
9
10
|
|
11
|
+
# If we're in development, don't serve the StaticMatic files statically.
|
12
|
+
# Instead, render them dynamically, as with `staticmatic preview`.
|
13
|
+
app.use Middleware if app.environment == :development
|
14
|
+
|
10
15
|
configuration = StaticMatic::Configuration.new
|
11
16
|
|
12
17
|
config_file = "#{app.root}/src/configuration.rb"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamicmatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -9,10 +9,29 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-23 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sinatra
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.10.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: staticmatic
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.10.7
|
34
|
+
version:
|
16
35
|
description: |
|
17
36
|
DynamicMatic is a tiny Sinatra extension that integrates Sinatra with StaticMatic.
|
18
37
|
It allows most of your site to be static
|
@@ -33,7 +52,8 @@ files:
|
|
33
52
|
- VERSION.yml
|
34
53
|
- dynamicmatic.gemspec
|
35
54
|
- lib/sinatra/dynamicmatic.rb
|
36
|
-
|
55
|
+
- lib/sinatra/dynamicmatic/middleware.rb
|
56
|
+
has_rdoc: false
|
37
57
|
homepage: http://github.com/nex3/dynamicmatic
|
38
58
|
licenses: []
|
39
59
|
|