pelicode-cli 0.1.0

Know where your code came from: finds code similar to published open-source packages, function by function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Stack
  def initialize
    @items = []
  end

  def push(item)
    @items.push(item)
  end

  def pop
    raise IndexError, "stack is empty" if @items.empty?
    @items.pop
  end

  def each_item
    @items.each { |item| yield item }
  end
end