Class: CodeInclusion::FullListing::GitTag::GitCmd
- Inherits:
-
Object
- Object
- CodeInclusion::FullListing::GitTag::GitCmd
- Defined in:
- lib/polytexnic/code_inclusion.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#tagname ⇒ Object
Returns the value of attribute tagname.
Instance Method Summary collapse
- #git_dir ⇒ Object
- #log ⇒ Object
- #repository_exists? ⇒ Boolean
- #show ⇒ Object
- #succeeded? ⇒ Boolean
- #tag_exists? ⇒ Boolean
- #tags ⇒ Object
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
335 336 337 |
# File 'lib/polytexnic/code_inclusion.rb', line 335 def filename @filename end |
#repository ⇒ Object
Returns the value of attribute repository.
335 336 337 |
# File 'lib/polytexnic/code_inclusion.rb', line 335 def repository @repository end |
#tagname ⇒ Object
Returns the value of attribute tagname.
335 336 337 |
# File 'lib/polytexnic/code_inclusion.rb', line 335 def tagname @tagname end |
Instance Method Details
#git_dir ⇒ Object
353 354 355 |
# File 'lib/polytexnic/code_inclusion.rb', line 353 def git_dir %Q[--git-dir="#{repository}"] if repository end |
#log ⇒ Object
349 350 351 |
# File 'lib/polytexnic/code_inclusion.rb', line 349 def log `git #{git_dir} log -1` end |
#repository_exists? ⇒ Boolean
357 358 359 |
# File 'lib/polytexnic/code_inclusion.rb', line 357 def repository_exists? !log.include?("Not a git repository") end |
#show ⇒ Object
337 338 339 |
# File 'lib/polytexnic/code_inclusion.rb', line 337 def show `git #{git_dir} show #{tagname}:#{filename}` end |
#succeeded? ⇒ Boolean
341 342 343 |
# File 'lib/polytexnic/code_inclusion.rb', line 341 def succeeded? $? == 0 end |
#tag_exists? ⇒ Boolean
361 362 363 |
# File 'lib/polytexnic/code_inclusion.rb', line 361 def tag_exists? .split("\n").include?(tagname) end |
#tags ⇒ Object
345 346 347 |
# File 'lib/polytexnic/code_inclusion.rb', line 345 def `git #{git_dir} tag` end |