sinatra-default_charset 0.1.0

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/.autotest ADDED
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,5 @@
1
+ === 0.1.0 / 2010-05-24
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday! (for hukl)
data/Manifest.txt ADDED
@@ -0,0 +1,7 @@
1
+ .autotest
2
+ CHANGELOG.rdoc
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/sinatra/default_charset.rb
7
+ test/test_sinatra_default_charset.rb
data/README.rdoc ADDED
@@ -0,0 +1,55 @@
1
+ = sinatra-default_charset
2
+
3
+ * http://rubygems.org/gems/sinatra-default_charset
4
+ * docs: http://libraggi.rubyforge.org/sinatra-default_charset/README_rdoc.html
5
+ * wiki: http://wiki.github.com/raggi/sinatra-default_charset/
6
+ * source: http://github.com/raggi/sinatra-default_charset/
7
+ * issues: http://github.com/raggi/sinatra-default_charset/issues
8
+ * rubyforge: http://rubyforge.org/projects/libraggi
9
+
10
+ == DESCRIPTION:
11
+
12
+ Sets a default charset in the MIME headers. Defaults to utf-8.
13
+
14
+ == FEATURES/PROBLEMS:
15
+
16
+ * TODO add some actual tests
17
+
18
+ == SYNOPSIS:
19
+
20
+ require 'sinatra/default_charset'
21
+ register Sinatra::DefaultCharset
22
+ set :default_charset, 'utf-8'
23
+
24
+ == REQUIREMENTS:
25
+
26
+ * sinatra
27
+
28
+ == INSTALL:
29
+
30
+ * gem install sinatra-default_charset
31
+
32
+ == LICENSE:
33
+
34
+ (The MIT License)
35
+
36
+ Copyright (c) 2010 James Tucker
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining
39
+ a copy of this software and associated documentation files (the
40
+ 'Software'), to deal in the Software without restriction, including
41
+ without limitation the rights to use, copy, modify, merge, publish,
42
+ distribute, sublicense, and/or sell copies of the Software, and to
43
+ permit persons to whom the Software is furnished to do so, subject to
44
+ the following conditions:
45
+
46
+ The above copyright notice and this permission notice shall be
47
+ included in all copies or substantial portions of the Software.
48
+
49
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
50
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
51
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
52
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
53
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
54
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
55
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require 'hoe'
4
+ Hoe.plugin :doofus, :git, :gemcutter
5
+
6
+ Hoe.spec 'sinatra-default_charset' do
7
+ developer('James Tucker', 'raggi@rubyforge.org')
8
+ extra_dev_deps << %w(hoe-doofus >=1.0.0)
9
+ extra_dev_deps << %w(hoe-git >=1.3.0)
10
+ extra_dev_deps << %w(hoe-gemcutter >=1.0.0)
11
+ extra_deps << %w(sinatra >=1.0)
12
+ self.extra_rdoc_files = FileList["**/*.rdoc"]
13
+ self.history_file = "CHANGELOG.rdoc"
14
+ self.readme_file = "README.rdoc"
15
+ self.rubyforge_name = 'libraggi'
16
+ self.testlib = :minitest
17
+ end
@@ -0,0 +1,19 @@
1
+ require 'sinatra/base'
2
+
3
+ module Sinatra
4
+ module DefaultCharset
5
+ VERSION = '0.1.0'
6
+
7
+ def content_type(type, params = {})
8
+ params[:charset] ||= settings.default_charset
9
+ super
10
+ end
11
+
12
+ def self.registered(app)
13
+ app.set :default_charset, 'utf-8'
14
+ app.helpers self
15
+ # re-default it so that we've always got a charset set
16
+ app.before { content_type :html }
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ require "sinatra/default_charset"
2
+
3
+ class TestSinatraDefaultCharset < MiniTest::Unit::TestCase
4
+ class TestApp < Sinatra::Base
5
+ register Sinatra::DefaultCharset
6
+
7
+ get '/' do
8
+ "hello world\n"
9
+ end
10
+ end
11
+
12
+ def test_sanity
13
+ flunk "write tests or I will kneecap you"
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sinatra-default_charset
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - James Tucker
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-05-24 00:00:00 -03:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: sinatra
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ version: "1.0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: rubyforge
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 2
42
+ - 0
43
+ - 4
44
+ version: 2.0.4
45
+ type: :development
46
+ version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe-doofus
49
+ prerelease: false
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 1
56
+ - 0
57
+ - 0
58
+ version: 1.0.0
59
+ type: :development
60
+ version_requirements: *id003
61
+ - !ruby/object:Gem::Dependency
62
+ name: hoe-git
63
+ prerelease: false
64
+ requirement: &id004 !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 1
70
+ - 3
71
+ - 0
72
+ version: 1.3.0
73
+ type: :development
74
+ version_requirements: *id004
75
+ - !ruby/object:Gem::Dependency
76
+ name: hoe-gemcutter
77
+ prerelease: false
78
+ requirement: &id005 !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 1
84
+ - 0
85
+ - 0
86
+ version: 1.0.0
87
+ type: :development
88
+ version_requirements: *id005
89
+ - !ruby/object:Gem::Dependency
90
+ name: hoe
91
+ prerelease: false
92
+ requirement: &id006 !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ segments:
97
+ - 2
98
+ - 6
99
+ - 0
100
+ version: 2.6.0
101
+ type: :development
102
+ version_requirements: *id006
103
+ description: Sets a default charset in the MIME headers. Defaults to utf-8.
104
+ email:
105
+ - raggi@rubyforge.org
106
+ executables: []
107
+
108
+ extensions: []
109
+
110
+ extra_rdoc_files:
111
+ - Manifest.txt
112
+ - CHANGELOG.rdoc
113
+ - README.rdoc
114
+ files:
115
+ - .autotest
116
+ - CHANGELOG.rdoc
117
+ - Manifest.txt
118
+ - README.rdoc
119
+ - Rakefile
120
+ - lib/sinatra/default_charset.rb
121
+ - test/test_sinatra_default_charset.rb
122
+ has_rdoc: true
123
+ homepage: http://rubygems.org/gems/sinatra-default_charset
124
+ licenses: []
125
+
126
+ post_install_message:
127
+ rdoc_options:
128
+ - --main
129
+ - README.rdoc
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ segments:
144
+ - 0
145
+ version: "0"
146
+ requirements: []
147
+
148
+ rubyforge_project: libraggi
149
+ rubygems_version: 1.3.6
150
+ signing_key:
151
+ specification_version: 3
152
+ summary: Sets a default charset in the MIME headers
153
+ test_files:
154
+ - test/test_sinatra_default_charset.rb