transformator 0.0.1 → 0.1.0

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: 7d12867ec6be626559c324f81d2de7763d6d5276
4
- data.tar.gz: 6dc48981be819de4302d2432953f6f7183a48b63
3
+ metadata.gz: 0474274566563edf8f9f8cff236f3fdeff325375
4
+ data.tar.gz: 7d50aff06d3999b3e80cc8b50878d5f578093f5f
5
5
  SHA512:
6
- metadata.gz: b8d5164a191183bf62501b67eff5560d2389b5a4c9a863828e0ff88d5b04d5a1127d3501f6aa831982d45c94094be6ae23488224d2eeb04b2df9865c2b19b8ae
7
- data.tar.gz: bae53fd9cf275ffb45a5e306792d0b1eea195bcdd4064cd69a0474140810dd631e200e14d30c2792fa8d53e5d48dec315810d4ff16efa29601fea6791e35cf2f
6
+ metadata.gz: 0c875a1285ffe4b1f726b3955a6acda7d87e5221d9d4325b626e6196e5aef1882e970e83ba4f613ee565bdfd8ecda83652babf3d748f934af50ff4a461f87a8b
7
+ data.tar.gz: fc94425c73d50d232e40053b2a0477193cd0077abe8c949748df62cf5f385a656bca2e29983ec4b5779415eb6062427e4b1427702c4e88c67d18282de35eba28
data/Rakefile CHANGED
@@ -3,4 +3,47 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
+ task :benchmark do
7
+ require "benchmark/ips"
8
+ require "pry"
9
+ require_relative "./benchmark/primo_search_response_transformation"
10
+ require_relative "./lib/transformator"
11
+
12
+ Benchmark.ips do |bm|
13
+ bm.report("Transformator::Benchmark::PrimoSearchResponseTransformation") do
14
+ Transformator::Benchmark::PrimoSearchResponseTransformation.new.apply(
15
+ to: File.read(File.expand_path(File.join(File.dirname(__FILE__), "benchmark/primo_search_response_transformation/primo_response_1.xml"))),
16
+ output: :hash
17
+ )
18
+ end
19
+ end
20
+
21
+ =begin
22
+ #
23
+ # document_from_xml
24
+ #
25
+ xml_file_name = File.join(File.dirname(__FILE__), "benchmark/primo_search_response_transformation/primo_response.xml")
26
+ outer_document = Transformator.document_from_xml(File.read(xml_file_name))
27
+
28
+ Benchmark.ips do |bm|
29
+ bm.report("Transformator.document_from_xml") do
30
+ Transformator.document_from_xml(outer_document.locate("*/searchBriefReturn").first.text)
31
+ end
32
+ end
33
+
34
+ #
35
+ # hash_from_document
36
+ #
37
+ xml_file_name = File.join(File.dirname(__FILE__), "benchmark/primo_search_response_transformation/primo_response.xml")
38
+ outer_document = Transformator.document_from_xml(File.read(xml_file_name))
39
+ inner_document = Transformator.document_from_xml(outer_document.locate("*/searchBriefReturn").first.text)
40
+
41
+ Benchmark.ips do |bm|
42
+ bm.report("Transformator.hash_from_document") do
43
+ Transformator.hash_from_document(inner_document)
44
+ end
45
+ end
46
+ =end
47
+ end
48
+
6
49
  task :default => :spec