Class: CIJoePassenger::Project
- Inherits:
-
Object
- Object
- CIJoePassenger::Project
- Defined in:
- lib/cijoe_passenger/project.rb
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(name) ⇒ Project
constructor
A new instance of Project.
- #stale? ⇒ Boolean
Constructor Details
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
3 4 5 |
# File 'lib/cijoe_passenger/project.rb', line 3 def git @git end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/cijoe_passenger/project.rb', line 3 def name @name end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'lib/cijoe_passenger/project.rb', line 11 def self.all dirs.collect{|name| Project.new(name) } end |
.dirs ⇒ Object
5 6 7 8 9 |
# File 'lib/cijoe_passenger/project.rb', line 5 def self.dirs Dir['*'].select do |name| Git.new([name]).repo? end end |
.stale ⇒ Object
15 16 17 |
# File 'lib/cijoe_passenger/project.rb', line 15 def self.stale all.select(&:stale?) end |
Instance Method Details
#build ⇒ Object
28 29 30 31 |
# File 'lib/cijoe_passenger/project.rb', line 28 def build uri = URI.parse("http://#{Config.cijoe_url}/#{name}") Net::HTTP.post_form(uri, {}) end |
#stale? ⇒ Boolean
24 25 26 |
# File 'lib/cijoe_passenger/project.rb', line 24 def stale? git.current_head != git.upstream_head end |