yaml_creator 0.3.0 → 0.3.1

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: d1565ca1a113a6c7d4a23d4afa0649c7bd326d89
4
- data.tar.gz: 8cf72b880eb02750d4556173559ec128c4b39064
3
+ metadata.gz: 2d6f3b1a6ab07a383af57eac30da16e9db1891f1
4
+ data.tar.gz: 5ff30aaea9dd898a51238020782bc873903f5405
5
5
  SHA512:
6
- metadata.gz: 62639849a004fc3168fc796161cb80dd74f827ba3cadebbbd9e524a4ac0636ae592978a5b5534c86183640a89d9eb009c8f1443673c706481ba10b09a319480d
7
- data.tar.gz: 79916b031bdbcea5b0f973dcf8cadde23dec307471fbb66a8d0ed3400ae760ccbe676ae0c3791f30789ff1536a03d329076f3ab3ecd76e517aa580765c2edeff
6
+ metadata.gz: 29e552133203fba835c0f242011c98da39c69cfaac07a884da6994984366cffd91e6e7956a4b0d17594cb630cb47c863be4b98d54de83ac1d6d87a6b99ae35d3
7
+ data.tar.gz: d44d2b58c2086b49dde862f4fda8e8b04d6ce1e5b2694c382d30ff8650a916465813f8330120309b8257244bfe10c86e1d656f2728d4e08725117d711395ac4b
data/README.md CHANGED
@@ -4,6 +4,7 @@ Welcome to your new gem! In this directory, you'll find the files you need to be
4
4
 
5
5
  Create yaml file from array, hash, and json.
6
6
  This gem not use yaml lib.
7
+ You specify filepath empty, generate filepath [ %Y%m%d%H%M%S%3N.yml ].
7
8
 
8
9
  ## Installation
9
10
 
@@ -75,6 +75,11 @@ module YamlCreator
75
75
  # @param [Array] save array
76
76
  def self.save_file(filepath, array)
77
77
 
78
+ # generate filepath.
79
+ if filepath.empty?
80
+ filepath = generate_filepath
81
+ end
82
+
78
83
  # write to file.
79
84
  File.open(filepath, "w") do |file|
80
85
  array.each { |value|
@@ -82,4 +87,13 @@ module YamlCreator
82
87
  }
83
88
  end
84
89
  end
90
+
91
+ # generate filepath.
92
+ # @return [String] filepath
93
+ def self.generate_filepath
94
+
95
+ # generate yaml filename.
96
+ time_str = Time.now.strftime("%Y%m%d%H%M%S%3N")
97
+ "#{time_str}.yml"
98
+ end
85
99
  end
@@ -1,3 +1,3 @@
1
1
  module YamlCreator
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_creator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - h.shigemoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler