Class: Integrity::Project
- Inherits:
-
Object
show all
- Includes:
- DataMapper::Resource, Notifiers, Push
- Defined in:
- lib/integrity/project.rb,
lib/integrity/project/push.rb,
lib/integrity/project/notifiers.rb
Defined Under Namespace
Modules: Notifiers, Push
Instance Method Summary
collapse
Methods included from Notifiers
#config_for, #enabled_notifiers, #notifies?, #update_notifiers
Methods included from Push
#push
Instance Method Details
#build(commit_identifier = "HEAD") ⇒ Object
28
29
30
31
32
33
|
# File 'lib/integrity/project.rb', line 28
def build(commit_identifier="HEAD")
commit_identifier = head_of_remote_repo if commit_identifier == "HEAD"
commit = find_or_create_commit_with_identifier(commit_identifier)
Build.queue(commit)
end
|
#human_readable_status ⇒ Object
48
49
50
|
# File 'lib/integrity/project.rb', line 48
def human_readable_status
last_commit && last_commit.human_readable_status
end
|
#last_commit ⇒ Object
35
36
37
|
# File 'lib/integrity/project.rb', line 35
def last_commit
commits.first(:project_id => id, :order => [:committed_at.desc])
end
|
#previous_commits ⇒ Object
39
40
41
42
|
# File 'lib/integrity/project.rb', line 39
def previous_commits
commits.all(:project_id => id, :order => [:committed_at.desc]).
tap {|commits| commits.shift }
end
|
#public=(flag) ⇒ Object
52
53
54
55
56
57
|
# File 'lib/integrity/project.rb', line 52
def public=(flag)
attribute_set(:public, case flag
when "1", "0" then flag == "1"
else !!flag
end)
end
|
44
45
46
|
# File 'lib/integrity/project.rb', line 44
def status
last_commit && last_commit.status
end
|