heel 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3399d8178f772d4ee49f04043572be6d9f70d2fd
4
+ data.tar.gz: f34d5119b094801f39bd47f00791b415e97555a1
5
+ SHA512:
6
+ metadata.gz: 919208df9a5929ad044a896529055c9e15f1af077c50dcd20c805f10145c15f8f964adf16742cc954c435ca5eb3206b8f5e8cba3efe64c578f93ded918250d70
7
+ data.tar.gz: d1cb4ed0a1de12646c370eaa8629ed9a5d27619dd17a0ebd6b3996f23294f3a54016a1cf9a57c8e03945b446cb5eb873f5c0ee4386cc8222236bcf7e445d8099
data/HISTORY.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 3.1.2 - 2013-10-16
4
+ * Fix usage of Mime::Types [#12](https://github.com/copiousfreetime/heel/issues/12) [#13](https://github.com/copiousfreetime/heel/issues/13)
5
+
3
6
  ## Version 3.1.1 - 2013-09-29
4
- * Fix request logging [#10]
7
+ * Fix request logging [#10](https://github.com/copiousfreetime/heel/issues/10)
5
8
 
6
9
  ## Version 3.1.0 - 2013-07-07
7
10
  * Update dependencies
8
- * Switch to template contributed by brianflanagan [#8]
9
- * Add support for multiple independent heel servers [#9]
11
+ * Switch to template contributed by brianflanagan [#8](https://github.com/copiousfreetime/heel/issues/8)
12
+ * Add support for multiple independent heel servers [#9](https://github.com/copiousfreetime/heel/issues/9)
10
13
 
11
14
  ## Version 3.0.2 - 2013-03-13
12
15
 
13
- * Fix generated pages to say they are utf-8 [#4]
16
+ * Fix generated pages to say they are utf-8 [#4](https://github.com/copiousfreetime/heel#4)
14
17
  * Fix formatting of usage section of documentation
15
18
  * Update dependencies
16
19
  * Convert to RDoc 4.0
data/Rakefile CHANGED
@@ -8,9 +8,9 @@ This.homepage = "http://github.com/copiousfreetime/#{ This.name }"
8
8
 
9
9
  This.ruby_gemspec do |spec|
10
10
  spec.add_runtime_dependency( 'puma' , '~> 2.0' )
11
- spec.add_runtime_dependency( 'mime-types', '~> 1.23')
11
+ spec.add_runtime_dependency( 'mime-types', '~> 1.25')
12
12
  spec.add_runtime_dependency( 'launchy' , '~> 2.3' )
13
- spec.add_runtime_dependency( 'coderay' , '~> 1.0' )
13
+ spec.add_runtime_dependency( 'coderay' , '~> 1.1' )
14
14
 
15
15
  spec.add_development_dependency( 'rake' , '~> 10.1')
16
16
  spec.add_development_dependency( 'minitest' , '~> 5.0' )
@@ -4,7 +4,7 @@
4
4
  #++
5
5
 
6
6
  module Heel
7
- VERSION = '3.1.1'
7
+ VERSION = '3.1.2'
8
8
  end
9
9
 
10
10
  require 'heel/configuration'
@@ -37,25 +37,21 @@ module Heel
37
37
  # if any other mime types are needed, add them directly via the
38
38
  # mime-types calls.
39
39
  def additional_mime_types
40
- @additional_mime_types ||= [
41
- # [ content-type , [ array, of, filename, extentions] ]
42
- ["images/svg+xml", ["svg"]],
43
- ["video/x-flv", ["flv"]],
44
- ["application/x-shockwave-flash", ["swf"]],
45
- ["text/plain", ["rb", "rhtml", "md", "markdown"]],
40
+ [
41
+ MIME::Type.new( 'text/plain' ) { |t| t.extensions = %w[ rb rdoc rhtml md markdown ] },
46
42
  ]
47
43
  end
48
44
  end
49
45
 
50
46
  def initialize
51
47
  MimeMap.additional_mime_types.each do |mt|
52
- if MIME::Types[mt.first].size == 0 then
53
- type = MIME::Type.from_array(mt)
54
- MIME::Types.add(type)
48
+ existing_type = MIME::Types[mt]
49
+ if existing_type.empty? then
50
+ MIME::Types.add(mt)
55
51
  else
56
- type = MIME::Types[mt.first].first
57
- mt[1].each do |ext|
58
- type.extensions << ext unless type.extensions.include?(ext)
52
+ type = existing_type.first
53
+ mt.extensions.each do |ext|
54
+ type.extensions << ext unless type.extensions.include?( ext )
59
55
  end
60
56
  # have to reindex if new extensions added
61
57
  MIME::Types.index_extensions(type)
@@ -70,7 +66,7 @@ module Heel
70
66
  # returns the mime type of the file at a given pathname
71
67
  #
72
68
  def mime_type_of(f)
73
- MIME::Types.of(f).first || default_mime_type
69
+ MIME::Types.of(f).last || default_mime_type
74
70
  end
75
71
 
76
72
  # return the icon name for a particular mime type
@@ -31,4 +31,17 @@ describe Heel::DirectoryIndexer do
31
31
  @indexer.mime_map.must_be_instance_of(Heel::MimeMap)
32
32
  end
33
33
 
34
+ [ { :ext => 'svg', :type => 'image/svg+xml' },
35
+ { :ext => 'flv', :type => 'video/x-flv' },
36
+ { :ext => 'swf', :type => 'application/x-shockwave-flash' } ].each do |m|
37
+ it "finds #{m[:ext]} extension in the map as #{m[:type]}" do
38
+ @indexer.mime_map.mime_type_of( "test.#{m[:ext]}" ).must_equal m[:type]
39
+ end
40
+ end
41
+
42
+ %w[ md markdown rdoc rb rhtml ].each do |ext|
43
+ it "finds #{ext} in the map as text/plain" do
44
+ @indexer.mime_map.mime_type_of( "test.#{ext}" ).must_equal "text/plain"
45
+ end
46
+ end
34
47
  end
@@ -26,7 +26,7 @@ describe Heel::RackApp do
26
26
  res = @request.get("/lib/heel.rb?highlighting=off")
27
27
  res.must_be :ok?
28
28
  res.body.size.must_equal File.size("lib/heel.rb")
29
- res['Content-Type'].must_equal "application/x-ruby"
29
+ res['Content-Type'].must_equal "text/plain"
30
30
  end
31
31
 
32
32
  it "should return a 405 if given a non-GET request" do
@@ -31,7 +31,7 @@ namespace :develop do
31
31
  # Create a Gemfile that just references the gemspec
32
32
  file 'Gemfile' => :gemspec do
33
33
  File.open( "Gemfile", "w+" ) do |f|
34
- f.puts 'source :rubygems'
34
+ f.puts 'source "https://rubygems.org/"'
35
35
  f.puts 'gemspec'
36
36
  end
37
37
  end
@@ -54,8 +54,8 @@ begin
54
54
  require 'rake/testtask'
55
55
  Rake::TestTask.new( :test ) do |t|
56
56
  t.ruby_opts = %w[ -w -rubygems ]
57
- t.libs = %w[ lib spec ]
58
- t.pattern = "spec/**/*_spec.rb"
57
+ t.libs = %w[ lib spec test ]
58
+ t.pattern = "{test,spec}/**/{test_*,*_spec}.rb"
59
59
  end
60
60
 
61
61
  task :test_requirements
@@ -25,7 +25,7 @@ class ThisProject
25
25
  #
26
26
  # Yields self
27
27
  def initialize(&block)
28
- @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp)|Gemfile*|\.(gemspec|swp|jar|bundle|so|rvmrc)$|~$/
28
+ @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
29
29
  @gemspecs = Hash.new
30
30
  yield self if block_given?
31
31
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heel
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
5
- prerelease:
4
+ version: 3.1.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jeremy Hinegardner
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: puma
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,23 +27,20 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: mime-types
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: '1.23'
33
+ version: '1.25'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: '1.23'
40
+ version: '1.25'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: launchy
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,23 +55,20 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: coderay
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
69
- version: '1.0'
61
+ version: '1.1'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
77
- version: '1.0'
68
+ version: '1.1'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: minitest
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rdoc
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,12 +104,11 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
125
110
  version: '4.0'
126
- description: ! 'Heel is a small static web server for use when you need a quick web
111
+ description: 'Heel is a small static web server for use when you need a quick web
127
112
  server for a directory. Once the server is running, heel will use (http://rubygems.org/gems/launchy/)
128
113
  to open your browser at the URL of your document root. Heel is built using (http://rack.github.com)
129
114
  and (http://puma.io) % heel Launching your browser... Puma 1.6.3 starting... *
@@ -192,6 +177,7 @@ files:
192
177
  homepage: http://github.com/copiousfreetime/heel
193
178
  licenses:
194
179
  - BSD
180
+ metadata: {}
195
181
  post_install_message:
196
182
  rdoc_options:
197
183
  - --main
@@ -201,22 +187,20 @@ rdoc_options:
201
187
  require_paths:
202
188
  - lib
203
189
  required_ruby_version: !ruby/object:Gem::Requirement
204
- none: false
205
190
  requirements:
206
- - - ! '>='
191
+ - - '>='
207
192
  - !ruby/object:Gem::Version
208
193
  version: '0'
209
194
  required_rubygems_version: !ruby/object:Gem::Requirement
210
- none: false
211
195
  requirements:
212
- - - ! '>='
196
+ - - '>='
213
197
  - !ruby/object:Gem::Version
214
198
  version: '0'
215
199
  requirements: []
216
200
  rubyforge_project:
217
- rubygems_version: 1.8.23
201
+ rubygems_version: 2.1.5
218
202
  signing_key:
219
- specification_version: 3
203
+ specification_version: 4
220
204
  summary: Heel is a small static web server for use when you need a quick web server
221
205
  for a directory. Once the server is running, heel will use [launchy](http://rubygems.org/gems/launchy/)
222
206
  to open your browser at the URL of your document root.