trivial 0.0.3 → 0.0.4
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/Rakefile +1 -1
- data/bin/trivialize +5 -1
- data/dist/htaccess.dist +1 -2
- data/lib/trivial.php +4 -4
- data/trivial.gemspec +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('trivial', '0.0.
|
5
|
+
Echoe.new('trivial', '0.0.4') do |p|
|
6
6
|
p.summary = "Ultra-lightweight website framework for PHP"
|
7
7
|
p.description = <<-EOT
|
8
8
|
For those who are using PHP to build their sites and want a very simple framework
|
data/bin/trivialize
CHANGED
@@ -19,7 +19,11 @@ end
|
|
19
19
|
[ [File.dirname(__FILE__), '..', 'content', 'index.html'], [ARGV[0], 'content', 'index.html'] ],
|
20
20
|
[ [File.dirname(__FILE__), '..', 'styles', 'application.css'], [ARGV[0], 'styles', 'application.css'] ]
|
21
21
|
].each do |src, dest|
|
22
|
-
|
22
|
+
if !File.exists? File.join(*dest)
|
23
|
+
FileUtils.cp(File.join(*src), File.join(*dest))
|
24
|
+
else
|
25
|
+
puts "Won't overwrite existing #{File.join(*dest)}!"
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
puts "Done! Make sure you can use .htaccess files in your Webserver setup."
|
data/dist/htaccess.dist
CHANGED
data/lib/trivial.php
CHANGED
@@ -38,12 +38,12 @@ $trim = str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath($root_dir)
|
|
38
38
|
$requested = preg_replace('#/$#', '/index.html', $_SERVER['REDIRECT_URL']);
|
39
39
|
$requested = preg_replace("#${trim}/(.*)\.[^\.]+\$#", '\1', $requested);
|
40
40
|
|
41
|
-
function styles(
|
42
|
-
return head_component(
|
41
|
+
function styles() {
|
42
|
+
return head_component(func_get_args(), 'styles/%s.css', '<link rel="stylesheet" href="styles/%s.css" type="text/css" />');
|
43
43
|
}
|
44
44
|
|
45
|
-
function scripts(
|
46
|
-
return head_component(
|
45
|
+
function scripts() {
|
46
|
+
return head_component(func_get_args(), 'scripts/%s.js', '<script type="text/javascript" src="scripts/%s.js"></script>');
|
47
47
|
}
|
48
48
|
|
49
49
|
function head_component($additional, $search, $format) {
|
data/trivial.gemspec
CHANGED