hola_milind_patel 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/hola_milind_patel.rb +75 -72
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1099678892e68d95880f0f0e9816f8db928d71d652e381e3def26921d7c4f049
|
4
|
+
data.tar.gz: 43c01c538248011c6f066999e6868a48629c93387c8c3b35cbaed4db35586902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c131e9a74a25a944b2ffe2a34c1d5012192aff6bd49ff6f1747369a350d2e2d33b3487352a04e17e220fc253b61cddf0cd043c1b67fbdeb92ad07c69b7256a8
|
7
|
+
data.tar.gz: 150447d78c7e1e3af7ce97cb41a9edd7a15ca1ef9d88321f56b74f40bc1950ce5b0a0a560bc5f1eff7ebd1c6527a4b22a72ff63a914421bbbaa0213bd1e2b1b4
|
data/lib/hola_milind_patel.rb
CHANGED
@@ -1,81 +1,84 @@
|
|
1
1
|
require 'mobility'
|
2
2
|
module HolaMilindPatel
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
3
|
+
def self.getData(data)
|
4
|
+
puts "============================================================"
|
5
|
+
puts "Function getData Called"
|
6
|
+
puts "============================================================"
|
7
|
+
if ENV['LANGUAGE'] == "all"
|
8
|
+
centers = data.as_json
|
9
|
+
centers.map do |center|
|
10
|
+
c1 = data.klass.find(center['id'])
|
11
|
+
c1.as_json.each do |key,value|
|
12
12
|
if (c1.send("#{key}_backend") rescue "false") != "false"
|
13
13
|
concat_attribute = key + "_backend"
|
14
14
|
c1.send(concat_attribute.parameterize.underscore.to_sym).locales.each do |locale|
|
15
|
-
|
15
|
+
center["#{key}_#{locale}"] = c1.send("#{key}_backend").read(locale)
|
16
16
|
end
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
17
|
+
end
|
18
|
+
end
|
19
|
+
center
|
20
|
+
end
|
21
|
+
else
|
22
|
+
HolaMilindPatel.locale = ENV['LANGUAGE']
|
23
|
+
#Mobility.locale = language
|
24
|
+
centers = data.as_json
|
25
|
+
if ENV['STRICT'] == "true"
|
26
|
+
centers.map do |center|
|
27
|
+
center.as_json.each do |key,value|
|
28
|
+
record = data.klass.find(center['id'])
|
29
|
+
if (record.send("#{key}_backend") rescue "false") != "false"
|
30
|
+
center[key] = record.send(key.parameterize.underscore.to_sym,fallback: false)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
center
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
return centers
|
38
38
|
end
|
39
|
-
def self.getShowData(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
39
|
+
def self.getShowData(data)
|
40
|
+
puts "============================================================"
|
41
|
+
puts "Function getShowData Called"
|
42
|
+
puts "============================================================"
|
43
|
+
if ENV['LANGUAGE'] == "all"
|
44
|
+
center = data
|
45
|
+
c = center.as_json
|
46
|
+
center.short_title_backend.locales.each do |locale|
|
47
|
+
center.as_json.each do |key,value|
|
48
|
+
if (center.send("#{key}_backend") rescue "false") != "false"
|
49
|
+
c["#{key}_#{locale}"] = center.send("#{key}_backend").read(locale)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
return c
|
54
|
+
else
|
55
|
+
HolaMilindPatel.locale = ENV['LANGUAGE']
|
56
|
+
#Mobility.locale = language
|
57
|
+
center = data
|
58
|
+
if ENV['STRICT'] == "true"
|
59
|
+
center.as_json.each do |key,value|
|
60
|
+
record = data.klass.find(center['id'])
|
61
|
+
if (record.send("#{key}_backend") rescue "false") != "false"
|
62
|
+
center[key] = record.send(key.parameterize.underscore.to_sym,fallback: false)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
return center
|
67
|
+
end
|
68
|
+
end
|
69
|
+
def self.hi
|
70
|
+
puts "===================="
|
71
|
+
puts "Hello Milind! Your Gem is working!!"
|
72
|
+
puts "===================="
|
73
|
+
end
|
74
|
+
class << self
|
75
|
+
def locale=(locale)
|
76
|
+
Mobility.locale = locale
|
77
|
+
puts "Locale has been set to " + locale
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.configure
|
82
|
+
|
68
83
|
end
|
69
|
-
def self.hi
|
70
|
-
puts "===================="
|
71
|
-
puts "Hello Milind! Your Gem is working!!"
|
72
|
-
puts "===================="
|
73
|
-
end
|
74
|
-
class << self
|
75
|
-
def locale=(locale)
|
76
|
-
Mobility.locale = locale
|
77
|
-
puts "Locale has been set to " + locale
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hola_milind_patel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Milind Patel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mobility
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.7.7
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Hola Milind!
|