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

Version Path
eco-helpers-2.3.3 lib/eco/cli/config/default/people.rb
eco-helpers-2.3.2 lib/eco/cli/config/default/people.rb
eco-helpers-2.2.5 lib/eco/cli/config/default/people.rb
eco-helpers-2.2.4 lib/eco/cli/config/default/people.rb
eco-helpers-2.2.3 lib/eco/cli/config/default/people.rb
eco-helpers-2.2.2 lib/eco/cli/config/default/people.rb
eco-helpers-2.2.1 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.12 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.11 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.10 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.9 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.8 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.7 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.6 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.5 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.4 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.3 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.2 lib/eco/cli/config/default/people.rb
eco-helpers-2.1.1 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.68 lib/eco/cli/config/default/people.rb