dynarex-daily 0.1.6 → 0.1.7

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: 4dd66bb99da58ac6510f54935ecebc82c88c24c8
4
- data.tar.gz: b245e3ccdd71332bbd17a9e6b123ad1d881a4bfb
3
+ metadata.gz: a74a1fc27819917377117755380675a8809fdf07
4
+ data.tar.gz: d0c58ea1c792c5834f0287441f0a3db6bef3b830
5
5
  SHA512:
6
- metadata.gz: ebe063cf09d1afb63601f5bf829e1abcd490af1ab875bc0fcf63058c352555b596b456e9204e355666450b4ca6595fab965514e8608eff79641bf277e32f5051
7
- data.tar.gz: cfa1245e2fb4a130726313effc490e4b7d1e662e15b9759d4e54f40482216934a0cd60d5fe378bb6a962083a5cde69983ba14a585c365d06d9ed24d8ba785e50
6
+ metadata.gz: df220ce5957cda68c690e14eb698fe8d2ba31c9d06d7a6d00fd1fdf9d8d925ff5aad12e2a7b68c235d8f6c3ee0c131ef16e6eccf96880d5c95664fdc173bb02f
7
+ data.tar.gz: db575ee9f096f2d690fd3c212d6d4db8df2d34a9df1ec7de341036cb7bbb51c0bb8001f6e763935ea359b547f8a17bdafb42620163102ddf577f5876c985f5a3
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ��F5�|��U�һ"<��q #��4� ���;�y,����A�]D�ӂ�]��2F���TfҨ}}K��RF�6/C&X��)��gY�z[i}�����xm��AB* ւ�ڨ
2
- �U/��=������GUrV���U-�n��D��.�����&C�U��.a�ÔM�9J��������}�]S_�1���$bmyN�����Ԏ�)@����ɤU�À�������ԍ��W)���wtM[���6%3�� @Df��
1
+ ��4����&C�*��?���$s�����e7���(~�e4��jO��h�z�&�H�1���ݍ���N��z��ΰ��,��`��Hp��t�̖͝�a��/��$���W=���~d �`ߕ��7�� fjC�X�x�-���U��z��8~J<gI/������<���9��pw+?���W��#��,I���GI}׵Y�T�jd
2
+ *�!��R]�9H��'�o+�ϼ lk���X;��SK��ӕ�LWŨ���g
data.tar.gz.sig CHANGED
Binary file
data/lib/dynarex-daily.rb CHANGED
@@ -7,8 +7,9 @@ require 'fileutils'
7
7
 
8
8
  class DynarexDaily < Dynarex
9
9
 
10
- def initialize(stringx=nil)
10
+ def initialize(stringx=nil, options={})
11
11
 
12
+ @opt = {dir_archive: :days}.merge options
12
13
  @filename = 'dynarexdaily.xml'
13
14
  super(stringx) if stringx
14
15
 
@@ -16,7 +17,7 @@ class DynarexDaily < Dynarex
16
17
  super(@filename)
17
18
  if !summary[:date].empty? and \
18
19
  Time.parse(summary[:date]).day != Time.now.day then
19
- archive_file
20
+ archive_file Time.parse(summary[:date])
20
21
  create_file
21
22
  end
22
23
  else
@@ -40,10 +41,17 @@ class DynarexDaily < Dynarex
40
41
  self.save
41
42
  end
42
43
 
43
- def archive_file()
44
- dir = 'days'
45
- FileUtils.mkdir dir unless File.exist? dir
46
- FileUtils.mv(@filename, "%s/%s" % [dir, Time.now.strftime("d%d%m%y.xml")])
44
+ def archive_file(t)
45
+
46
+ if @opt[:dir_archive] == :days then
47
+ dir, file = 'days', t.strftime("d%d%m%y.xml")
48
+ else
49
+ dir, file = t.strftime("%Y/%b/%d").downcase, 'index.xml'
50
+ end
51
+
52
+ FileUtils.mkdir_p dir unless File.exist? dir
53
+ FileUtils.mv(@filename, "%s/%s" % [dir, file])
54
+
47
55
  end
48
56
 
49
- end
57
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex-daily
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,20 +29,20 @@ cert_chain:
29
29
  CnIUjjSEEPMvkzFgVQshHTOVyRaNzppPSPWwvakBPP/8NJnFaXRtvSBnRtKzj5TZ
30
30
  9ed0sdhUtCWLmeRf6GBvxZEkdQj5mlOX
31
31
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
32
+ date: 2013-10-12 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: dynarex
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  description:
@@ -62,12 +62,12 @@ require_paths:
62
62
  - lib
63
63
  required_ruby_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
metadata.gz.sig CHANGED
Binary file