class GradesFirst::Command
Base class for all command objects
Private Instance Methods
config()
click to toggle source
Configuration for the current project
# File lib/gradesfirst/command.rb, line 31 def config @configuration ||= GradesFirst::Config.new end
current_branch()
click to toggle source
Retrieves the current git branch
# File lib/gradesfirst/command.rb, line 12 def current_branch `git rev-parse --abbrev-ref HEAD` end
current_story()
click to toggle source
Retrieves the current story
# File lib/gradesfirst/command.rb, line 17 def current_story PivotalTracker.stories[story_id].get end
day_zero()
click to toggle source
The beginning date of a sprint
# File lib/gradesfirst/command.rb, line 36 def day_zero config.day_zero end
story_id(branch = current_branch)
click to toggle source
Extracts a PivotalTracker
story id from a branch if one is present
# File lib/gradesfirst/command.rb, line 22 def story_id(branch = current_branch) if branch =~ /[0-9]+$/ branch.match(/[0-9]+$/)[0] else nil end end