deployments 0.0.8 → 0.0.9

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 CHANGED
@@ -56,7 +56,16 @@ Request params:
56
56
  {
57
57
  {
58
58
  :author => "author",
59
- :commits => ["commits", "between", "tags"],
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"
@@ -15,7 +15,7 @@ module Deployments
15
15
  :author => username,
16
16
  :env => env,
17
17
  :version => tag,
18
- :commits => commits,
18
+ :commit_attributes => commits,
19
19
  :domain => domain
20
20
  },
21
21
  :api_key => api_key
@@ -40,7 +40,7 @@ module Deployments
40
40
 
41
41
  def field_as_array(key, value)
42
42
  value.map do |v|
43
- Curl::PostField.content("#{key}[]", v.to_s)
43
+ build_field("#{key}[]", v)
44
44
  end
45
45
  end
46
46
  end
@@ -13,7 +13,10 @@ module Deployments
13
13
  commits = between_tags(repo) if has_commits_between_tags?
14
14
 
15
15
  (commits || repo.commits).map do |commit|
16
- commit.message
16
+ {
17
+ "sha" => commit.id,
18
+ "message" => commit.message
19
+ }
17
20
  end
18
21
  end
19
22
 
@@ -1,3 +1,3 @@
1
1
  module Deployments
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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[:commits].should == [
47
- "Added deployments section to the README file",
48
- "Added README file"
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
@@ -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 == 7
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
- "Added deployments section to the README file",
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
- "Added deployments section to the README file",
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
- "Added config.rb file",
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.8
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-05 00:00:00.000000000 Z
12
+ date: 2012-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb