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.0.47 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.46 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.45 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.44 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.43 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.42 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.41 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.40 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.39 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.38 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.37 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.36 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.35 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.34 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.33 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.32 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.31 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.30 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.29 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.28 lib/eco/cli/config/default/people.rb