phrase_assembler 1.0.9 → 1.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.
- data/lib/{PAProxies/PAAssembleProxy.rb → pa_proxies/pa_assemble_proxy.rb} +1 -1
- data/lib/{PAProxies/PAAutomateProxy.rb → pa_proxies/pa_automate_proxy.rb} +1 -1
- data/lib/{PAProxies/PACacheProxy.rb → pa_proxies/pa_cache_proxy.rb} +0 -0
- data/lib/{PAProxies/PACompositeProxy.rb → pa_proxies/pa_composite_proxy.rb} +3 -3
- data/lib/{PAProxies/PALangProxy.rb → pa_proxies/pa_lang_proxy.rb} +1 -1
- data/lib/{PAProxies/PALinkProxy.rb → pa_proxies/pa_link_proxy.rb} +1 -1
- data/lib/{PAProxies/PAProxy.rb → pa_proxies/pa_proxy.rb} +1 -1
- data/lib/{PAProxies/PAProxyData.rb → pa_proxies/pa_proxy_data.rb} +2 -2
- data/lib/{PAProxies/PAStringProxy.rb → pa_proxies/pa_string_proxy.rb} +1 -1
- data/lib/{PAProxies/PATokenProxy.rb → pa_proxies/pa_token_proxy.rb} +5 -2
- data/lib/phrase_assembler.rb +1 -1
- data/lib/utils/hash_add_on.rb +33 -0
- data/lib/{RArray.rb → utils/r_array.rb} +0 -0
- metadata +15 -14
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require '
|
1
|
+
require 'pa_proxies/pa_automate_proxy'
|
2
|
+
require 'pa_proxies/pa_string_proxy'
|
3
|
+
require 'pa_proxies/pa_cache_proxy'
|
4
4
|
class PACompositeProxy < PAAutomateProxy
|
5
5
|
include PAStringProxy
|
6
6
|
include PACacheProxy
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require '
|
1
|
+
require 'erb'
|
2
|
+
require 'pa_proxies/pa_proxy'
|
2
3
|
class PATokenProxyOptions
|
3
4
|
attr_accessor :options_hash
|
4
5
|
attr_accessor :indices_hash
|
@@ -45,6 +46,8 @@ class PATokenProxyOptions
|
|
45
46
|
end
|
46
47
|
|
47
48
|
class PATokenProxy < PAProxy
|
49
|
+
include ERB::Util
|
50
|
+
|
48
51
|
def new_instance(p_data)
|
49
52
|
return self.class.new(p_data, self.logger)
|
50
53
|
end
|
@@ -89,7 +92,7 @@ class PATokenProxy < PAProxy
|
|
89
92
|
result = add_options[sym_token]
|
90
93
|
end
|
91
94
|
|
92
|
-
result
|
95
|
+
html_escape(result)
|
93
96
|
}
|
94
97
|
return_p_data
|
95
98
|
end
|
data/lib/phrase_assembler.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
module HashAddOn
|
2
|
+
def self.symbolize_keys_recursive_for_hash(hash, downcase)
|
3
|
+
if hash.is_a? Hash
|
4
|
+
sym_hash = {}
|
5
|
+
|
6
|
+
hash.each{|key, value|
|
7
|
+
if (downcase)
|
8
|
+
if (key.is_a? String)
|
9
|
+
down_key = key.downcase
|
10
|
+
else
|
11
|
+
down_key = key.to_s.downcase
|
12
|
+
end
|
13
|
+
else
|
14
|
+
down_key = key
|
15
|
+
end
|
16
|
+
sym_hash[down_key.to_sym] = value
|
17
|
+
}
|
18
|
+
|
19
|
+
sym_hash.keys.each{|key|
|
20
|
+
if (sym_hash[key].is_a? Hash or sym_hash[key].is_a? Array)
|
21
|
+
sym_hash[key] = self.symbolize_keys_recursive_for_hash(sym_hash[key], downcase)
|
22
|
+
end
|
23
|
+
}
|
24
|
+
return sym_hash
|
25
|
+
elsif hash.is_a? Array
|
26
|
+
hash = hash.collect{|val| self.symbolize_keys_recursive_for_hash(val, downcase)}
|
27
|
+
return hash
|
28
|
+
else
|
29
|
+
return hash
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrase_assembler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.9
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Lovro \xC5\xBDmak, Radan Skori\xC4\x87, Drap"
|
@@ -42,18 +42,19 @@ extra_rdoc_files: []
|
|
42
42
|
|
43
43
|
files:
|
44
44
|
- lib/hash_add_on.rb
|
45
|
-
- lib/
|
46
|
-
- lib/
|
47
|
-
- lib/
|
48
|
-
- lib/
|
49
|
-
- lib/
|
50
|
-
- lib/
|
51
|
-
- lib/
|
52
|
-
- lib/
|
53
|
-
- lib/
|
54
|
-
- lib/
|
45
|
+
- lib/pa_proxies/pa_assemble_proxy.rb
|
46
|
+
- lib/pa_proxies/pa_automate_proxy.rb
|
47
|
+
- lib/pa_proxies/pa_cache_proxy.rb
|
48
|
+
- lib/pa_proxies/pa_composite_proxy.rb
|
49
|
+
- lib/pa_proxies/pa_lang_proxy.rb
|
50
|
+
- lib/pa_proxies/pa_link_proxy.rb
|
51
|
+
- lib/pa_proxies/pa_proxy.rb
|
52
|
+
- lib/pa_proxies/pa_proxy_data.rb
|
53
|
+
- lib/pa_proxies/pa_string_proxy.rb
|
54
|
+
- lib/pa_proxies/pa_token_proxy.rb
|
55
55
|
- lib/phrase_assembler.rb
|
56
|
-
- lib/
|
56
|
+
- lib/utils/hash_add_on.rb
|
57
|
+
- lib/utils/r_array.rb
|
57
58
|
has_rdoc: true
|
58
59
|
homepage: http://www.drap.hr
|
59
60
|
licenses: []
|