Class: SVNCampfireNotifier::Project
- Inherits:
-
Object
- Object
- SVNCampfireNotifier::Project
- Defined in:
- lib/svn_campfire_notifier/project.rb
Constant Summary collapse
- SUBJECTS =
%w(kitty turtle dog car computer retro fox rabbit tractor calculator bear shark happy cute)
- COLORS =
%w(red orange yellow green teal blue purple pink white grey black brown)
- TYPES =
EXCLUDE: face
%w(photo clipart lineart)
Instance Attribute Summary collapse
-
#repository_path ⇒ Object
readonly
Returns the value of attribute repository_path.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Instance Method Summary collapse
- #author ⇒ Object
- #changed ⇒ Object
- #color ⇒ Object
- #image_type ⇒ Object
-
#initialize(repository_path, revision) ⇒ Project
constructor
A new instance of Project.
- #log ⇒ Object
- #name ⇒ Object
- #subject ⇒ Object
Constructor Details
#initialize(repository_path, revision) ⇒ Project
Returns a new instance of Project.
9 10 11 12 |
# File 'lib/svn_campfire_notifier/project.rb', line 9 def initialize(repository_path, revision) @repository_path = repository_path @revision = revision.to_i end |
Instance Attribute Details
#repository_path ⇒ Object (readonly)
Returns the value of attribute repository_path.
7 8 9 |
# File 'lib/svn_campfire_notifier/project.rb', line 7 def repository_path @repository_path end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
7 8 9 |
# File 'lib/svn_campfire_notifier/project.rb', line 7 def revision @revision end |
Instance Method Details
#author ⇒ Object
18 19 20 |
# File 'lib/svn_campfire_notifier/project.rb', line 18 def @author ||= `svnlook author -r #{revision} #{repository_path}`.strip end |
#changed ⇒ Object
22 23 24 |
# File 'lib/svn_campfire_notifier/project.rb', line 22 def changed @changes ||= `svnlook changed -r #{revision} #{repository_path}`.strip end |
#color ⇒ Object
34 35 36 |
# File 'lib/svn_campfire_notifier/project.rb', line 34 def color COLORS[name[1] % COLORS.length] end |
#image_type ⇒ Object
38 39 40 |
# File 'lib/svn_campfire_notifier/project.rb', line 38 def image_type TYPES[name[2] % TYPES.length] end |
#log ⇒ Object
26 27 28 |
# File 'lib/svn_campfire_notifier/project.rb', line 26 def log @log ||= `svnlook log -r #{revision} #{repository_path}`.strip end |
#name ⇒ Object
14 15 16 |
# File 'lib/svn_campfire_notifier/project.rb', line 14 def name @repository_path.split('/').last end |