Class: Gitnesse::Features

Inherits:
Object
  • Object
show all
Defined in:
lib/gitnesse/features.rb

Class Method Summary collapse

Class Method Details

.gather(page_features) ⇒ Object

Public: Gathers features for placing into files. Currently only supports one feature per page. Others are discarded

page_features - the features

Returns a string containing the



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/gitnesse/features.rb', line 22

def self.gather(page_features)
  return '' if page_features.nil? || page_features.empty?

  features = ''

  name, content = page_features.shift
  puts "  # Pulling Feature: #{name}"
  features += content

  page_features.each do |name, feature|
    puts "  # WARNING! Discarding Feature: #{name}"
  end

  features
end

.write_file(filename, features) ⇒ Object

Public: Writes a feature to disk, given the filename and the features.

filename - the filename to use for the feature features - the features to write to disk



10
11
12
13
14
# File 'lib/gitnesse/features.rb', line 10

def self.write_file(filename, features)
  File.open(filename, "w") do |file|
    file.write(gather(features))
  end
end