trivial 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
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.3') do |p|
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
- FileUtils.cp(File.join(*src), File.join(*dest))
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
@@ -5,5 +5,4 @@ RewriteRule ^$ lib/trivial.php [L]
5
5
  RewriteCond %{REQUEST_FILENAME} !-d
6
6
  RewriteCond %{REQUEST_FILENAME} !-f
7
7
  RewriteCond %{REQUEST_FILENAME} !.*\.inc$
8
- RewriteRule /(.*) lib/trivial.php [L]
9
-
8
+ RewriteRule (.*) lib/trivial.php [L]
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($additional = array()) {
42
- return head_component($additional, 'styles/%s.css', '<link rel="stylesheet" href="styles/%s.css" type="text/css" />');
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($additional = array()) {
46
- return head_component($additional, 'scripts/%s.js', '<script type="text/javascript" src="scripts/%s.js"></script>');
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{trivial}
5
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Bintz"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Bintz