mymedia-card 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c478040da872c3ef77085590d2f7093af45164fd
4
- data.tar.gz: cca9389c75cf63b5ddda8a21e182ab9ce00fb20f
3
+ metadata.gz: 490b59ef38a7b788154a86bd6c7441f60cf8e362
4
+ data.tar.gz: 58ef59e122d055e76ec69218afc6516428f37e19
5
5
  SHA512:
6
- metadata.gz: 5e04e94cb99bc5478d5e37f81c279a3c7d4391e578059e58223c4b974eb0a1e788d10fa0838bb1016e4995b1cff036032a5cbb2802d1e0f87bbe60614f657b12
7
- data.tar.gz: 169cde6331f037612a6c14d9731122e7ef5691a6394a84a9e019f1e95846e15f8668ac7e06db1631aa3a53860e4912fb55dbc37307b26c87ee21937d4741fd8e
6
+ metadata.gz: 41ff0ec2287d362289142b88400ab27d5b7fb038a4f6376e856f3551a982f32faaab0322a2391343bc20d203ee361d8a84b9dab26c845015b7b85b0737823537
7
+ data.tar.gz: 3c2e100509fdef17d7cbc65073a8fe44592e0827a8bdce4199afa69c2a11b59f0fbd35fd6ae39acb953febc5a88595d718fed9d093a0b04a0cc09ec9709f28c7
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -20,11 +20,11 @@ class MyMediaCard < MyMediaKvx
20
20
 
21
21
  end
22
22
 
23
- def create_metadata_file
23
+ def create_metadata_file(static_file: false)
24
24
 
25
25
  raise "MyMediaCard: ext: must be supplied at initialize()" unless @ext
26
26
 
27
- dir = DirToXML.new(@media_src)
27
+ dir = DirToXML.new(File.join(@media_src, 'raw'))
28
28
  raw_s = dir.select_by_ext(@ext).sort_by_lastmodified.last[:name]
29
29
 
30
30
  s,ext = raw_s.split(/(?=\.\w+$)/)
@@ -33,11 +33,21 @@ class MyMediaCard < MyMediaKvx
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
-
37
- filename = raw_name.downcase + ext
38
36
 
39
- static_path = "%s/%s/%s" % [@public_type, \
40
- Time.now.strftime('%Y/%b/%d').downcase, filename]
37
+ static_path = if static_file then
38
+
39
+ @txt_filepath = File.join(@media_src, raw_name.downcase + '.txt' )
40
+ filename = raw_name.downcase + ext
41
+ "%s/raw/%s" % [@public_type, filename]
42
+
43
+ else
44
+
45
+ filename = raw_name.downcase + ext
46
+
47
+ "%s/%s/%s" % [@public_type, \
48
+ Time.now.strftime('%Y/%b/%d').downcase, filename]
49
+
50
+ end
41
51
 
42
52
  raw_static_destination = "/r/%s" % [static_path]
43
53
 
@@ -49,7 +59,7 @@ class MyMediaCard < MyMediaKvx
49
59
  Dir.chdir @media_src
50
60
  File.write @txt_filepath, kvx.to_s
51
61
 
52
- FileUtils.mv raw_s, filename
62
+ FileUtils.mv File.join('raw',raw_s), File.join('raw',filename)
53
63
  end
54
64
 
55
65
  private
@@ -70,12 +80,12 @@ class MyMediaCard < MyMediaKvx
70
80
  FileUtils.cp_r File.join(@media_src, subdir), File.join(@home, File.dirname(destination))
71
81
 
72
82
  if File.basename(destination) != subdir then
73
- FileUtils.cp File.join(@media_src, file), File.join(@home, destination)
83
+ FileUtils.cp File.join(@media_src, 'raw', file), File.join(@home, destination)
74
84
  end
75
85
 
76
86
  else
77
87
 
78
- FileUtils.cp File.join(@media_src, file), File.join(@home, destination)
88
+ FileUtils.cp File.join(@media_src, 'raw', file), File.join(@home, destination)
79
89
 
80
90
  end
81
91
 
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.2
4
+ version: 0.3.3
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-06-26 00:00:00.000000000 Z
34
+ date: 2015-07-10 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mymedia-kvx
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.6
83
+ rubygems_version: 2.4.8
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: In the context of the MyMedia system it is used for publishing a media file
metadata.gz.sig CHANGED
Binary file