rubyfox-server 2.8.0.0 → 2.8.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba84a04e954d0d64f399101ff357ba6d9233d5c7
4
- data.tar.gz: 69eba1a44d2651d0d60436c67dc86800dafe758e
3
+ metadata.gz: fc41b38aa06c19582d0de2281ec064fe5a2129d9
4
+ data.tar.gz: bc24152d9e99bd8ba6c86db6d71fcca4bcb4388e
5
5
  SHA512:
6
- metadata.gz: 88c4d675862bf727ae7a1d32d1c56d95ac94495f4204317da8ac7570eb402dd2e66e84a926b1be12723549ced43435c26a46548b511fca408a67f8a7afa0d224
7
- data.tar.gz: 09bdbee85ac01fa3d3f3f120ac3fb8d641d10024937336fffa3f8cfe20d230f455f3da12aaae78bddfdce440cc91385ae6cc1824d95fd06efd77c882ae9faddc
6
+ metadata.gz: 23e1d59a96b853995eba987ba3c5478aabdc38b75ccea1962cb9ad74bd418880a8cd8967e2fc2e1ae63adb95dcb9637f4bdec7889433bc49afac3d765576afbf
7
+ data.tar.gz: ace7fb204b3dc0809645ce2326e9ad5d8bc12a2feb18be48c88359a52fc3741fc0b9887664cf850f42d98199d6fff6f30a72a7862e4b21a3ed210d215659f980
@@ -32,11 +32,10 @@ module Rubyfox
32
32
  if File.file?(file)
33
33
  part = file.partition(template_dir).last
34
34
  target_file = "#{target_dir}/#{part}"
35
- binary = MIME::Types.type_for(file).any?(&:binary?)
36
- if binary
37
- copy_file file, target_file
38
- else
35
+ if file_plain?(file)
39
36
  template file, target_file
37
+ else
38
+ copy_file file, target_file
40
39
  end
41
40
  end
42
41
  end
@@ -60,6 +59,13 @@ module Rubyfox
60
59
  @env ||= Environment.new(ENV)
61
60
  end
62
61
  end
62
+
63
+ private
64
+
65
+ def file_plain?(file)
66
+ types = MIME::Types.type_for(file)
67
+ types.empty? || types.any? { |type| type.media_type == "text" }
68
+ end
63
69
  end
64
70
  end
65
71
  end
@@ -1,5 +1,5 @@
1
1
  module Rubyfox
2
2
  module Server
3
- VERSION = "2.8.0.0"
3
+ VERSION = "2.8.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfox-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0.0
4
+ version: 2.8.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Suschlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor