Class: Rocksteady::Corpus
- Inherits:
-
Object
- Object
- Rocksteady::Corpus
- Defined in:
- lib/rocksteady/corpus.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #add_repos(*paths) ⇒ Object
- #add_scenario(*args, &block) ⇒ Object
- #default_refs! ⇒ Object
-
#initialize(app) ⇒ Corpus
constructor
A new instance of Corpus.
-
#refs ⇒ Object
REFS.
-
#repos ⇒ Object
REPOS.
-
#scenarios ⇒ Object
SCENARIOS.
- #schedule ⇒ Object
- #session ⇒ Object
- #verify_refs! ⇒ Object
Constructor Details
#initialize(app) ⇒ Corpus
Returns a new instance of Corpus.
9 10 11 |
# File 'lib/rocksteady/corpus.rb', line 9 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/rocksteady/corpus.rb', line 8 def app @app end |
Instance Method Details
#add_repos(*paths) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/rocksteady/corpus.rb', line 31 def add_repos(*paths) paths.each do |path| repo = Grit::Repo.new(path) repos[name_of(repo)] = repo end end |
#add_scenario(*args, &block) ⇒ Object
19 20 21 22 23 |
# File 'lib/rocksteady/corpus.rb', line 19 def add_scenario(*args, &block) scenario = Scenario.new(self, *args, &block) scenarios << scenario scenario end |
#default_refs! ⇒ Object
44 45 46 47 48 |
# File 'lib/rocksteady/corpus.rb', line 44 def default_refs! repos.each_key do |repo_name| refs[repo_name] ||= 'master' end end |
#refs ⇒ Object
REFS
40 41 42 |
# File 'lib/rocksteady/corpus.rb', line 40 def refs @refs ||= {} end |
#repos ⇒ Object
REPOS
27 28 29 |
# File 'lib/rocksteady/corpus.rb', line 27 def repos @repos ||= {} end |
#scenarios ⇒ Object
SCENARIOS
15 16 17 |
# File 'lib/rocksteady/corpus.rb', line 15 def scenarios @scenarios ||= [] end |
#schedule ⇒ Object
63 64 65 |
# File 'lib/rocksteady/corpus.rb', line 63 def schedule @schedule ||= [] end |
#session ⇒ Object
59 60 61 |
# File 'lib/rocksteady/corpus.rb', line 59 def session @session ||= Session.new(self) end |
#verify_refs! ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/rocksteady/corpus.rb', line 50 def verify_refs! refs.each do |repo_name, ref| repo = repos[repo_name] unless repo.log(ref).any? raise ArgumentError, "Could not find #{repo_name} ref `#{ref}'" end end end |