textmerge 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 103af1cc39dda0438e22aef0c7fb8859ddfe6b6e
4
- data.tar.gz: bc7a4a558622f3bd123073aa180061b9b917e9a4
3
+ metadata.gz: 4339a1f304a6a25ed22708bd27449c8ee661197a
4
+ data.tar.gz: e75100fb783fdbc3f76d65374247ceb51d630d05
5
5
  SHA512:
6
- metadata.gz: ee837cad7affc9357fa4626a9b8fab1c60c3c4a8a82445ea76e02c291c48bb7065cfc4b1e7b77701742470402d0d9b38f2fea0bea856b7dad728ed99d2a04067
7
- data.tar.gz: c2af49f1f4cdb3911358ecdd7cc3243695b31cea7389ea4c5ee656973195b36e49361f9e4bda90d98953abaf637c1c08e195289f88e7e5d4868e8408647daf32
6
+ metadata.gz: 4a07e8f213e3a41a58b8b69008f1b6b301227cbda6b1e23d74f226bac85aa67f629191213d4eb471699a0799cedccc7a42dcaef1a339d819b32bad639f5e3eb2
7
+ data.tar.gz: a267eae29a47019319ea0eb35244440e6bc20fd69eb0b93b34f9060ec1e1b46e5c7e3bed770a591ddc2e24197f4edc6de6600e10b9c3c21afe2860bd0c94a3e0
@@ -19,15 +19,14 @@ module Textmerge
19
19
  File.open(data_file, 'r') do |file|
20
20
  collection = file.map { |line| line.chomp.split(':') }
21
21
  end
22
- collection.sort!
22
+ # collection.sort!
23
23
  array_to_hash(collection)
24
24
  end
25
25
 
26
26
  def get_requests(data)
27
27
  regex = /\{(\d{1,3})\:(.*?)\}/
28
28
  collection = data.scan(regex)
29
- sorted = collection.sort
30
- array_to_hash(sorted)
29
+ array_to_hash(collection)
31
30
  end
32
31
 
33
32
  def get_responses(requests)
@@ -39,7 +38,7 @@ module Textmerge
39
38
 
40
39
  def merge_responses(responses,data)
41
40
  responses.each do |k,v|
42
- data.gsub!(/\{#{k}.*?\}/,v)
41
+ data.gsub!(/\{#{k}\:.*?\}/,v)
43
42
  end
44
43
  data
45
44
  end
@@ -56,6 +55,7 @@ module Textmerge
56
55
 
57
56
  def array_to_hash(array)
58
57
  array.inject({}) {|m,e| m[e[0].to_i] = e[1]; m}
58
+ # array.sort_by { | num,value | num}
59
59
  end
60
60
 
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module Textmerge
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/rebuild.sh ADDED
@@ -0,0 +1,4 @@
1
+ gem uninstall textmerge
2
+ rm -rf pkg/*.gem
3
+ rake build textmerge.gemspec
4
+ rake install pkg/textmerge*.gem
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textmerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Simpson
@@ -114,6 +114,7 @@ files:
114
114
  - lib/textmerge.rb
115
115
  - lib/textmerge/merge.rb
116
116
  - lib/textmerge/version.rb
117
+ - rebuild.sh
117
118
  - spec/lib/test_input.txt
118
119
  - spec/lib/textmerge_spec.rb
119
120
  - spec/spec_helper.rb