simpex 0.0.2 → 0.0.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.
- data/lib/simpex/impex_result.rb +7 -3
- data/lib/simpex/version.rb +1 -1
- data/test/test_result.rb +1 -1
- metadata +2 -2
data/lib/simpex/impex_result.rb
CHANGED
@@ -23,9 +23,9 @@ class ImpexResult
|
|
23
23
|
check_for_impexify
|
24
24
|
end
|
25
25
|
|
26
|
-
def impexify(result_file_name="", time_stampify =
|
26
|
+
def impexify(result_file_name="", time_stampify = false)
|
27
|
+
stamp = Time.now.strftime("%S_%M_%H_%d_%m_%Y") if time_stampify
|
27
28
|
if result_file_name.empty?
|
28
|
-
stamp = Time.now.strftime("%S_%M_%H_%d_%m_%Y") if time_stampify
|
29
29
|
@types.each_with_index do |type, index|
|
30
30
|
if time_stampify
|
31
31
|
file_name = "#{@dest_folder}/#{format_number(@impexify_occurences)}_#{type.name.downcase}_#{stamp}.csv"
|
@@ -42,7 +42,11 @@ class ImpexResult
|
|
42
42
|
end
|
43
43
|
else
|
44
44
|
result_file_name = File.basename(result_file_name)
|
45
|
-
|
45
|
+
if time_stampify
|
46
|
+
file_name = "#{@dest_folder}/#{stamp}_#{result_file_name}"
|
47
|
+
else
|
48
|
+
file_name = "#{@dest_folder}/#{result_file_name}"
|
49
|
+
end
|
46
50
|
puts "writing complete result to the file #{file_name}"
|
47
51
|
result_file_name = File.basename(result_file_name)
|
48
52
|
raise "You gave the directory #{result_file_name} instead of a single file" if File.directory?(result_file_name)
|
data/lib/simpex/version.rb
CHANGED
data/test/test_result.rb
CHANGED
@@ -25,7 +25,7 @@ class TestResult < Test::Unit::TestCase
|
|
25
25
|
result = ImpexResult.new(@impex_dest_dir)
|
26
26
|
result << @category_type
|
27
27
|
result << @product_type
|
28
|
-
result.impexify("result.csv")
|
28
|
+
result.impexify("result.csv", false)
|
29
29
|
assert File.exist?(@result_file_path), "the file #{@result_file_path} should have been created"
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-23 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Read more details at the homepage https://github.com/denislutz/simpex
|
15
15
|
email:
|