capistrano-linked-files 1.1.1 → 1.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 916d92a5240d8b9e953d3e4e103b757e3ef016d9
4
- data.tar.gz: 2cf64fa945301e308ad90b51c874c27557cad54f
3
+ metadata.gz: f4d7dbeb4582c6068262dd26897a73cfec876eaa
4
+ data.tar.gz: f7cab7b83d9b6fac41211d7173d0751d188a7629
5
5
  SHA512:
6
- metadata.gz: 2364464bb04c92f69151497030c67401f913b634d27abb2b6ca6a3474cd38a327ec3f9d313abb0310a4165de44cef1230df0fe0549eb235fe111505b4cfd4753
7
- data.tar.gz: d5a71ce90ecf92dbe23ac60b351a37d8c76cef79497354e3116f418e11c2a8db8a7c8eb9a8e65e4c9b51fdf23b6ec11411e3d37fae510f34762798bbdf2ab9d5
6
+ metadata.gz: 2aa6307cd1b4f725fafd011de1fa690485574e228f46d20725d90cb9b128ba2da25c580031631523b9c42aee20f1b9f5acbfe3e8ee933ee3929792d6c0d28391
7
+ data.tar.gz: 184d4fb8ecaccaab37772704639a37c0b14084ef9ec301a55323a931cce8e85f4f804f7208be080a88c6483876b04e22ff1489e5f63647f34bc2205459c1b07f
@@ -0,0 +1,6 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+
5
+ exclude_paths:
6
+ - test/**
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -0,0 +1,6 @@
1
+ Style/Documentation:
2
+ Enabled: false
3
+
4
+ Style/FileName:
5
+ Exclude:
6
+ - 'lib/capistrano-linked-files.rb'
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - '2.0.0'
5
+ - '2.2.2'
6
+
7
+ addons:
8
+ code_climate:
9
+ repo_token: 2f28c7bbbdb2faf4563766992a47561e682838bc1bcc8fba5e7233cb95234459
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 1.2.0 (2016-06-25)
6
+ * **Drop support for Ruby 1.9.3:** The latest version of Capistrano, 3.5, does no longer work with Ruby 1.9.3
7
+ * Upload files and directories to all roles by default, or roles specified by the user
8
+ * Added simple test
9
+
10
+ ## 1.1.1 (2015-05-14)
11
+ * Default to empty array if `:linked*` doesn't exist
12
+
13
+ ## 1.1.0 (2015-03-10)
14
+ * Added tasks to just upload files or directories
15
+
16
+ ## 1.0.0 (2014-07-28)
17
+ * Initial release
@@ -0,0 +1,63 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-linked-files (1.2.0)
5
+ capistrano (~> 3.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ airbrussh (1.0.2)
11
+ sshkit (>= 1.6.1, != 1.7.0)
12
+ ast (2.3.0)
13
+ capistrano (3.5.0)
14
+ airbrussh (>= 1.0.0)
15
+ capistrano-harrow
16
+ i18n
17
+ rake (>= 10.0.0)
18
+ sshkit (>= 1.9.0)
19
+ capistrano-harrow (0.5.2)
20
+ codeclimate-test-reporter (0.5.2)
21
+ simplecov (>= 0.7.1, < 1.0.0)
22
+ docile (1.1.5)
23
+ i18n (0.7.0)
24
+ json (1.8.3)
25
+ minitest (5.9.0)
26
+ net-scp (1.2.1)
27
+ net-ssh (>= 2.6.5)
28
+ net-ssh (3.2.0)
29
+ parser (2.3.1.2)
30
+ ast (~> 2.2)
31
+ powerpack (0.1.1)
32
+ rainbow (2.1.0)
33
+ rake (11.2.2)
34
+ rubocop (0.40.0)
35
+ parser (>= 2.3.1.0, < 3.0)
36
+ powerpack (~> 0.1)
37
+ rainbow (>= 1.99.1, < 3.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (~> 1.0, >= 1.0.1)
40
+ ruby-progressbar (1.8.1)
41
+ simplecov (0.11.2)
42
+ docile (~> 1.1.0)
43
+ json (~> 1.8)
44
+ simplecov-html (~> 0.10.0)
45
+ simplecov-html (0.10.0)
46
+ sshkit (1.11.1)
47
+ net-scp (>= 1.1.2)
48
+ net-ssh (>= 2.8.0)
49
+ unicode-display_width (1.1.0)
50
+
51
+ PLATFORMS
52
+ ruby
53
+
54
+ DEPENDENCIES
55
+ bundler (~> 1.12)
56
+ capistrano-linked-files!
57
+ codeclimate-test-reporter (~> 0.5)
58
+ minitest (~> 5.9)
59
+ rake (~> 11.2)
60
+ rubocop (~> 0.40)
61
+
62
+ BUNDLED WITH
63
+ 1.12.5
data/README.md CHANGED
@@ -1,10 +1,25 @@
1
1
  # capistrano-linked-files
2
2
 
3
- This gem provides Capistrano 3.1 reciepes to upload your linked files and directories. It's quite useful for files such as `config/database.yml` and `config/secrets.yml`, which are usually ignored (at least they should be) from version control systems.
4
-
5
- Linked files and directories are placed in the `shared` directory on your remote servers and kept between deployments. After a new deployment, a symlink is created from the `shared` directory to the `current` directory.
6
-
7
- Inspiration was found in damselem's [capistrano-shared-files](https://github.com/damselem/capistrano-shared-file), but capistrano-linked-files uses the "built in" Capistrano configuration variables `linked_files` and `linked_dirs` instead of custom ones. This way it's not necessary to specify your linked files twice.
3
+ [![Gem Version](https://img.shields.io/gem/v/capistrano-linked-files.svg?style=flat-square)](http://badge.fury.io/rb/capistrano-linked-files)
4
+ [![Build Status](https://img.shields.io/travis/runar/capistrano-linked-files/master.svg?style=flat-square)](https://travis-ci.org/runar/capistrano-linked-files)
5
+ [![Code Climate](https://img.shields.io/codeclimate/github/runar/capistrano-linked-files.svg?style=flat-square)](https://codeclimate.com/github/runar/capistrano-linked-files)
6
+ [![Coverage Status](https://img.shields.io/codeclimate/coverage/github/runar/capistrano-linked-files.svg?style=flat-square)](https://codeclimate.com/github/runar/capistrano-linked-files/coverage)
7
+ [![Dependency Status](https://img.shields.io/gemnasium/runar/capistrano-linked-files.svg?style=flat-square)](https://gemnasium.com/runar/capistrano-linked-files)
8
+
9
+ This gem provides Capistrano 3.1 reciepes to upload your linked files and
10
+ directories. It's quite useful for files such as `config/database.yml` and
11
+ `config/secrets.yml`, which are usually ignored (at least they should be) from
12
+ version control systems.
13
+
14
+ Linked files and directories are placed in the `shared` directory on your
15
+ remote servers and kept between deployments. After a new deployment, a symlink
16
+ is created from the `shared` directory to the `current` directory.
17
+
18
+ Inspiration was found in damselem's
19
+ [capistrano-shared-files](https://github.com/damselem/capistrano-shared-file),
20
+ but capistrano-linked-files uses the "built in" Capistrano configuration
21
+ variables `linked_files` and `linked_dirs` instead of custom ones. This way
22
+ it's not necessary to specify your linked files twice.
8
23
 
9
24
  ## Installation
10
25
 
@@ -28,7 +43,8 @@ Add the gem to your `Capfile`:
28
43
  require 'capistrano/linked_files'
29
44
  ```
30
45
 
31
- In `deploy.rb`, list the files and directories you'd like to keep between deployments:
46
+ In `deploy.rb`, list the files and directories you'd like to keep between
47
+ deployments:
32
48
 
33
49
  ```ruby
34
50
  set :linked_files, %w(config/database.yml config/secrets.yml)
@@ -41,6 +57,17 @@ Then run the task:
41
57
  $ bundle exec cap <STAGE> linked_files:upload
42
58
  ```
43
59
 
60
+ By default, the listed files and directories are uploaded to all server roles.
61
+ You may change this by doing the following:
62
+
63
+ ```ruby
64
+ # Set upload roles using symbols
65
+ set :upload_roles, :all
66
+
67
+ # Set upload roles using arrays
68
+ set :upload_roles, %w(web app)
69
+ ```
70
+
44
71
  If you only want to upload files or dirs, then run the tasks accordingly:
45
72
 
46
73
  ```
@@ -48,7 +75,8 @@ $ bundle exec cap <STAGE> linked_files:upload_files
48
75
  $ bundle exec cap <STAGE> linked_files:upload_dirs
49
76
  ```
50
77
 
51
- To automatically upload linked files and directories after a new deployment, add the following to your `deploy.rb`:
78
+ To automatically upload linked files and directories after a new deployment,
79
+ add the following to your `deploy.rb`:
52
80
 
53
81
  ```ruby
54
82
  # Uploading both linked_files and dirs
@@ -71,5 +99,7 @@ before :finishing, 'linked_files:upload_dirs'
71
99
 
72
100
  ## License
73
101
 
74
- The capistrano-linked-files plugin is free software released under the MIT License.
75
- See [LICENSE](https://github.com/runar/capistrano-linked-files/blob/master/LICENSE) for details.
102
+ The capistrano-linked-files plugin is free software released under the MIT
103
+ License. See
104
+ [LICENSE](https://github.com/runar/capistrano-linked-files/blob/master/LICENSE)
105
+ for details.
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'test'
6
+ t.pattern = 'test/*_test.rb'
7
+ t.warning = false
8
+ end
9
+
10
+ task default: :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.2.0
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'capistrano-linked-files'
6
- s.version = '1.1.1'
6
+ s.version = File.read('VERSION').strip
7
7
  s.summary = 'Upload linked files and directories.'
8
8
  s.description = 'Adds tasks to upload your linked files and directories. '
9
9
 
@@ -12,11 +12,15 @@ Gem::Specification.new do |s|
12
12
  s.homepage = 'https://github.com/runar/capistrano-linked-files'
13
13
  s.license = 'MIT'
14
14
 
15
- s.files = `git ls-files`.split($/)
15
+ s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
16
+ s.test_files = s.files.grep(/^test/)
16
17
  s.require_paths = ['lib']
17
18
 
18
19
  s.add_dependency 'capistrano', '~> 3.1'
19
20
 
20
- s.add_development_dependency 'bundler'
21
- s.add_development_dependency 'rake'
21
+ s.add_development_dependency 'bundler', '~> 1.12'
22
+ s.add_development_dependency 'codeclimate-test-reporter', '~> 0.5'
23
+ s.add_development_dependency 'minitest', '~> 5.9'
24
+ s.add_development_dependency 'rake', '~> 11.2'
25
+ s.add_development_dependency 'rubocop', '~> 0.40'
22
26
  end
@@ -1,5 +1,11 @@
1
- namespace :linked_files do
1
+ namespace :load do
2
+ task :defaults do
3
+ set :upload_roles, :all
4
+ set :upload_servers, -> { release_roles(fetch(:upload_roles)) }
5
+ end
6
+ end
2
7
 
8
+ namespace :linked_files do
3
9
  desc 'Upload linked files and directories'
4
10
  task :upload do
5
11
  invoke 'linked_files:upload:files'
@@ -13,9 +19,9 @@ namespace :linked_files do
13
19
  end
14
20
 
15
21
  namespace :upload do
16
-
17
22
  task :files do
18
- on roles :web do
23
+ on fetch(:upload_servers) do
24
+ info "Uploading files to: #{fetch(:upload_roles)}"
19
25
  fetch(:linked_files, []).each do |file|
20
26
  upload! file, "#{shared_path}/#{file}"
21
27
  end
@@ -23,15 +29,14 @@ namespace :linked_files do
23
29
  end
24
30
 
25
31
  task :dirs do
26
- on roles :web do
32
+ on fetch(:upload_servers) do
33
+ info "Uploading directories to: #{fetch(:upload_roles)}"
27
34
  fetch(:linked_dirs, []).each do |dir|
28
35
  upload! dir, "#{shared_path}/", recursive: true
29
36
  end
30
37
  end
31
38
  end
32
-
33
39
  end
34
40
 
35
41
  before 'linked_files:upload', 'deploy:check:make_linked_dirs'
36
-
37
42
  end
@@ -0,0 +1,7 @@
1
+ require_relative 'test_helper'
2
+
3
+ class LinkedFilesTest < UnitTest
4
+ def test_that_default_role_is_set
5
+ assert_equal :all, fetch(:upload_roles)
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ require 'codeclimate-test-reporter'
2
+ CodeClimate::TestReporter.start
3
+
4
+ require 'rubygems'
5
+ require 'bundler/setup'
6
+ require 'capistrano/all'
7
+ require 'capistrano/setup'
8
+ require 'minitest/autorun'
9
+ require 'rake'
10
+
11
+ class UnitTest < Minitest::Test
12
+ def setup
13
+ set :upload_roles, :all
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-linked-files
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Runar Skaare Tveiten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2016-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -28,30 +28,72 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.12'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '1.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: codeclimate-test-reporter
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.9'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '5.9'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: rake
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
- - - ">="
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '11.2'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '11.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
46
88
  - !ruby/object:Gem::Version
47
- version: '0'
89
+ version: '0.40'
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
- - - ">="
94
+ - - "~>"
53
95
  - !ruby/object:Gem::Version
54
- version: '0'
96
+ version: '0.40'
55
97
  description: 'Adds tasks to upload your linked files and directories. '
56
98
  email:
57
99
  - runar@tveiten.io
@@ -59,15 +101,23 @@ executables: []
59
101
  extensions: []
60
102
  extra_rdoc_files: []
61
103
  files:
104
+ - ".codeclimate.yml"
62
105
  - ".gitignore"
106
+ - ".rubocop.yml"
107
+ - ".travis.yml"
108
+ - CHANGELOG.md
63
109
  - Gemfile
110
+ - Gemfile.lock
64
111
  - LICENSE
65
112
  - README.md
66
113
  - Rakefile
114
+ - VERSION
67
115
  - capistrano-linked-files.gemspec
68
116
  - lib/capistrano-linked-files.rb
69
117
  - lib/capistrano/linked_files.rb
70
118
  - lib/capistrano/tasks/linked_files.rake
119
+ - test/linked_files_test.rb
120
+ - test/test_helper.rb
71
121
  homepage: https://github.com/runar/capistrano-linked-files
72
122
  licenses:
73
123
  - MIT
@@ -88,8 +138,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
138
  version: '0'
89
139
  requirements: []
90
140
  rubyforge_project:
91
- rubygems_version: 2.2.2
141
+ rubygems_version: 2.4.5
92
142
  signing_key:
93
143
  specification_version: 4
94
144
  summary: Upload linked files and directories.
95
- test_files: []
145
+ test_files:
146
+ - test/linked_files_test.rb
147
+ - test/test_helper.rb