Skip to content
This repository was archived by the owner on Mar 17, 2023. It is now read-only.
This repository was archived by the owner on Mar 17, 2023. It is now read-only.

'chunk' : wrong number of arguments (given 1, expected 0) #2

@jfujita

Description

@jfujita

I'm not a native ruby developer, and I get the following error when attempting a restore plan:

/usr/local/share/ruby/gems/2.3/gems/tina-1.0.0/lib/tina/restore_plan.rb:49:in chunk': wrong number of arguments (given 1, expected 0) (ArgumentError) from /usr/local/share/ruby/gems/2.3/gems/tina-1.0.0/lib/tina/restore_plan.rb:49:inchunk'
from /usr/local/share/ruby/gems/2.3/gems/tina-1.0.0/lib/tina/restore_plan.rb:19:in price' from /usr/local/share/ruby/gems/2.3/gems/tina-1.0.0/lib/tina/cli.rb:20:inrestore'
from /usr/local/share/ruby/gems/2.3/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/share/ruby/gems/2.3/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from /usr/local/share/ruby/gems/2.3/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /usr/local/share/ruby/gems/2.3/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from /usr/local/share/ruby/gems/2.3/gems/tina-1.0.0/bin/tina:6:in <top (required)>' from /usr/bin/tina:23:inload'
from /usr/bin/tina:23:in `

'

It seems to be some sort of argument mismatch in the chunk method in restore_plan.rb, but I can't figure out what it's doing:

def chunk(max_chunk_size)
        @chunks ||= begin
          chunks = @objects.chunk(sum: 0, index: 0) do |object, state|
            state[:sum] += object.size
            if state[:sum] > max_chunk_size
              state[:sum] = object.size
              state[:index] += 1
            end
            state[:index]
          end
          chunks.map(&:last)
        end
      end

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions