Skip to content

Commit

Permalink
HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7): rascu…
Browse files Browse the repository at this point in the history
…nho de estrategia por região
  • Loading branch information
fititnt committed Jun 8, 2021
1 parent 654b80f commit a4d211d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 16 deletions.
25 changes: 25 additions & 0 deletions _plugins/hapi/drops/hapi_drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,35 @@ def initialize(argumentum = {}) # rubocop:disable Lint/MissingSuper
@optionem = argumentum
end

# _[eng] List of all APIs, no special sorting or selection [eng]_
#
# @see _plugins/jekyll_hapi_api.rb
def api
@optionem['api']
end

# _[eng] List of all x-default APIs [eng]_
#
# @see _plugins/hapi/drops/xdefallo_api_drop.rb
def xapi
@optionem['xapi']
end

# _[eng] List of APIs & Schemas per Region [eng]_
#
# @see _plugins/hapi/drops/globum_drop.rb
def globum
@optionem['globum']
end

# def api_xdefallo
# @optionem['api_xdefallo']
# end

# _[eng] Generic list of Jekyll Pages, APIs, Schemas by category.
# Warning: this is a draft and may not be used. Consider this a
# draft.
# [eng]_
def categoriam
@optionem['categoriam']
end
Expand Down Expand Up @@ -75,13 +93,20 @@ def to_s
"<{#{self.class} @item=[#{optionem_explanandum.join(', ')}]}>"
end

# TODO: abstract scheman
def scheman
@optionem['scheman']
end

# TODO: abstract xscheman
def xscheman
@optionem['xscheman']
end

# _[eng] Generic list of Jekyll Pages, APIs, Schemas by tag.
# Warning: this is a draft and may not be used. Consider this a
# draft.
# [eng]_
def pittacium
@optionem['pittacium']
end
Expand Down
40 changes: 24 additions & 16 deletions _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,26 @@ def initiale_pre_render # rubocop:disable Metrics/AbcSize, Metrics/MethodLength,
next if page['categories'].nil?

page['categories'].each do |cat|
pittacium[cat] = [] if pittacium[cat].nil?
pittacium[cat].append(page)
categoriam[cat] = [] if categoriam[cat].nil?
categoriam[cat].append(page)
end
end

# api_xdefallo = api_xdefallo?(api)
api_gid_xdefallo = api_gid_xdefallo?(api)
globum = globum_api_et_scheman?(api)

jekyll_data = HSD.data?

jekyll_data['hapi'] = Hapi::Drops::HapiDrop.new(
{
'api' => api,
# 'api_xdefallo' => api_xdefallo,
'api_gid_xdefallo' => api_gid_xdefallo,
'globum' => api_gid_xdefallo,
'xapi' => api_gid_xdefallo,
'globum' => globum,
'categoriam' => categoriam,
'scheman' => { 'TODO' => '_[eng] To be implemented also here [eng]_' },
'xscheman' => { 'TODO' => '_[eng] To be implemented also here [eng]_' },
'pittacium' => pittacium
}
)
Expand All @@ -97,9 +99,9 @@ def api!(api)
Jekyll.sites[idx].data['api'] = api
end

def api_gid_xdefallo?(api_collectionem = nil, referens_gid = nil) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
def api_gid_xdefallo?(api_collectionem = nil) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
apis = api_collectionem || api?
referens_gid ||= referens_gid?
referens_gid = referens_gid?

# puts 'oi oi '
# puts referens_gid.empty?
Expand All @@ -124,16 +126,6 @@ def api_gid_xdefallo?(api_collectionem = nil, referens_gid = nil) # rubocop:disa
resultatum.append(drop)
end

# apis&.each do |api|
# resultatum.append(api) if api.xdefallo_est?
# # resultatum[clavem] = valendum
# end

# TODO: order by UN, XZ, then others

# puts 'resultatum'
# puts resultatum

resultatum
end

Expand Down Expand Up @@ -162,6 +154,16 @@ def data!(data)
Jekyll.sites[idx].data = data
end

# _[eng] Not implemented yet with this strategy [eng]_
def schemam?
[]
end

# _[eng] Not implemented yet with this strategy [eng]_
def xschemam?
[]
end

def site?
Jekyll.sites.last
end
Expand Down Expand Up @@ -198,6 +200,12 @@ def globum? # rubocop:disable Metrics/AbcSize
Jekyll.sites.last.data['l10n']['referensl10n']['gid']
end

def globum_api_et_scheman?(api_collectionem = nil, _schemam_collectionem = nil)
apis = api_collectionem || api?

api_gid_xdefallo?(api_collectionem)
end

def testum
# puts 'okay'
# puts 'Hapi.HSD.site?.inspect'
Expand Down

0 comments on commit a4d211d

Please sign in to comment.