genki-mime-types 1.15 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,209 +1,58 @@
1
- #! /usr/bin/env rake
2
- #--
3
- # MIME::Types for Ruby
4
- # http://rubyforge.org/projects/mime-types/
5
- # Copyright 2003 - 2005 Austin Ziegler.
6
- # Licensed under a MIT-style licence.
7
- #
8
- # $Id$
9
- #++
10
- #require 'meta_project'
1
+ require 'rubygems'
11
2
  require 'rake/gempackagetask'
12
- #require 'rake/contrib/xforge'
13
- require 'rake/clean'
14
3
 
15
- #require 'gmailer'
4
+ require 'merb-core'
5
+ require 'merb-core/tasks/merb'
16
6
 
17
- #require 'archive/tar/minitar'
18
- require 'zlib'
7
+ GEM_NAME = "mime-types"
8
+ GEM_VERSION = "1.15.1"
9
+ AUTHOR = "Austin Ziegler"
10
+ EMAIL = "austin@rubyforge.org"
11
+ HOMEPAGE = "http://mime-types.rubyforge.org/"
12
+ SUMMARY = "Manages a MIME Content-Type that will return the Content-Type for a given filename."
19
13
 
20
- $LOAD_PATH.unshift('lib')
21
-
22
- require 'mime/types'
23
-
24
- $version = MIME::Types::VERSION
25
- $name = MIME::Types.to_s
26
- $project = MetaProject::Project::XForge::RubyForge.new('mime-types')
27
- $distdir = "mime-types-#$version"
28
- $tardist = "../#$distdir.tar.gz"
29
-
30
- $release_date = nil
31
- $release_date = Time.parse(ENV['RELEASE_DATE']) if ENV['RELEASE_DATE']
32
-
33
- desc "Run the tests for #$name."
34
- task :test do |t|
35
- require 'test/unit/testsuite'
36
- require 'test/unit/ui/console/testrunner'
37
-
38
- runner = Test::Unit::UI::Console::TestRunner
39
-
40
- $LOAD_PATH.unshift('tests')
41
- $stderr.puts "Checking for test cases:" if t.verbose
42
- Dir['tests/tc_*.rb'].each do |testcase|
43
- $stderr.puts "\t#{testcase}" if t.verbose
44
- load testcase
45
- end
46
-
47
- suite = Test::Unit::TestSuite.new($name)
48
-
49
- ObjectSpace.each_object(Class) do |testcase|
50
- suite << testcase.suite if testcase < Test::Unit::TestCase
51
- end
52
-
53
- runner.run(suite)
54
- end
55
-
56
- desc "Look for TODO and FIXME tags in the code"
57
- task :todo do
58
- rx = %r{#.*(FIXME|TODO|TBD|DEPRECATED)}
59
- Pathname.new(File.dirname(__FILE__)).egrep(rx) do |match|
60
- puts match
61
- end
14
+ spec = Gem::Specification.new do |s|
15
+ s.rubyforge_project = 'merb'
16
+ s.name = GEM_NAME
17
+ s.version = GEM_VERSION
18
+ s.platform = Gem::Platform::RUBY
19
+ s.has_rdoc = true
20
+ s.extra_rdoc_files = ["README"]
21
+ s.summary = SUMMARY
22
+ s.description = s.summary
23
+ s.author = AUTHOR
24
+ s.email = EMAIL
25
+ s.homepage = HOMEPAGE
26
+ s.add_dependency('merb', '>= 1.0.7.1')
27
+ s.require_path = 'lib'
28
+ s.files = %w(README Rakefile) + Dir.glob("{lib,spec}/**/*")
29
+
62
30
  end
63
31
 
64
- spec = eval(File.read("mime-types.gemspec"))
65
- spec.version = $version
66
- desc "Build the RubyGem for #$name."
67
- task :gem => [ :test ]
68
- Rake::GemPackageTask.new(spec) do |g|
69
- g.need_tar = false
70
- g.need_zip = false
71
- g.package_dir = ".."
32
+ Rake::GemPackageTask.new(spec) do |pkg|
33
+ pkg.gem_spec = spec
72
34
  end
73
35
 
74
- desc "Build a #$name .tar.gz distribution."
75
- task :tar => [ $tardist ]
76
- file $tardist => [ :test ] do |t|
77
- current = File.basename(Dir.pwd)
78
- Dir.chdir("..") do
79
- begin
80
- files = %W(bin/**/* lib/**/* tests/**/* ChangeLog README LICENCE
81
- Rakefile mime-types.gemspec setup.rb pre-setup.rb)
82
- files = FileList[files.map { |file| File.join(current, file) }].to_a
83
- files.map! do |dd|
84
- ddnew = dd.gsub(/^#{current}/, $distdir)
85
- mtime = $release_date || File.stat(dd).mtime
86
- if File.directory?(dd)
87
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
88
- else
89
- if dd =~ %r{bin/}
90
- mode = 0755
91
- else
92
- mode = 0644
93
- end
94
- data = File.open(dd, "rb") { |ff| ff.read }
95
- { :name => ddnew, :mode => mode, :data => data, :size =>
96
- data.size, :mtime => mtime }
97
- end
98
- end
99
-
100
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
101
- gz = Zlib::GzipWriter.new(ff)
102
- tw = Archive::Tar::Minitar::Writer.new(gz)
103
-
104
- files.each do |entry|
105
- if entry[:dir]
106
- tw.mkdir(entry[:name], entry)
107
- else
108
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
109
- end
110
- end
111
- ensure
112
- tw.close if tw
113
- gz.finish if gz
114
- ff.close
115
- end
116
- end
36
+ desc "install the plugin as a gem"
37
+ task :install do
38
+ Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
117
39
  end
118
- task $tardist => [ :test ]
119
40
 
120
- desc "Build the RDoc documentation for #$name."
121
- task :docs do
122
- require 'rdoc/rdoc'
123
- rdoc_options = %W(--title #$name --main README --line-numbers)
124
- files = FileList[*%w(README LICENCE ChangeLog bin/**/*.rb lib/**/*.rb)]
125
- rdoc_options += files.to_a
126
- RDoc::RDoc.new.document(rdoc_options)
41
+ desc "Uninstall the gem"
42
+ task :uninstall do
43
+ Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
127
44
  end
128
45
 
129
- task :verify_rubyforge do
130
- raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
131
- raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
132
- end
133
-
134
- #task :verify_gmail do
135
- # raise "GMAIL_USER environment variable not set!" unless ENV['GMAIL_USER']
136
- # raise "GMAIL_PASSWORD environment variable not set!" unless ENV['GMAIL_PASSWORD']
137
- #end
138
-
139
- desc "Release files on RubyForge."
140
- task :release_files => [ :verify_rubyforge, :tar, :gem ] do
141
- release_files = FileList[$tardist, "../#$distdir.gem"]
142
- Rake::XForge::Release.new($project) do |release|
143
- release.user_name = ENV['RUBYFORGE_USER']
144
- release.password = ENV['RUBYFORGE_PASSWORD']
145
- release.files = release_files.to_a
146
- release.release_name = "#$name #$version"
147
- release.package_name = "mime-types"
148
-
149
- notes = []
150
- File.open("README") do |file|
151
- file.each do |line|
152
- line.chomp!
153
- line.gsub!(/^#.*$/, '') and next
154
- notes << line
155
- end
156
- end
157
- release.release_notes = notes.join("\n")
158
-
159
- changes = []
160
- File.open("ChangeLog") do |file|
161
- current = true
162
-
163
- file.each do |line|
164
- line.chomp!
165
- current = false if current and line =~ /^==/
166
- break if line.empty? and not current
167
- changes << line
168
- end
169
- end
170
- release.release_changes = changes.join("\n")
46
+ desc "Create a gemspec file"
47
+ task :gemspec do
48
+ File.open("#{GEM_NAME}.gemspec", "w") do |file|
49
+ file.puts spec.to_ruby
171
50
  end
172
51
  end
173
52
 
174
- desc "Publish news on RubyForge"
175
- task :publish_news => [ :verify_rubyforge, :tar, :gem ] do
176
- Rake::XForge::NewsPublisher.new($project) do |news|
177
- news.user_name = ENV['RUBYFORGE_USER']
178
- news.password = ENV['RUBYFORGE_PASSWORD']
179
- news.subject = "#$name #$version Released"
180
- news.changes_file = nil
181
-
182
- details = []
183
- File.open("Release-Announcement") do |file|
184
- file.each do |line|
185
- line.chomp!
186
- break if line =~ /^=/
187
- details << line
188
- end
189
- end
190
- news.details = details.join("\n")
191
- end
53
+ desc "Run spec"
54
+ task :spec do
55
+ sh "spec spec --color"
192
56
  end
193
- =begin
194
- desc "Post a release announcement via GMail."
195
- task :email_announcement => [ :verify_gmail ] do
196
- GMailer.connect(ENV["GMAIL_USER"], ENV["GMAIL_PASSWORD"]) do |gmail|
197
- gmail.send :to => "ruby-talk@ruby-lang.org",
198
- :subject => "[ANN] #$name #$version",
199
- :body => File.read("Release-Announcement")
200
- end
201
- end
202
- =end
203
-
204
- desc "Release the latest version."
205
- task :release => [ :verify_rubyforge, :verify_gmail, :release_files,
206
- :publish_news, :email_announcement, :docs ]
207
57
 
208
- desc "Build everything."
209
- task :default => [ :tar, :gem ]
58
+ task :default => :spec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genki-mime-types
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.15"
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
@@ -9,11 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-05 00:00:00 -08:00
12
+ date: 2009-02-14 00:00:00 -08:00
13
13
  default_executable:
14
- dependencies: []
15
-
16
- description: This library allows for the identification of a file's likely MIME content type. This is release 1.15. The identification of MIME content type is based on a file's filename extensions.
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: merb
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.7.1
23
+ version:
24
+ description: Manages a MIME Content-Type that will return the Content-Type for a given filename.
17
25
  email: austin@rubyforge.org
18
26
  executables: []
19
27
 
@@ -21,30 +29,16 @@ extensions: []
21
29
 
22
30
  extra_rdoc_files:
23
31
  - README
24
- - ChangeLog
25
- - Install
26
32
  files:
27
- - lib/mime
28
- - lib/mime/types.rb
29
- - tests/testall.rb
30
- - tests/tc_mime_type.rb
31
- - tests/tc_mime_types.rb
32
- - ChangeLog
33
33
  - README
34
- - LICENCE
35
- - setup.rb
36
34
  - Rakefile
37
- - pre-setup.rb
38
- - Install
35
+ - lib/mime
36
+ - lib/mime/types.rb
39
37
  has_rdoc: true
40
38
  homepage: http://mime-types.rubyforge.org/
41
39
  post_install_message:
42
- rdoc_options:
43
- - --title
44
- - MIME::Types
45
- - --main
46
- - README
47
- - --line-numbers
40
+ rdoc_options: []
41
+
48
42
  require_paths:
49
43
  - lib
50
44
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -61,10 +55,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
55
  version:
62
56
  requirements: []
63
57
 
64
- rubyforge_project: mime-types
58
+ rubyforge_project: merb
65
59
  rubygems_version: 1.2.0
66
60
  signing_key:
67
61
  specification_version: 2
68
62
  summary: Manages a MIME Content-Type that will return the Content-Type for a given filename.
69
- test_files:
70
- - tests/testall.rb
63
+ test_files: []
64
+
data/ChangeLog DELETED
@@ -1,101 +0,0 @@
1
- = MIME::Types Change Log
2
-
3
- Unless explicitly stated differently are all changes produced by Austin
4
- Ziegler <mime-types@halostatue.ca>.
5
-
6
- == MIME::Types 1.15
7
- * Removed lib/mime/type.rb to form a single MIME::Types database source. It
8
- is unlikely that one will ever need MIME::Type without MIME::Types.
9
- * Re-synchronized the MIME type list with the sources, focusing primarily on
10
- the IANA list.
11
- * Added more detailed source information for MIME::Type objects.
12
- * Changed MIME::Types from a module to a class with a default instance. There
13
- should be no difference in usage.
14
- * Removed MIME::Types::DATA_VERSION; it is now an attribute on the
15
- MIME::Types instance.
16
- * NOTE: Synchronization with the Perl version of MIME::Types is no longer a
17
- priority as of this release. The data format and information has changed.
18
- * Removed MIME::Types.by_suffix and MIME::Types.by_mediatype.
19
-
20
- == MIME::Types 1.13.1
21
- * Fixed a problem with the installer running tests. This now works.
22
- * Improved the implementation of MIME::Type.signature?
23
- * Moved code around to use the class << self idiom instead of always
24
- prepending the module/class name.
25
- * Added two new best-guess implementations of functions found in Perl's
26
- MIME::Types implementation (1.13). Do not rely on these until the purpose
27
- and implementation is stabilised.
28
- * Updated the MIME list to reflect changes noted by
29
- Ville Skytt� <ville.skytta@iki.fi>.
30
- * Added a new constant to MIME::Types, DATA_VERSION. This will allow the Ruby
31
- version number to be updated separately from the Perl version while keeping
32
- the MIME Type list version in sync.
33
-
34
- == MIME::Types 1.13
35
- ! WARNING: This version changes the API of MIME::Types !
36
- ! WARNING: This version is compatible with Ruby 1.8 and higher ONLY !
37
- * Removed dependency on InstallPackage; offering 1.13 as either .tar.gz or
38
- .gem.
39
- * Split into two files, mime/type.rb and mime/types.rb. This will make
40
- maintaining the list of changes easier.
41
- * Changed the MIME::Type construction API. Accepts only a single String
42
- argument (but does no named type-checking) and yields self.
43
- * Removed private methods #init_extensions, #init_encoding, and #init_system
44
- and replaced with #extensions=, #encoding=, and #system=.
45
- * Added #default_encoding to return 'quoted-printable' or 'base64' depending
46
- on the media type of the MIME type.
47
- * Added #raw_media_type and #raw_sub_type to provide the non-simplified
48
- versions of the media type and subtype.
49
- * Alternative constructors MIME::Type.from_array, MIME::Type.from_hash, and
50
- MIME::Type.from_mime_type added to compensate for the removal of named type
51
- checking in the original constructor.
52
- * Added #to_str, #to_a, and #to_hash methods. The latter two will provide
53
- output suitable for use in #from_array and #from_hash.
54
- * Removed "binary" encoding and enforced the use of a valid encoding string.
55
- * Added #system? returning true if the MIME::Type is an OS-specific
56
- MIME::Type.
57
- * Added #platform? returning true if the MIME::Type is an OS-specific
58
- MIME::Type for the current RUBY_PLATFORM.
59
- * Added #like? returning true if the simplified type matches the other value
60
- provided. #<'application/x-excel'>.like?('application/excel') is true.
61
- * Added #complete? returning true if the MIME::Type specifies an extension
62
- list.
63
- * Updated the MIME type list to reflect additions by Mark Overmeer for Perl's
64
- MIME::Types 1.12 and the official IANA list as of 2004.04.06. A number of
65
- formerly "registered" MIME types are now no longer registered (e.g.,
66
- application/excel is now application/x-excel). This ensures that the
67
- simplified type still works with applications, but does not report an
68
- unregistered type as registered.
69
- * Restored MIME type list to Mark Overmeer's format to facilitate easy
70
- exchange between the two projects.
71
- * Added additional unit tests from Mark Overmeer's 1.12 version.
72
-
73
- == MIME::Types 1.07
74
- * Changed version numbering to match Perl MIME::Types 1.07.
75
- * Re-synchronized with Mark Overmeer's list in Perl PMIME::Types 1.07.
76
- - [NN Poster] updated the attributes for the PGP types.
77
-
78
- == MIME::Types 1.005
79
- * Changed to Phil Thomson's InstallPackage.
80
- * Added several types from Perl MIME::Types 1.005.
81
- * Cleaned up data format; some data formats will show up with proper data now.
82
-
83
- == MIME::Types 1.004
84
- * Updated to match Perl MIME::Types 1.004, links credited to Dan Puro. Adds
85
- new reference list to http://www.indiana.edu/cgi-bin-local/mimetypes
86
- * Removed InvalidType and replaced with TypeError.
87
- * Changed instances of #type to #class.
88
- * Cleaned up how simplified versions are created.
89
-
90
- == MIME::Types 1.003
91
- * Initial release based on Perl MIME::Types 1.003.
92
-
93
- #--
94
- # MIME::Types for Ruby
95
- # http://rubyforge.org/projects/mime-types/
96
- # Copyright 2003 - 2006 Austin Ziegler.
97
- # Licensed under a MIT-style licence.
98
- #
99
- # $Id$
100
- #++
101
- # vim: sts=2 sw=2 ts=4 et ai tw=77
data/Install DELETED
@@ -1,16 +0,0 @@
1
- Installing this package is as simple as:
2
-
3
- % ruby setup.rb
4
-
5
- Alternatively, you can use the RubyGem version of MIME::Types available as
6
- mime-types-1.15.gem from the usual sources.
7
-
8
- #--
9
- # MIME::Types for Ruby
10
- # http://rubyforge.org/projects/mime-types/
11
- # Copyright 2003 - 2006 Austin Ziegler.
12
- # Licensed under a MIT-style licence.
13
- #
14
- # $Id$
15
- #++
16
- # vim: sts=2 sw=2 ts=4 et ai tw=77