Class: CucumberFeatureManager

Inherits:
Struct
  • Object
show all
Includes:
CucumberFM::FeatureElement::Component::TotalEstimation, Grit
Defined in:
lib/cucumber_feature_manager.rb

Overview

TODO refactor, use repo full_path and feature not full path

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CucumberFM::FeatureElement::Component::TotalEstimation

#estimation, #estimation_done, #estimation_done_percentage, #scenarios_done, #scenarios_done_percentage

Methods included from Grit

log, version

Instance Attribute Details

#config_parametersObject

Returns the value of attribute config_parameters

Returns:

  • (Object)

    the current value of config_parameters



29
30
31
# File 'lib/cucumber_feature_manager.rb', line 29

def config_parameters
  @config_parameters
end

#infoObject (readonly)

Returns the value of attribute info.



34
35
36
# File 'lib/cucumber_feature_manager.rb', line 34

def info
  @info
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



29
30
31
# File 'lib/cucumber_feature_manager.rb', line 29

def path
  @path
end

#repo_pathObject

Returns the value of attribute repo_path

Returns:

  • (Object)

    the current value of repo_path



29
30
31
# File 'lib/cucumber_feature_manager.rb', line 29

def repo_path
  @repo_path
end

Instance Method Details

#aggregateObject



52
53
54
55
56
# File 'lib/cucumber_feature_manager.rb', line 52

def aggregate
  unless patterns_for_aggregator.empty?
    @raport ||= CucumberFM::Aggregator.new(self, patterns_for_aggregator).collection
  end
end

#commit_change_on(feature) ⇒ Object



62
63
64
65
66
67
# File 'lib/cucumber_feature_manager.rb', line 62

def commit_change_on(feature)
  # use info to notify user
  # @info = 'aaaa'
  add_to_index(feature)
  repo.commit_index("spec-update: #{feature.filename}")
end

#configObject



44
45
46
# File 'lib/cucumber_feature_manager.rb', line 44

def config
  @config ||= CucumberFM::Config.new((config_parameters || {}))
end

#featuresObject



36
37
38
# File 'lib/cucumber_feature_manager.rb', line 36

def features
  @features ||= scan_features
end

#filterObject



48
49
50
# File 'lib/cucumber_feature_manager.rb', line 48

def filter
  @filter ||= CucumberFM::TagFilter.new(config.tags)
end

#prefixObject



58
59
60
# File 'lib/cucumber_feature_manager.rb', line 58

def prefix
  config.dir.empty? ? path : File.join(path, config.dir)
end

#remove_file_from_repo(relative_path) ⇒ Object



69
70
71
# File 'lib/cucumber_feature_manager.rb', line 69

def remove_file_from_repo(relative_path)
  `cd #{repo_path} && git rm #{relative_path}`
end

#scenariosObject



40
41
42
# File 'lib/cucumber_feature_manager.rb', line 40

def scenarios
  (features.collect { |feature| feature.scenarios }).flatten
end

#send_to_remoteObject



73
74
75
# File 'lib/cucumber_feature_manager.rb', line 73

def send_to_remote
  push_to_remote
end