Sha256: 48ec322a4f27439c5a6820bc8c0d342ec06e5fb83c0dbe0573e45fc851b7c1f5
Contents?: true
Size: 1.2 KB
Versions: 107
Compression:
Stored size: 1.2 KB
Contents
ASSETS.cli.config do |cnf| cnf.people do |input, session, options| get = options.dig(:people, :get) || {} case when get == false Eco::API::Organization::People.new([]) when (get[:from] == :remote) && get[:type] == :full # -get-people session.micro.people_cache when (get[:from] == :remote) && get[:type] == :partial # -get-partial unless (input && input.is_a?(Enumerable)) raise "To use -get-partial (partial updates), you need to use -entries-from" end session.micro.people_search(input, options: options) when (get[:from] == :local) && get[:type] == :file # -people-from-backup session.micro.people_load(get[:file], modifier: :file) #people = JSON.parse(File.read(get[:file])) #Eco::API::Organization::People.new(people) else options.deep_merge!(people: { get: {from: :local, type: :full} }) people = session.micro.people_load(modifier: [:newest, :save]) if people.empty? options.deep_merge!(people: { get: {from: :remote, type: :full} }) people = session.micro.people_cache end people end end end
Version data entries
107 entries across 107 versions & 1 rubygems