Class: Treeish::Base
- Inherits:
-
Object
- Object
- Treeish::Base
- Defined in:
- lib/treeish/base.rb
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
Instance Method Summary collapse
-
#initialize(git: nil) ⇒ Base
constructor
A new instance of Base.
- #recents ⇒ Object
Constructor Details
#initialize(git: nil) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/treeish/base.rb', line 10 def initialize(git: nil) @git = git || Git.open(Dir.pwd) end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
8 9 10 |
# File 'lib/treeish/base.rb', line 8 def git @git end |
Instance Method Details
#recents ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/treeish/base.rb', line 14 def recents get_treeishes(recents_command) do |line, names| next if reject_strategy(line, names) names << { value: value_strategy(line, names), name: name_strategy(line, names) } end end |