targit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/targit/asset.rb +9 -1
- data/lib/targit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7944aeedcfafcc3091cb2820616f1dfdea3e55d
|
4
|
+
data.tar.gz: b7847bd30f637994224c4f13f10b32d37e66d7b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05af5a40ed6f1c51417a17dbee3dd302c9f815368206645d6db8e752719765e72f8c8f5fca5b20eeb44f15bafd282d9cacc1b1005c2095c2572b2eac840b8141
|
7
|
+
data.tar.gz: 998408a5a2eeaabf062f35ecb15ee2af42375b56e4331d1581e7f4682cc38d37fa83785c87df5eba576a8a2b313e4316b2ae1b31c2c879a9acc8b96a238b3731
|
data/lib/targit/asset.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'octokit'
|
2
2
|
require 'octoauth'
|
3
|
+
require 'mime-types'
|
3
4
|
|
4
5
|
module Targit
|
5
6
|
##
|
@@ -69,9 +70,16 @@ module Targit
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def _upload_options
|
72
|
-
[:name, :content_type].each_with_object({}) do |option, hash|
|
73
|
+
options = [:name, :content_type].each_with_object({}) do |option, hash|
|
73
74
|
hash[option] = @options[option] if @options[option]
|
74
75
|
end
|
76
|
+
options[:content_type] ||= guess_type
|
77
|
+
options
|
78
|
+
end
|
79
|
+
|
80
|
+
def guess_type
|
81
|
+
mime_type = MIME::Types.type_for(@asset).first
|
82
|
+
mime_type ? mime_type.content_type : nil
|
75
83
|
end
|
76
84
|
end
|
77
85
|
end
|
data/lib/targit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: targit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|