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

Version Path
qiita_org-0.2.2 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.2.1 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.41 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.40 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.39 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.38 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.37 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.35 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.34 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.33 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.32 lib/qiita_org/old_programs/decide_option.rb
qiita_org-0.1.31 lib/qiita_org/decide_option.rb
qiita_org-0.1.30 lib/qiita_org/decide_option.rb
qiita_org-0.1.29 lib/qiita_org/decide_option.rb
qiita_org-0.1.28 lib/qiita_org/decide_option.rb
qiita_org-0.1.27 lib/qiita_org/decide_option.rb
qiita_org-0.1.26 lib/qiita_org/decide_option.rb
qiita_org-0.1.25 lib/qiita_org/decide_option.rb
qiita_org-0.1.24 lib/qiita_org/decide_option.rb
qiita_org-0.1.23 lib/qiita_org/decide_option.rb