deployments 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +8 -2
- data/lib/deployments/project.rb +4 -1
- data/lib/deployments/version.rb +1 -1
- data/spec/build_spec.rb +8 -2
- data/spec/project_spec.rb +9 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -57,8 +57,14 @@ Request params:
|
|
57
57
|
{
|
58
58
|
:author => "author",
|
59
59
|
:commit_attributes => {
|
60
|
-
"commit id" =>
|
61
|
-
|
60
|
+
"commit id" => {
|
61
|
+
"message" => "Add readme file",
|
62
|
+
"created_at" => "2012-05-23 10:38:46 +0300"
|
63
|
+
},
|
64
|
+
"commit id" => {
|
65
|
+
"message" => "Change readme file",
|
66
|
+
"created_at" => "2012-05-23 10:39:18 +0300"
|
67
|
+
}
|
62
68
|
},
|
63
69
|
:env => "staging",
|
64
70
|
:version => "1.0.1",
|
data/lib/deployments/project.rb
CHANGED
@@ -20,7 +20,10 @@ module Deployments
|
|
20
20
|
commits = between_tags(repo) if has_commits_between_tags?
|
21
21
|
|
22
22
|
(commits || repo.commits).inject({}) do |hash, commit|
|
23
|
-
hash[commit.id] =
|
23
|
+
hash[commit.id] = {
|
24
|
+
:message => commit.message,
|
25
|
+
:created_at => commit.date.to_s
|
26
|
+
}
|
24
27
|
hash
|
25
28
|
end
|
26
29
|
end
|
data/lib/deployments/version.rb
CHANGED
data/spec/build_spec.rb
CHANGED
@@ -38,8 +38,14 @@ describe Build do
|
|
38
38
|
|
39
39
|
it "should return commits of the git project between the latests tags" do
|
40
40
|
hash = {}
|
41
|
-
hash["dc7671f8a112706b6ee2404bae958fb8079dbda0"] =
|
42
|
-
|
41
|
+
hash["dc7671f8a112706b6ee2404bae958fb8079dbda0"] = {
|
42
|
+
:message => "Added deployments section to the README file",
|
43
|
+
:created_at=> "2012-05-23 10:39:18 +0300"
|
44
|
+
}
|
45
|
+
hash["45bedbc8cbb57792e00ad8dd9c9e7740ff3c2da5"] = {
|
46
|
+
:message => "Added README file",
|
47
|
+
:created_at => "2012-05-23 10:38:46 +0300"
|
48
|
+
}
|
43
49
|
|
44
50
|
params[:commit_attributes].should == hash
|
45
51
|
end
|
data/spec/project_spec.rb
CHANGED
@@ -14,6 +14,10 @@ describe Project do
|
|
14
14
|
project.commits.to_s.should include("Added README file")
|
15
15
|
end
|
16
16
|
|
17
|
+
it "should be possible to get creation date of commit" do
|
18
|
+
project.commits.to_s.should include("2012-06-05 11:05:43 +0300")
|
19
|
+
end
|
20
|
+
|
17
21
|
it "should retrieve empty tag" do
|
18
22
|
project.tag.should be_nil
|
19
23
|
end
|
@@ -27,6 +31,11 @@ describe Project do
|
|
27
31
|
project.commits.to_s.should include("Added README file")
|
28
32
|
end
|
29
33
|
|
34
|
+
it "should be possible to get creation dates of commits" do
|
35
|
+
project.commits.to_s.should include("2012-05-21 17:33:22 +0300")
|
36
|
+
project.commits.to_s.should include("2012-05-21 17:32:57 +0300")
|
37
|
+
end
|
38
|
+
|
30
39
|
it "should retrieve empty tag" do
|
31
40
|
project.tag.should be_nil
|
32
41
|
end
|