Sha256: ee9ed08fdbc0a38e9282b51538ace39aa44eed84587e9a4fe783621da50e19b0

Contents?: true

Size: 1.4 KB

Versions: 32

Compression:

Stored size: 1.4 KB

Contents

ASSETS.cli.config do |cnf|
  cnf.people do |input, session, options|
    people = Eco::API::Organization::People.new([])
    if SCR.get_arg("-get-people")
      options.deep_merge!(people: {
        get: {from: :remote, type: :full}
      })
      people = session.micro.people_cache
    elsif SCR.get_arg("-no-people")
      people = Eco::API::Organization::People.new([])
    elsif SCR.get_arg("-people-from-backup")
      file = SCR.get_arg("-people-from-backup", with_param: true)
      options.deep_merge!(people: {
        get: {from: :local, type: :backup}
      })
      people = JSON.parse(File.read(file))
      people = Eco::API::Organization::People.new(people)
    elsif SCR.get_arg("-get-partial")
      unless input && input.is_a?(Enumerable)
        raise "To use -get-partial (partial updates), you need to use -entries-from"
      end
      options.deep_merge!(people: {
        get: {from: :remote, type: :partial}
      })

      people = session.micro.people_search(input, options: options)
    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 if people.empty?
      end
    end
    people
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
eco-helpers-2.0.19 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.18 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.17 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.16 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.15 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.14 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.13 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.12 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.11 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.10 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.9 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.8 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.7 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.6 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.5 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.4 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.3 lib/eco/cli/config/default/people.rb
eco-helpers-2.0.2 lib/eco/cli/config/default/people.rb
eco-helpers-1.5.15 lib/eco/cli/config/default/people.rb
eco-helpers-1.5.14 lib/eco/cli/config/default/people.rb