cap-git-deploy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84f6cead345d88b05a62d142c6bb180693dce4c5
4
- data.tar.gz: b51288a0154302ea5d8489ad595060fc213c3981
3
+ metadata.gz: d6ea635853d315bab5683403f0b1a672017e9569
4
+ data.tar.gz: d0466392b528f2b509c91dd7b9c83dda7079f90d
5
5
  SHA512:
6
- metadata.gz: 9b51504b5043029382cd39932b50d1dd59c4c9e44f17dc7907f77942f65b30e125097e6a5b46662406218029723e9aa77d24ae414e0d0f3a31614c75b18c25c3
7
- data.tar.gz: 739693a098332d92fffd7ebdc8ed431e06b781ac28c68a60c5d58ee6820ede4e9d1cc75941356c1b6825c1569890f7fbb7b7437e670fbe672d263ddfe7b8dbbe
6
+ metadata.gz: 31ee25f5d4fd1914da809540716a5a275d687eecf903a3620a1d4ecc2a01aed7b060f24880602404fa5697047cb7e4ded02a69f0b5f5f095daddf822165c8348
7
+ data.tar.gz: e71b6c3232ad4ee342e5ae1cdca27bbcd4171713b779bcad16be5dc79dc300dc611e530cf8d7332d8170736f0b98615c85f3ca4a943172020433e01cf25fd900
@@ -19,7 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_runtime_dependency 'capistrano', '~> 2.0'
22
- spec.add_runtime_dependency 'grit'
23
-
24
22
  spec.add_development_dependency 'rake'
25
23
  end
@@ -1,7 +1,6 @@
1
1
  require 'capistrano'
2
2
  require 'cap-git-deploy/version'
3
3
 
4
- require 'grit'
5
4
  require 'etc'
6
5
 
7
6
  module Cap
@@ -11,15 +10,15 @@ module Cap
11
10
 
12
11
  # The name of the branch we are deploying
13
12
  def self.current_branch
14
- repo = Grit::Repo.new '.'
15
- branch = repo.head
16
- # if branch is nil, we are in a spurius commit, then we should use master
17
- branch && branch.name || 'master'
13
+ repo = `git rev-parse --abbrev-ref HEAD`.chomp
18
14
  end
19
15
 
20
16
  # The name of the current logged user
21
17
  def self.current_user
22
- "#{Etc.getlogin}@#{Socket.gethostname}"
18
+ login = Etc.getlogin
19
+ user = Etc.getpwnam(login)
20
+ host = Socket.gethostname
21
+ "<#{user}> #{login}@#{host}"
23
22
  end
24
23
  end
25
24
  end
@@ -1,7 +1,7 @@
1
1
  module Cap
2
2
  module Git
3
3
  module Deploy
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
7
7
  end
@@ -13,13 +13,14 @@ namespace :revision do
13
13
  sha = data.strip
14
14
  end
15
15
 
16
- commands = []
17
- commands << "cd #{current_path}"
18
- commands << "echo '#{sha}' > #{revision_file}"
19
- commands << "echo '#{branch}' >> #{revision_file}"
20
- commands << "echo '#{logged_user}' >> #{revision_file}"
21
- commands << "echo '#{Time.now}' >> #{revision_file}"
22
- run commands.join ' && '
16
+ revision_contents = [
17
+ sha,
18
+ branch,
19
+ logged_user,
20
+ Time.now,
21
+ ].join("\n")
22
+
23
+ put revision_contents, "#{current_path}/#{revision_file}"
23
24
  end
24
25
 
25
26
  desc "Get info about last deploy"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap-git-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Racco
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-12 00:00:00.000000000 Z
12
+ date: 2013-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -25,20 +25,6 @@ dependencies:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '2.0'
28
- - !ruby/object:Gem::Dependency
29
- name: grit
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - '>='
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - '>='
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rake
44
30
  requirement: !ruby/object:Gem::Requirement