kiss 0.9.4 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,7 @@ class Kiss
53
53
  # processing).
54
54
  def insert(options = {})
55
55
  path = get_template_path(options)
56
- content = File.read(path)
56
+ content = ::File.read(path)
57
57
  end
58
58
 
59
59
  # Processes template specified by options and return results.
@@ -64,12 +64,10 @@ class Kiss
64
64
 
65
65
  # Gets path to insert/template file from specified options.
66
66
  def get_template_path(options)
67
- @current_template_dir ||= @template_dir
67
+ @current_template_dir ||= @template_dir + action_subdir
68
68
 
69
69
  path = options.is_a?(String) ? options : "#{options[:template]}.#{options[:extension] || 'rhtml'}"
70
- path = path =~ /\A\// ? "#{@template_dir}#{path}" : "#{@current_template_dir}/#{path}"
71
-
72
- path
70
+ (path =~ /\A\//) ? "#{@template_dir}#{path}" : "#{@current_template_dir}/#{path}"
73
71
  end
74
72
 
75
73
  # Processes specified template file using specified binding.
@@ -98,7 +96,7 @@ class Kiss
98
96
  result = eval eruby_src, template_binding, path
99
97
 
100
98
  # restore previous template dir
101
- @template_dir = old_template_dir
99
+ @current_template_dir = old_template_dir
102
100
 
103
101
  result
104
102
  end
@@ -116,10 +114,5 @@ class Kiss
116
114
  def escape_html(str)
117
115
  Rack::Utils.escape_html(str)
118
116
  end
119
-
120
- # Formats number to two decimal places.
121
- def currency(num)
122
- sprintf("%0.2f",num.to_f)
123
- end
124
117
  end
125
118
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: "1.0"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Van Ittersum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-21 00:00:00 -07:00
12
+ date: 2008-09-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -53,7 +53,9 @@ files:
53
53
  - LICENSE
54
54
  - lib/kiss
55
55
  - lib/kiss/action.rb
56
+ - lib/kiss/bench.rb
56
57
  - lib/kiss/controller_accessors.rb
58
+ - lib/kiss/debug.rb
57
59
  - lib/kiss/exception_report.rb
58
60
  - lib/kiss/form
59
61
  - lib/kiss/form/field.rb
@@ -67,13 +69,13 @@ files:
67
69
  - lib/kiss/rack/bench.rb
68
70
  - lib/kiss/rack/email_errors.rb
69
71
  - lib/kiss/rack/facebook.rb
70
- - lib/kiss/rack/file.rb
71
72
  - lib/kiss/rack/file_not_found.rb
72
73
  - lib/kiss/rack/log_exceptions.rb
73
74
  - lib/kiss/rack/show_debug.rb
74
75
  - lib/kiss/rack/show_exceptions.rb
75
76
  - lib/kiss/sequel_mysql.rb
76
77
  - lib/kiss/sequel_session.rb
78
+ - lib/kiss/static_file.rb
77
79
  - lib/kiss/template_methods.rb
78
80
  - lib/kiss.rb
79
81
  has_rdoc: true
File without changes