Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get rid of deprecation code, except on Notifier::Base

  • Loading branch information...
commit 5390f5adacd82c92b948bf42e2c57a09e0b2b81a 1 parent 591a006
@sr sr authored
View
2  lib/integrity/app.rb
@@ -121,7 +121,7 @@ class App < Sinatra::Default
get "/:project/commits/:commit" do
login_required unless current_project.public?
- show :build, :title => ["projects", current_project.permalink, current_commit.short_commit_identifier]
+ show :build, :title => ["projects", current_project.permalink, current_commit.short_identifier]
end
get "/:project/builds/:commit" do
View
40 lib/integrity/build.rb
@@ -47,45 +47,5 @@ def start!(time=Time.now)
def complete!(time=Time.now)
self.completed_at = time
end
-
- #
- # Deprecated methods
- #
- def short_commit_identifier
- warn "Build#short_commit_identifier is deprecated, use Commit#short_identifier (#{caller[0]})"
- commit.short_identifier
- end
-
- def commit_identifier
- warn "Build#commit_identifier is deprecated, use Commit#identifier (#{caller[0]})"
- commit.identifier
- end
-
- def commit_author
- warn "Build#commit_author is deprecated, use Commit#author (#{caller[0]})"
- commit.author
- end
-
- def commit_message
- warn "Build#commit_message is deprecated, use Commit#message (#{caller[0]})"
- commit.message
- end
-
- def commited_at
- warn "Build#commited_at is deprecated, use Commit#committed_at (#{caller[0]})"
- commit.committed_at
- end
-
- def project_id
- warn "Build#project_id is deprecated, use Commit#project_id (#{caller[0]})"
- commit.project_id
- end
-
- def commit_metadata
- warn "Build#commit_metadata is deprecated, use the different methods in Commit instead (#{caller[0]})"
- { :message => commit.message,
- :author => commit.author,
- :date => commit.committed_at }
- end
end
end
View
7 lib/integrity/commit.rb
@@ -52,12 +52,5 @@ def human_readable_status
def output
build && build.output
end
-
- # Deprecation layer
- alias :short_commit_identifier :short_identifier
- alias :commit_identifier :identifier
- alias :commit_author :author
- alias :commit_message :message
- alias :commited_at :committed_at
end
end
View
2  lib/integrity/project.rb
@@ -1,12 +1,10 @@
require "integrity/project/notifiers"
require "integrity/project/push"
-require "integrity/project/deprecated"
module Integrity
class Project
include DataMapper::Resource
- include Helpers::Deprecated
include Helpers::Notifiers
include Helpers::Push
View
17 lib/integrity/project/deprecated.rb
@@ -1,17 +0,0 @@
-module Integrity
- class Project
- module Helpers
- module Deprecated
- def last_build
- warn "Project#last_build is deprecated, use Project#last_commit (#{caller[0]})"
- last_commit
- end
-
- def previous_builds
- warn "Project#previous_builds is deprecated, use Project#previous_commits (#{caller[0]})"
- previous_commits
- end
- end
- end
- end
-end
View
14 test/unit/build_test.rb
@@ -36,20 +36,6 @@ class BuildTest < Test::Unit::TestCase
@build.successful = false
@build.status.should be(:failed)
end
-
- test "deprecated properties" do
- pending do
- silence_warnings {
- @build.short_commit_identifier.should == @build.commit.short_identifier
- @build.commit_identifier.should == @build.commit.identifier
- @build.commit_author.should == @build.commit.author
- @build.commit_message.should == @build.commit.message
- @build.commited_at.should == @build.commit.committed_at
- @build.project_id.should == @build.commit.project_id
- @build.should respond_to(:commit_metadata)
- }
- end
- end
end
describe "Pending builds" do
View
7 test/unit/project_test.rb
@@ -110,13 +110,6 @@ class ProjectTest < Test::Unit::TestCase
project = Project.gen(:commits => commits)
project.last_commit.should == commits.sort_by {|c| c.committed_at }.last
end
-
- test "deprecated properties" do
- silence_warnings {
- @project.last_build.should == @project.last_commit
- @project.previous_builds.should == @project.previous_commits
- }
- end
end
describe "Validation" do
View
2  views/_commit_info.haml
@@ -12,7 +12,7 @@
%span.who<
&== by: #{commit.author.name}
|
- %span.when{ :title => commit.commited_at }<
+ %span.when{ :title => commit.committed_at }<
&= pretty_date commit.committed_at
|
%span.what<
Please sign in to comment.
Something went wrong with that request. Please try again.