mymedia-card 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/mymedia-card.rb +24 -9
- metadata +2 -2
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c478040da872c3ef77085590d2f7093af45164fd
|
4
|
+
data.tar.gz: cca9389c75cf63b5ddda8a21e182ab9ce00fb20f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e04e94cb99bc5478d5e37f81c279a3c7d4391e578059e58223c4b974eb0a1e788d10fa0838bb1016e4995b1cff036032a5cbb2802d1e0f87bbe60614f657b12
|
7
|
+
data.tar.gz: 169cde6331f037612a6c14d9731122e7ef5691a6394a84a9e019f1e95846e15f8668ac7e06db1631aa3a53860e4912fb55dbc37307b26c87ee21937d4741fd8e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-card.rb
CHANGED
@@ -13,8 +13,7 @@ class MyMediaCard < MyMediaKvx
|
|
13
13
|
config: nil, ext: 'txt')
|
14
14
|
|
15
15
|
super(media_type: media_type, public_type: public_type,
|
16
|
-
config: config, ext: ext)
|
17
|
-
|
16
|
+
config: config, ext: ext)
|
18
17
|
@prefix = 'meta'
|
19
18
|
@txt_filepath = File.join(@media_src, \
|
20
19
|
Time.now.strftime('meta%d%m%yT%H%M') + '.txt' )
|
@@ -29,10 +28,12 @@ class MyMediaCard < MyMediaKvx
|
|
29
28
|
raw_s = dir.select_by_ext(@ext).sort_by_lastmodified.last[:name]
|
30
29
|
|
31
30
|
s,ext = raw_s.split(/(?=\.\w+$)/)
|
31
|
+
ext = '' if ext == '.dir'
|
32
32
|
raw_name, raw_tags = s.split(/--/,2)
|
33
33
|
tags = raw_tags ? raw_tags.split(/--/) : []
|
34
34
|
desc = raw_name.gsub(/-/,' ')
|
35
35
|
desc.capitalize! unless desc[0] == desc[0].upcase
|
36
|
+
|
36
37
|
filename = raw_name.downcase + ext
|
37
38
|
|
38
39
|
static_path = "%s/%s/%s" % [@public_type, \
|
@@ -43,12 +44,11 @@ class MyMediaCard < MyMediaKvx
|
|
43
44
|
summary = {title: desc, tags: tags.join(' ')}
|
44
45
|
body = {file: raw_static_destination}
|
45
46
|
|
46
|
-
kvx = Kvx.new({summary: summary, body: body},
|
47
|
-
|
47
|
+
kvx = Kvx.new({summary: summary, body: body}, \
|
48
|
+
attributes: {type: @media_type})
|
48
49
|
Dir.chdir @media_src
|
49
|
-
|
50
50
|
File.write @txt_filepath, kvx.to_s
|
51
|
-
|
51
|
+
|
52
52
|
FileUtils.mv raw_s, filename
|
53
53
|
end
|
54
54
|
|
@@ -58,11 +58,26 @@ class MyMediaCard < MyMediaKvx
|
|
58
58
|
def copy_edit(src_path, destination, raw='')
|
59
59
|
|
60
60
|
kvx, raw_msg = super(src_path, destination)
|
61
|
-
|
61
|
+
|
62
62
|
# copy the media file to the destination
|
63
63
|
destination = kvx.body[:file]
|
64
|
-
file = destination
|
65
|
-
|
64
|
+
file = File.basename(destination)
|
65
|
+
|
66
|
+
subdir = file[/.*(?=\.\w+$)|.*/]
|
67
|
+
|
68
|
+
if File.exists? File.join(@media_src, subdir) then
|
69
|
+
|
70
|
+
FileUtils.cp_r File.join(@media_src, subdir), File.join(@home, File.dirname(destination))
|
71
|
+
|
72
|
+
if File.basename(destination) != subdir then
|
73
|
+
FileUtils.cp File.join(@media_src, file), File.join(@home, destination)
|
74
|
+
end
|
75
|
+
|
76
|
+
else
|
77
|
+
|
78
|
+
FileUtils.cp File.join(@media_src, file), File.join(@home, destination)
|
79
|
+
|
80
|
+
end
|
66
81
|
|
67
82
|
[kvx, raw_msg]
|
68
83
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia-card
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Fel3ZehmfCVTepbDhmN9wy+aNa/pfEaGrRqjtvpPYQwVqzZBqxM39Y+hopVu2SCv
|
32
32
|
2Atqh3hHPujBHw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: mymedia-kvx
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
62e�����Z�
|
2
|
+
t�e�e<�?���ƅ�_wf�Mz��'q���0$w��ˌٚB.Q�� �u�U�� ��B����%�e� l�JnK�D�J�U�K
��%!zW#(��e�,���|ln
|