Sha256: b572cd89fdce56b6d51631df2f7801865be6bb4977028dd5838742e6e8dfb965
Contents?: true
Size: 532 Bytes
Versions: 20
Compression:
Stored size: 532 Bytes
Contents
class DecideOption def initialize(src) @src = src end def decide_option() lines = File.readlines(@src) lines.each do |line| m = [] if m = line.match(/\#\+qiita_(.+): (.+)/) option = m[1] #line.match(/\#\+qiita_(.+): (.+)/)[1] unless option == "public" || option == "teams" || option == "private" next end return option end end option = "private" return option end end if __FILE__ == $0 DecideOption.new("test.org").decide_option() end
Version data entries
20 entries across 20 versions & 1 rubygems