Sha256: 52900ae2003a10f1695eabc7740b5fd23e237ad0da23cb309920cd784f08765d

Contents?: true

Size: 406 Bytes

Versions: 2

Compression:

Stored size: 406 Bytes

Contents

module Turnip
  class FeatureFile
    attr_accessor :file_name, :content, :feature_name
    
    def initialize(file_name)
      @file_name = file_name
    end
    
    def feature_name
      @feature_name ||= begin
        file = Pathname.new(file_name).basename.to_s
        file[0...file.index('.feature')]
      end
    end
    
    def content
      @content ||= File.read(file_name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
turnip-0.3.1 lib/turnip/feature_file.rb
turnip-0.3.0 lib/turnip/feature_file.rb