mina-rsync 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDNmYTkyYWQyYzAxMjhjOWNjNTY1YWNiOWExZWEyODBlMGE5MTAxZQ==
4
+ ZjJhYTZhMzUwMmVlNTk5NWI2N2MyMWUzMjc3MTUyMGI4ZmY1ODFlNA==
5
5
  data.tar.gz: !binary |-
6
- YzEwNDEyZDZiNTAyYWEzYzY5MGEwMzg2NDY3MDJmZjNjYTc2MjJjMw==
6
+ YzgxZjNjYzFkYzg4ZWQ5MzdiMTJmODQ0NmE5OTMzOWU4MGE4OTczZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWVkNjFjZDAxOWI1ZWI2MjQyOTQ2ZGU2ZTY0MmMyOWNkODZlZDdmN2M2Yzc5
10
- NjgxMGM3NDNmMmFlZWVkN2ZjNjA2OWYyZTc4ODYwNzE1OTUwNDM4YzI5MGIy
11
- MzE4YjUzNzNhMWNlZjliOTE4OTZjM2EwNmQ3ZWZhMWI3YzdmNzI=
9
+ ZDY2MmI5NWFmN2FmZGQzMTM4MGE5MDM4MDBjYWRkMzQyOTQzNDcyNjRmZjkz
10
+ OGFiM2M1YjRiYTJiZTFhY2Q5NDg5ZGRmMDY5ZThiYWY5NGY5ZDNhZTg0ZWY2
11
+ ZWIyNWNmMGVkNjQ0Y2E2NTU3ZjM4MDdjNmIwZWQ0MmNmMDQyZmQ=
12
12
  data.tar.gz: !binary |-
13
- Mjg4ODcxMjBlNzAyOTFjZTRjY2VjMzUwYzEwOTkzZjg2ODE2ZmI5Zjk1N2Uy
14
- NGViMjM4MmU1YTRkZmMzYjk1NjNiYTM4ZTI1YWVjMzQ2Mjc1OGNhNDgwOWE3
15
- ZWRmM2E0YmJjMDMxNzAwMWU0NTExMzI5ZGZlMWRmZDE3ZTk0NmQ=
13
+ ZDQ1NGY4ZTA4N2YzYjc5MzU0ZjgzMTdjMjhkNDc5NjhhNWE5Y2E0NzAyNTEy
14
+ YWU4ZDE4Yjc5YzRlODE1YWY4YWMyMmIxNGE0NmE2MDRlODU3ZWRlZTNlYjg1
15
+ ZWY2OWYxZDFmMDFmNjZlZTc3YTJkYmViZTA1MjJiMGMwYTNhYTI=
@@ -1,2 +1,6 @@
1
+ ## 1.1.0 (Sep 2, 2013)
2
+ - Prints progress messages like Mina does it and with color.
3
+ - Supports `--verbose` running to see what commands get executed.
4
+
1
5
  ## 1.0.0 (Sep 2, 2013)
2
6
  - First release. Let's get syncing!
@@ -1,9 +1,9 @@
1
1
  require File.expand_path("../rsync/version", __FILE__)
2
2
 
3
- # NOTE: Please don't depend on tasks without a description (`desc`) remaining
4
- # as they are between minor or patch version releases. They make up the private
5
- # API and internalas of Mina::Rsync. If you think something should be public
6
- # for extending, please let me know!
3
+ # NOTE: Please don't depend on tasks without a description (`desc`) as they
4
+ # might change between minor or patch version releases. They make up the
5
+ # private API and internals of Mina::Rsync. If you think something should be
6
+ # public for extending and hooking, please let me know!
7
7
 
8
8
  set_default :repository, "."
9
9
  set_default :branch, "master"
@@ -18,11 +18,9 @@ set_default :rsync_stage, "tmp/deploy"
18
18
  set_default :rsync_cache, "shared/deploy"
19
19
 
20
20
  run = lambda do |*cmd|
21
- if simulate_mode?
22
- puts "$ #{cmd.join(" ")}"
23
- else
24
- Kernel.system *cmd
25
- end
21
+ cmd = cmd[0] if cmd[0].is_a?(Array)
22
+ print_command cmd.join(" ") if simulate_mode? || verbose_mode?
23
+ Kernel.system *cmd unless simulate_mode?
26
24
  end
27
25
 
28
26
  rsync_cache = lambda do
@@ -34,7 +32,7 @@ end
34
32
 
35
33
  desc "Stage and rsync to the server (or its cache)."
36
34
  task :rsync => %w[rsync:stage] do
37
- puts "Rsyncing to #{rsync_cache.call}..."
35
+ print_status "Rsyncing to #{rsync_cache.call}..."
38
36
 
39
37
  rsync = %w[rsync]
40
38
  rsync.concat settings.rsync_options
@@ -44,34 +42,37 @@ task :rsync => %w[rsync:stage] do
44
42
  host = settings.domain
45
43
  rsync << "#{user}#{host}:#{rsync_cache.call}"
46
44
 
47
- run.call *rsync
45
+ run.call rsync
48
46
  end
49
47
 
50
48
  namespace :rsync do
51
49
  task :create_stage do
52
50
  next if File.directory?(settings.rsync_stage)
53
- puts "Cloning repository for the first time..."
51
+ print_status "Cloning repository for the first time..."
54
52
 
55
- clone = %W[git clone]
53
+ clone = %w[git clone]
56
54
  clone << settings.repository
57
55
  clone << settings.rsync_stage
58
- run.call *clone
56
+ run.call clone
59
57
  end
60
58
 
61
59
  desc "Stage the repository in a local directory."
62
60
  task :stage => %w[create_stage] do
63
- puts "Staging..."
64
-
65
- puts "$ cd #{settings.rsync_stage}" if simulate_mode?
66
- Dir.chdir settings.rsync_stage do
67
- run.call *%W[git fetch --quiet --all --prune]
68
- print "Git checkout: "
69
- run.call *%W[git reset --hard origin/#{settings.branch}]
70
- end
61
+ print_status "Staging..."
62
+
63
+ stage = settings.rsync_stage
64
+ git = %W[git --git-dir #{stage}/.git --work-tree #{stage}]
65
+ run.call git + %w[fetch --quiet --all --prune]
66
+
67
+ # Prefix the Git "HEAD is now at" message, but only if verbose is unset,
68
+ # because then the #print_command called by #run prints its own prefix.
69
+ print "Git checkout: " unless simulate_mode? || verbose_mode?
70
+ run.call git + %W[reset --hard origin/#{settings.branch}]
71
71
  end
72
72
 
73
73
  task :build do
74
- queue %(#{settings.rsync_copy} "#{rsync_cache.call}/" ".")
74
+ queue %(echo "-> Copying from cache directory to build path")
75
+ queue! %(#{settings.rsync_copy} "#{rsync_cache.call}/" ".")
75
76
  end
76
77
 
77
78
  desc "Stage, rsync and copy to the build path."
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Rsync
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andri Möll