nanoant-sinatra-hat 0.0.2

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/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Adam Strzelecki
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,27 @@
1
+ Sinatra Hat
2
+ ===========
3
+ This is a set of extensions for *Sinatra* and relative gems such as *Sequel*, *Haml*, *GetText*.
4
+
5
+ It adds following functions to your *Sinatra* project:
6
+
7
+ - Automatic translation using *GetText* or *Fast_Gettext* of *Haml* templates, and parser for `po` file generation
8
+ - Several fixes for *Sequel*, *Rack*
9
+ - Rack reloader for *Sinatra* and *GetText* translations
10
+ - String permalinks and date extensions
11
+
12
+ Setup
13
+ =====
14
+ ### 1. Install
15
+ sudo gem install nanoant-sinatra-hat -s http://gems.github.com/
16
+
17
+ Or from source:
18
+
19
+ git clone git://github.com/nanoant/sinatra-hat.git
20
+ cd sinatra-hat && rake install
21
+
22
+ Author
23
+ ======
24
+ [Adam Strzelecki](http://www.nanoant.com/)
25
+ ono@java.pl
26
+
27
+ Released under MIT license, see `MIT-LICENSE` for details.
data/Rakefile ADDED
@@ -0,0 +1,58 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "sinatra-hat"
8
+ gem.description = "Sinatra Ruby gem extensions for gettext, caching, reloading, etc."
9
+ gem.summary = "Sinatra Ruby gem extensions for gettext, caching, reloading, etc."
10
+ gem.email = "ono@java.pl"
11
+ gem.homepage = "http://github.com/nanoant/sinatra-hat"
12
+ gem.authors = ["Adam Strzelecki"]
13
+ gem.files = FileList['lib/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*'].to_a
14
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
+ end
16
+
17
+ rescue LoadError
18
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
19
+ end
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |test|
23
+ test.libs << 'lib' << 'test'
24
+ test.pattern = 'test/**/*_test.rb'
25
+ test.verbose = true
26
+ end
27
+
28
+ begin
29
+ require 'rcov/rcovtask'
30
+ Rcov::RcovTask.new do |test|
31
+ test.libs << 'test'
32
+ test.pattern = 'test/**/*_test.rb'
33
+ test.verbose = true
34
+ end
35
+ rescue LoadError
36
+ task :rcov do
37
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
38
+ end
39
+ end
40
+
41
+
42
+ task :default => :test
43
+
44
+ require 'rake/rdoctask'
45
+ Rake::RDocTask.new do |rdoc|
46
+ if File.exist?('VERSION.yml')
47
+ config = YAML.load(File.read('VERSION.yml'))
48
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
49
+ else
50
+ version = ""
51
+ end
52
+
53
+ rdoc.rdoc_dir = 'rdoc'
54
+ rdoc.title = "sinatra-hat #{version}"
55
+ rdoc.rdoc_files.include('README*')
56
+ rdoc.rdoc_files.include('lib/**/*.rb')
57
+ end
58
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.2
@@ -0,0 +1,80 @@
1
+ class Date
2
+ silence_warnings do
3
+ MONTHNAMES = [nil,
4
+ N_('January'),
5
+ N_('February'),
6
+ N_('March'),
7
+ N_('April'),
8
+ N_('May'),
9
+ N_('June'),
10
+ N_('July'),
11
+ N_('August'),
12
+ N_('September'),
13
+ N_('October'),
14
+ N_('November'),
15
+ N_('December')]
16
+
17
+ BASE_MONTHNAMES = [nil,
18
+ N_('b|January'),
19
+ N_('b|February'),
20
+ N_('b|March'),
21
+ N_('b|April'),
22
+ N_('b|May'),
23
+ N_('b|June'),
24
+ N_('b|July'),
25
+ N_('b|August'),
26
+ N_('b|September'),
27
+ N_('b|October'),
28
+ N_('b|November'),
29
+ N_('b|December')]
30
+
31
+ DAYNAMES = [
32
+ N_('Sunday'),
33
+ N_('Monday'),
34
+ N_('Tuesday'),
35
+ N_('Wednesday'),
36
+ N_('Thursday'),
37
+ N_('Friday'),
38
+ N_('Saturday')]
39
+
40
+ ABBR_MONTHNAMES = [nil,
41
+ N_('Jan'),
42
+ N_('Feb'),
43
+ N_('Mar'),
44
+ N_('Apr'),
45
+ N_('May'),
46
+ N_('Jun'),
47
+ N_('Jul'),
48
+ N_('Aug'),
49
+ N_('Sep'),
50
+ N_('Oct'),
51
+ N_('Nov'),
52
+ N_('Dec')]
53
+
54
+ ABBR_DAYNAMES = [
55
+ N_('Sun'),
56
+ N_('Mon'),
57
+ N_('Tue'),
58
+ N_('Wed'),
59
+ N_('Thu'),
60
+ N_('Fri'),
61
+ N_('Sat')]
62
+ end
63
+ end
64
+
65
+ class Time
66
+ alias :strftime_nolocale :strftime
67
+
68
+ def strftime_gettext(format)
69
+ format = format.dup
70
+ format.gsub!(/%a/, _(Date::ABBR_DAYNAMES[self.wday]))
71
+ format.gsub!(/%A/, _(Date::DAYNAMES[self.wday]))
72
+ format.gsub!(/%b/, _(Date::ABBR_MONTHNAMES[self.mon]))
73
+ format.gsub!(/%B/, _(Date::MONTHNAMES[self.mon]))
74
+ self.strftime_nolocale(format)
75
+ end
76
+
77
+ def to_s
78
+ strftime_gettext _('%I:%M %p, %A, %B %d, %Y')
79
+ end
80
+ end
@@ -0,0 +1,36 @@
1
+ # Haml gettext module providing gettext translation for all Haml plain text
2
+ # calls
3
+ # http://pastie.org/445295
4
+
5
+ class Haml::Engine
6
+ # Inject _ gettext into plain text and tag plain text calls
7
+ def push_plain(text)
8
+ super(_(text))
9
+ end
10
+ def parse_tag(line)
11
+ tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
12
+ nuke_inner_whitespace, action, value, last_line = super(line)
13
+ value = _(value) unless action && action != '!' || action == '!' && value[0..0] == '=' || value.empty?
14
+ # translate inline ruby code too
15
+ value.gsub!(/_\('([^']+)'\)/) {|m| '\''+_($1)+'\''} unless action != '=' || value.empty?
16
+ attributes_hashes.each{|h| h.each{|v| v.gsub!(/_\('([^']+)'\)/){|m| '\''+_($1)+'\''} if v.is_a? String} unless h.nil? || h.empty?} unless attributes_hashes.nil? || attributes_hashes.empty?
17
+ [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
18
+ nuke_inner_whitespace, action, value, last_line]
19
+ end
20
+ def push_flat(line)
21
+ return super(line) if @gettext_filters.nil? || !@gettext_filters.last
22
+ text = line.full.dup
23
+ text = "" unless text.gsub!(/^#{@flat_spaces}/, '')
24
+ text = _(text) if text != ''
25
+ @filter_buffer << "#{text}\n"
26
+ end
27
+ def start_filtered(name)
28
+ @gettext_filters ||= []
29
+ @gettext_filters.push( (name == 'markdown') )
30
+ super
31
+ end
32
+ def close_filtered(filter)
33
+ @gettext_filters.pop
34
+ super
35
+ end
36
+ end
@@ -0,0 +1,61 @@
1
+ # Haml gettext parser module
2
+ # http://pastie.org/445297
3
+
4
+ require 'gettext/tools/rgettext'
5
+ require 'gettext/parser/ruby'
6
+ require 'haml'
7
+
8
+ class String
9
+ def escape_single_quotes
10
+ self.gsub(/'/, "\\\\'")
11
+ end
12
+ end
13
+
14
+ class Haml::Engine
15
+ # Overriden function that parses Haml tags
16
+ # Injects gettext call for plain text action.
17
+ def parse_tag(line)
18
+ tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
19
+ nuke_inner_whitespace, action, value, last_line = super(line)
20
+ @precompiled << "_('#{value.escape_single_quotes}')\n" unless action && action != '!' || action == '!' && value[0..0] == '=' || value.empty?
21
+ [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
22
+ nuke_inner_whitespace, action, value, last_line]
23
+ end
24
+ # Overriden function that producted Haml plain text
25
+ # Injects gettext call for plain text action.
26
+ def push_plain(text)
27
+ @precompiled << "_('#{text.escape_single_quotes}')\n"
28
+ end
29
+ def push_flat(line)
30
+ return super(line) if @gettext_filters.nil? || !@gettext_filters.last
31
+ text = line.unstripped
32
+ return if text == ''
33
+ @precompiled << "_('#{text.escape_single_quotes}')\n"
34
+ end
35
+ def start_filtered(name)
36
+ @gettext_filters ||= []
37
+ @gettext_filters.push( (name == 'markdown') )
38
+ super
39
+ end
40
+ def close_filtered(filter)
41
+ @gettext_filters.pop
42
+ super
43
+ end
44
+ end
45
+
46
+ # Haml gettext parser
47
+ module HamlParser
48
+ module_function
49
+
50
+ def target?(file)
51
+ File.extname(file) == ".haml"
52
+ end
53
+
54
+ def parse(file, ary = [])
55
+ haml = Haml::Engine.new(IO.readlines(file).join)
56
+ code = haml.precompiled.split(/$/)
57
+ GetText::RubyParser.parse_lines(file, code, ary)
58
+ end
59
+ end
60
+
61
+ GetText::RGetText.add_parser(HamlParser)
@@ -0,0 +1,20 @@
1
+ # Temporarily fixes gettext error:
2
+ # lib/gettext/locale_path.rb:77:in `%': key not found (KeyError)
3
+
4
+ if RUBY_VERSION >= "1.9.0"
5
+
6
+ module GetText
7
+ class LocalePath
8
+ def initialize(name, topdir = nil)
9
+ @name = name
10
+ if topdir
11
+ @locale_paths = ["#{topdir}/%{lang}/LC_MESSAGES/%{name}.mo", "#{topdir}/%{lang}/%{name}.mo"]
12
+ else
13
+ @locale_paths = self.class.default_path_rules
14
+ end
15
+ @locale_paths.map! {|v| v % {:name => name, :lang => '%{lang}'} }
16
+ end
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,14 @@
1
+ # PATH_INFO and QUERY_STRING may not be defined when using lighttpd with server.error-handler-404 trick
2
+ class Rack::Handler::FastCGI
3
+ class <<self
4
+ alias rack_serve serve
5
+ def serve(request, app)
6
+ env = request.env
7
+ parts = env['REQUEST_URI'].to_s.split('?')
8
+ env['SCRIPT_NAME'] = ''
9
+ env['PATH_INFO'] = parts[0] if env['PATH_INFO'] == ''
10
+ env['QUERY_STRING'] = parts[1..-1].join('?') if parts.length > 1 && env['QUERY_STRING'] == ''
11
+ rack_serve(request, app)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,62 @@
1
+ module GetText
2
+ class Reloader < ::Rack::Reloader
3
+ def initialize(app, cooldown = 10)
4
+ @po = Dir.glob(File.join(File.dirname(__FILE__), '..', 'locale', '**', '*.po'))
5
+ @mo = Dir.glob(File.join(File.dirname(__FILE__), '..', 'locale', '**', '*.mo'))
6
+ @pot = File.join(File.dirname(__FILE__), '..', 'locale', 'rbigg.pot') # Used for locking
7
+ # If there are not translations, give up
8
+ cooldown = nil unless @po && @mo && @po.size > 0 && @mo.size > 0
9
+ super(app, cooldown, Stat)
10
+ end
11
+
12
+ def safe_load(file, mtime, stderr = $stderr)
13
+ @translations += 1
14
+ stderr.puts "#{self.class}: reloaded `#{FastGettext.text_domain}' translation `#{file}'"
15
+ ensure
16
+ @mtimes[file] = mtime
17
+ end
18
+
19
+ def reload!(stderr = $stderr)
20
+ @translations = 0
21
+ super
22
+ if @translations > 0
23
+ found, stat = safe_stat(@mo.first)
24
+ if found && stat
25
+ File.open(@pot, 'r') do |f|
26
+ # Ensure we don't produce translation twice
27
+ f.flock(File::LOCK_EX)
28
+ found, mstat = safe_stat(@mo.first)
29
+ if found && mstat && mstat.mtime == stat.mtime
30
+ require 'gettext/tools'
31
+ Dir.chdir File.join(File.dirname(__FILE__), '..') do
32
+ GetText.create_mofiles(:po_root => 'locale', :mo_root => 'locale')
33
+ end
34
+ end
35
+ # Reload whole translation
36
+ FastGettext.add_text_domain(FastGettext.text_domain, :path => File.join(File.dirname(__FILE__), '..', 'locale'))
37
+ FastGettext.current_cache = {}
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ module Stat
44
+ def rotation
45
+ @po.map{|file|
46
+ found, stat = safe_stat(file)
47
+ next unless found and stat and mtime = stat.mtime
48
+ @cache[file] = found
49
+ yield(found, mtime)
50
+ }.compact
51
+ end
52
+
53
+ def safe_stat(file)
54
+ return unless file
55
+ stat = ::File.stat(file)
56
+ return file, stat if stat.file?
57
+ rescue Errno::ENOENT, Errno::ENOTDIR
58
+ @cache.delete(file) and false
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,15 @@
1
+ # Temporarily fixes Sequel Ruby 1.9 error:
2
+ # Encoding::CompatibilityError - incompatible character encodings:
3
+ # UTF-8 and ASCII-8BIT
4
+ # Since all variables are returned as ASCII-8BIT
5
+
6
+ if RUBY_VERSION >= "1.9.0"
7
+
8
+ class Sequel::Model
9
+ def self.load(row)
10
+ row.values.each{|v| v.force_encoding('utf-8') if v.is_a?(String)}
11
+ super(row)
12
+ end
13
+ end
14
+
15
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ # http://gist.github.com/93045
2
+ require 'iconv'
3
+ class String
4
+ def to_permalink
5
+ Iconv.iconv('ascii//translit//IGNORE', 'utf-8', self).first.gsub("'", "").gsub(/[^\x00-\x7F]+/, '').gsub(/[^a-zA-Z0-9-]+/, '-').gsub(/--+/, '-').gsub(/^-/, '').gsub(/-$/, '').downcase
6
+ end
7
+ end
@@ -0,0 +1,164 @@
1
+ # encoding: utf-8
2
+
3
+ class Integer
4
+ def minute
5
+ self * 60
6
+ end
7
+ alias minutes minute
8
+ def hour
9
+ minute * 60
10
+ end
11
+ alias hours hour
12
+ def day
13
+ hour * 24
14
+ end
15
+ alias days day
16
+ def week
17
+ day * 7
18
+ end
19
+ alias weeks week
20
+ def month
21
+ day * 30
22
+ end
23
+ alias months month
24
+ def year
25
+ day * 365
26
+ end
27
+ alias years year
28
+ def ago
29
+ Time.now - self
30
+ end
31
+ end
32
+
33
+ class Time
34
+ def year_start
35
+ d = (self - (month-1).months - (day-1).days - hour.hours - min.minutes - sec)
36
+ d - (d.day-1).days - d.hour.hours - d.min.minutes - d.sec
37
+ end
38
+ def month_start
39
+ self - (day-1).days - hour.hours - min.minutes - sec
40
+ end
41
+ def week_start
42
+ self - ((wday + 6) % 7).days - hour.hours - min.minutes - sec
43
+ end
44
+ def midnight
45
+ self - hour.hours - min.minutes - sec
46
+ end
47
+ def noon
48
+ midnight + 12.hours
49
+ end
50
+ def ago
51
+ s = (Time.now - self).round
52
+ if (m = s.div(60)) > 0
53
+ if (h = m.div(60)) > 0
54
+ if (d = h.div(24)) > 0
55
+ "#{d} " + n_('day', 'days', d)
56
+ else
57
+ "#{h} " + n_('hour', 'hours', h)
58
+ end
59
+ else
60
+ "#{m} " + n_('minute', 'minutes', m)
61
+ end
62
+ else
63
+ "#{s} " + n_('second', 'seconds', s)
64
+ end
65
+ end
66
+ end
67
+
68
+ class String
69
+ def mail_utf8_subject
70
+ # 4.2 http://tools.ietf.org/html/rfc2047
71
+ '=?UTF-8?Q?'+(self.chomp.gsub(/[^ !-<>-^`-~]/){|m| m.unpack('C*').map{|c| '=%02X' % c}.join}.gsub(/\s/, '_'))+'?='
72
+ end
73
+ def cdata
74
+ "<![CDATA[#{self.gsub(/\]\]>/,']]]]><![CDATA[>')}]]>"
75
+ end
76
+ def md5
77
+ hash = Digest::MD5.new
78
+ hash << self
79
+ hash.hexdigest
80
+ end
81
+ def sha1
82
+ hash = Digest::SHA1.new
83
+ hash << self
84
+ hash.hexdigest
85
+ end
86
+ # This is Pligg style password hash
87
+ def pwdhash(salt=nil)
88
+ salt = String.random_password.md5 if salt.nil?
89
+ salt = salt[0..8]
90
+ salt+(salt+self).sha1
91
+ end
92
+ def excerpt(chars=nil)
93
+ first = split(/(?:\n\r?){2,}/)[0] || ""
94
+ return first if chars.nil?
95
+ words = first.split(' ')
96
+ pos, count = words.inject([0, 0]) do |c, v|
97
+ c[1] + v.length < chars ? [c[0] + 1, c[1] + v.length] : c
98
+ end
99
+ words[0..pos].join(' ') + ((pos == words.size) ? '' : '…')
100
+ end
101
+ def utf8_length
102
+ unpack('U*').length
103
+ end
104
+ def pad(other, extra=0)
105
+ padding = other.utf8_length - utf8_length
106
+ padding = 0 if padding < 0
107
+ ' ' * (padding+extra) + self
108
+ end
109
+ def self.random_password(length=9, strength=0)
110
+ vowels = 'aeuy'
111
+ consonants = 'bdghjmnpqrstvz'
112
+ consonants += 'BDGHJLMNPQRSTVWXZ' if strength & 1 != 0
113
+ vowels += 'AEUY' if strength & 2 != 0
114
+ consonants += '23456789' if strength & 4 != 0
115
+ consonants += '@#$%' if strength & 8 != 0
116
+ password = '';
117
+ alt = rand(2)
118
+ length.times do
119
+ password += consonants[rand(consonants.size - 1)].chr if alt != 0
120
+ password += vowels[rand(vowels.size - 1)].chr if alt == 0
121
+ alt = 1 - alt
122
+ end
123
+ password
124
+ end
125
+ def comma_split
126
+ CSV.parse_line(gsub(/"\s+,/,'",').gsub(/,\s+"/,',"')).collect{|t| t.strip unless t.nil?}.delete_if{|t| t.nil? || t.empty?}
127
+ end
128
+ end
129
+
130
+ class Array
131
+ def comma_join
132
+ map{|v| s = v.gsub!(/,/,',') || v.gsub!(/"/,'""'); s ? '"'+v+'"' : v}.join(', ')
133
+ end
134
+ end
135
+
136
+ if defined? Rack
137
+ class Rack::Request
138
+ def url(path=nil)
139
+ url = scheme + "://"
140
+ url << host
141
+ if scheme == "https" && port != 443 ||
142
+ scheme == "http" && port != 80
143
+ url << ":#{port}"
144
+ end
145
+ url << (path ? path : fullpath)
146
+ url
147
+ end
148
+ end
149
+ end
150
+
151
+ def silence_warnings
152
+ old_verbose, $VERBOSE = $VERBOSE, nil
153
+ yield
154
+ ensure
155
+ $VERBOSE = old_verbose
156
+ end
157
+
158
+ if RUBY_VERSION < "1.9.0"
159
+ class Symbol
160
+ def to_proc
161
+ proc { |obj, *args| obj.send(self, *args) }
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,11 @@
1
+ # Reload scripts and reset routes on change
2
+ class Sinatra::Reloader < Rack::Reloader
3
+ def safe_load(file, mtime, stderr = $stderr)
4
+ if file == ::Sinatra::Application.app_file
5
+ ::Sinatra::Application.reset!
6
+ ::Sinatra::Application.clear_cache! if ::Sinatra::Application.respond_to? :clear_cache!
7
+ stderr.puts "#{self.class}: reseting routes and cache"
8
+ end
9
+ super
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # Sinatra 0.9.x Haml template cache module
2
+
3
+ # Caches Haml templates in Class instance "render_haml_#{template}" methods,
4
+ # avoiding reparsing and recompiling of the template on every page reload.
5
+
6
+ class Sinatra::Base
7
+ # Override function responsible for calling internal Haml rendering routines
8
+ def haml(template, options={}, locals={})
9
+ method = "render_haml_#{template}".to_sym
10
+ return super(template, options, locals) unless self.respond_to? method
11
+ locals = options.delete(:locals) || locals || {}
12
+ if options[:layout] != false
13
+ __send__(:render_haml_layout, locals) { __send__(method, locals) }
14
+ else
15
+ __send__(method, locals)
16
+ end
17
+ end
18
+ def render_haml(template, data, options, locals, &block)
19
+ method = "render_haml_#{template}".to_sym
20
+ ::Haml::Engine.new(data, options).def_method(self.class, method, *(locals.keys))
21
+ __send__(method, locals, &block)
22
+ end
23
+ def self.clear_cache!
24
+ instance_methods.grep(/^render_haml_/).each{|m| remove_method m}
25
+ end
26
+ def clear_cache!; self.class.clear_cache! end
27
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class SinatraHatTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'sinatra-hat'
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nanoant-sinatra-hat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Adam Strzelecki
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-09 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Sinatra Ruby gem extensions for gettext, caching, reloading, etc.
17
+ email: ono@java.pl
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.markdown
24
+ files:
25
+ - MIT-LICENSE
26
+ - README.markdown
27
+ - Rakefile
28
+ - VERSION
29
+ - lib/gettext/date.rb
30
+ - lib/gettext/haml.rb
31
+ - lib/gettext/haml_parser.rb
32
+ - lib/gettext/ruby19_fix.rb
33
+ - lib/rack/fastcgi_fix.rb
34
+ - lib/rack/gettext_reloader.rb
35
+ - lib/sequel/utf8_fix.rb
36
+ - lib/sinatra-hat.rb
37
+ - lib/sinatra-hat/string_permalink.rb
38
+ - lib/sinatra-hat/utils.rb
39
+ - lib/sinatra/reloader.rb
40
+ - lib/sinatra/template_cache.rb
41
+ - test/sinatra-hat_test.rb
42
+ - test/test_helper.rb
43
+ has_rdoc: false
44
+ homepage: http://github.com/nanoant/sinatra-hat
45
+ post_install_message:
46
+ rdoc_options:
47
+ - --charset=UTF-8
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
61
+ version:
62
+ requirements: []
63
+
64
+ rubyforge_project:
65
+ rubygems_version: 1.2.0
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Sinatra Ruby gem extensions for gettext, caching, reloading, etc.
69
+ test_files:
70
+ - test/sinatra-hat_test.rb
71
+ - test/test_helper.rb