deployments 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -1
- data/lib/deployments/build.rb +1 -1
- data/lib/deployments/dispatcher.rb +1 -1
- data/lib/deployments/project.rb +4 -1
- data/lib/deployments/version.rb +1 -1
- data/spec/build_spec.rb +9 -3
- data/spec/dispatcher_spec.rb +16 -2
- data/spec/project_spec.rb +8 -18
- metadata +2 -2
data/README.md
CHANGED
@@ -56,7 +56,16 @@ Request params:
|
|
56
56
|
{
|
57
57
|
{
|
58
58
|
:author => "author",
|
59
|
-
:
|
59
|
+
:commit_attributes => [
|
60
|
+
{
|
61
|
+
"sha" => "commit id",
|
62
|
+
"message" => "Add readme file",
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"sha" => "commit id",
|
66
|
+
"message" => "Change readme file"
|
67
|
+
}
|
68
|
+
],
|
60
69
|
:env => "staging",
|
61
70
|
:version => "1.0.1",
|
62
71
|
:domain => "staging.example.com"
|
data/lib/deployments/build.rb
CHANGED
data/lib/deployments/project.rb
CHANGED
data/lib/deployments/version.rb
CHANGED
data/spec/build_spec.rb
CHANGED
@@ -43,9 +43,15 @@ describe Build do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should return commits of the git project between the latests tags" do
|
46
|
-
params[:
|
47
|
-
|
48
|
-
|
46
|
+
params[:commit_attributes].should == [
|
47
|
+
{
|
48
|
+
"sha" => "dc7671f8a112706b6ee2404bae958fb8079dbda0",
|
49
|
+
"message" => "Added deployments section to the README file"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"sha" => "45bedbc8cbb57792e00ad8dd9c9e7740ff3c2da5",
|
53
|
+
"message" => "Added README file"
|
54
|
+
},
|
49
55
|
]
|
50
56
|
end
|
51
57
|
end
|
data/spec/dispatcher_spec.rb
CHANGED
@@ -17,7 +17,17 @@ describe Dispatcher do
|
|
17
17
|
:settings => {
|
18
18
|
:url => "example.com",
|
19
19
|
:key => "private",
|
20
|
-
:values => [1, 2]
|
20
|
+
:values => [1, 2],
|
21
|
+
:hashes => [
|
22
|
+
{
|
23
|
+
:a => "A",
|
24
|
+
:b => "B"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
:c => "C",
|
28
|
+
:d => "D"
|
29
|
+
}
|
30
|
+
]
|
21
31
|
}
|
22
32
|
}
|
23
33
|
end
|
@@ -26,7 +36,7 @@ describe Dispatcher do
|
|
26
36
|
Curl::Easy.should_receive(:http_post) do |url, fields|
|
27
37
|
url.should == Deployments.options.server
|
28
38
|
|
29
|
-
fields.count.should ==
|
39
|
+
fields.count.should == 11
|
30
40
|
fields[0].to_s.should == "username=james.bond"
|
31
41
|
fields[1].to_s.should == "params%5B%5D=fish"
|
32
42
|
fields[2].to_s.should == "params%5B%5D=cat"
|
@@ -34,6 +44,10 @@ describe Dispatcher do
|
|
34
44
|
fields[4].to_s.should == "settings%5Bkey%5D=private"
|
35
45
|
fields[5].to_s.should == "settings%5Bvalues%5D%5B%5D=1"
|
36
46
|
fields[6].to_s.should == "settings%5Bvalues%5D%5B%5D=2"
|
47
|
+
fields[7].to_s.should == "settings%5Bhashes%5D%5B%5D%5Ba%5D=A"
|
48
|
+
fields[8].to_s.should == "settings%5Bhashes%5D%5B%5D%5Bb%5D=B"
|
49
|
+
fields[9].to_s.should == "settings%5Bhashes%5D%5B%5D%5Bc%5D=C"
|
50
|
+
fields[10].to_s.should == "settings%5Bhashes%5D%5B%5D%5Bd%5D=D"
|
37
51
|
|
38
52
|
response
|
39
53
|
end
|
data/spec/project_spec.rb
CHANGED
@@ -14,9 +14,7 @@ describe Project do
|
|
14
14
|
let(:project_path) { './spec/fixtures/repositories/one_commit/dot_git' }
|
15
15
|
|
16
16
|
it "should be possible to get only commits" do
|
17
|
-
project.commits.should
|
18
|
-
"Added README file"
|
19
|
-
]
|
17
|
+
project.commits.to_s.should include("Added README file")
|
20
18
|
end
|
21
19
|
|
22
20
|
it "should retrieve empty tag" do
|
@@ -28,10 +26,8 @@ describe Project do
|
|
28
26
|
let(:project_path) { './spec/fixtures/repositories/commits/dot_git' }
|
29
27
|
|
30
28
|
it "should be possible to get only commits" do
|
31
|
-
project.commits.should
|
32
|
-
|
33
|
-
"Added README file"
|
34
|
-
]
|
29
|
+
project.commits.to_s.should include("Added deployments section to the README file")
|
30
|
+
project.commits.to_s.should include("Added README file")
|
35
31
|
end
|
36
32
|
|
37
33
|
it "should retrieve empty tag" do
|
@@ -43,10 +39,8 @@ describe Project do
|
|
43
39
|
let(:project_path) { './spec/fixtures/repositories/commits_tag/dot_git' }
|
44
40
|
|
45
41
|
it "should be possible to get commits" do
|
46
|
-
project.commits.should
|
47
|
-
|
48
|
-
"Added README file"
|
49
|
-
]
|
42
|
+
project.commits.to_s.should include("Added deployments section to the README file")
|
43
|
+
project.commits.to_s.should include("Added README file")
|
50
44
|
end
|
51
45
|
|
52
46
|
it "should retrieve the latest tag" do
|
@@ -58,10 +52,8 @@ describe Project do
|
|
58
52
|
let(:project_path) { './spec/fixtures/repositories/commits_tags/dot_git' }
|
59
53
|
|
60
54
|
it "should be possible to get commits between tags" do
|
61
|
-
project.commits.should
|
62
|
-
|
63
|
-
"Changed configuration for the app"
|
64
|
-
]
|
55
|
+
project.commits.to_s.should include("Added config.rb file")
|
56
|
+
project.commits.to_s.should include("Changed configuration for the app")
|
65
57
|
end
|
66
58
|
|
67
59
|
it "should retrieve the latest tag" do
|
@@ -73,9 +65,7 @@ describe Project do
|
|
73
65
|
let(:project_path) { './spec/fixtures/repositories/one_commit_tags/dot_git' }
|
74
66
|
|
75
67
|
it "should be possible to get commits between tags" do
|
76
|
-
project.commits.should
|
77
|
-
"Added config.rb file"
|
78
|
-
]
|
68
|
+
project.commits.to_s.should include("Added config.rb file")
|
79
69
|
end
|
80
70
|
|
81
71
|
it "should retrieve the latest tag" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deployments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: curb
|