Sha256: da545ddd77e35816e7ca80d0ac07575536cb276740a76d885e2462696a5af1d4

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 Bytes

Contents

class DecideOption
  def initialize(src)
    @src = src
  end

  def decide_option()
    lines = File.readlines(@src)

    lines.each do |line|
      if line.match(/\#\+qiita_(.+): (.+)/)
        option = line.match(/\#\+qiita_(.+): (.+)/)[1]
        return option
      end
    end
    option = "private"
    return option
  end
end

if __FILE__ == $0
  DecideOption.new("test.org").decide_option()
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qiita_org-0.1.22 lib/qiita_org/decide_option.rb
qiita_org-0.1.21 lib/qiita_org/decide_option.rb