alphasights-integrity 0.1.9.6 → 0.1.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/integrity.gemspec +1 -1
- data/lib/integrity/commit.rb +7 -0
- data/lib/integrity/migrations.rb +4 -4
- data/lib/integrity/project.rb +1 -1
- data/test/unit/commit_test.rb +6 -0
- metadata +1 -1
data/integrity.gemspec
CHANGED
data/lib/integrity/commit.rb
CHANGED
@@ -57,5 +57,12 @@ module Integrity
|
|
57
57
|
def output
|
58
58
|
build && build.output
|
59
59
|
end
|
60
|
+
|
61
|
+
def committed_at=(time_with_timezone)
|
62
|
+
unless time_with_timezone.respond_to?(:utc)
|
63
|
+
time_with_timezone = Time.parse(time_with_timezone)
|
64
|
+
end
|
65
|
+
attribute_set(:committed_at, time_with_timezone.utc)
|
66
|
+
end
|
60
67
|
end
|
61
68
|
end
|
data/lib/integrity/migrations.rb
CHANGED
@@ -39,9 +39,9 @@ module Integrity
|
|
39
39
|
column :id, Integer, :serial => true
|
40
40
|
column :name, String, :nullable => false
|
41
41
|
column :permalink, String
|
42
|
-
column :uri,
|
42
|
+
column :uri, Text, :nullable => false
|
43
43
|
column :branch, String, :nullable => false, :default => "master"
|
44
|
-
column :command,
|
44
|
+
column :command, Text, :nullable => false, :default => "rake"
|
45
45
|
column :public, Boolean, :default => true
|
46
46
|
column :building, Boolean, :default => false
|
47
47
|
column :created_at, DateTime
|
@@ -83,7 +83,7 @@ module Integrity
|
|
83
83
|
|
84
84
|
create_table :integrity_commits do
|
85
85
|
column :id, Integer, :serial => true
|
86
|
-
column :identifier, String, :nullable => false
|
86
|
+
column :identifier, String, :size => 40, :nullable => false
|
87
87
|
column :message, Text, :nullable => true
|
88
88
|
column :author, String, :nullable => true, :length => 255
|
89
89
|
column :committed_at, DateTime, :nullable => false
|
@@ -151,7 +151,7 @@ module Integrity
|
|
151
151
|
|
152
152
|
migration 4, :add_url_to_commits do
|
153
153
|
up do
|
154
|
-
modify_table(:integrity_commits) { add_column :url,
|
154
|
+
modify_table(:integrity_commits) { add_column :url, Text }
|
155
155
|
end
|
156
156
|
|
157
157
|
down do
|
data/lib/integrity/project.rb
CHANGED
@@ -11,7 +11,7 @@ module Integrity
|
|
11
11
|
property :permalink, String
|
12
12
|
property :uri, URI, :nullable => false, :length => 255
|
13
13
|
property :branch, String, :nullable => false, :default => "master"
|
14
|
-
property :command,
|
14
|
+
property :command, Text, :nullable => false, :default => "rake"
|
15
15
|
property :public, Boolean, :default => true
|
16
16
|
property :building, Boolean, :default => false
|
17
17
|
property :created_at, DateTime
|
data/test/unit/commit_test.rb
CHANGED
@@ -51,6 +51,12 @@ class CommitTest < Test::Unit::TestCase
|
|
51
51
|
commit = Commit.gen(:committed_at => Time.utc(2008, 10, 12, 14, 18, 20))
|
52
52
|
commit.committed_at.to_s.should == "2008-10-12T14:18:20+00:00"
|
53
53
|
end
|
54
|
+
|
55
|
+
it "normalizes the commit date time to UTC " do
|
56
|
+
time = Time.parse('Thu Apr 16 08:52:25 BST 2009')
|
57
|
+
commit = Commit.gen(:committed_at => time)
|
58
|
+
commit.committed_at.to_s.should == "2009-04-16T07:52:25+00:00"
|
59
|
+
end
|
54
60
|
|
55
61
|
it "has a human readable status" do
|
56
62
|
commit = Commit.gen(:successful, :identifier => "658ba96cb0235e82ee720510c049883955200fa9")
|