capistrano-lazy-templates 0.0.3 → 0.0.4

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: c8fd047d48e5ef5e2ec31f03e4b4afc1f2b55795
4
- data.tar.gz: 2fc5faa6b19ac51fe1fd07f08f3599e9d7ac361d
3
+ metadata.gz: db3b479a6f061ffb1bcd753f181836fb78de0d9f
4
+ data.tar.gz: 671c138ab9b6d070f22339ba1d7e7ab9835637b9
5
5
  SHA512:
6
- metadata.gz: 0347d01d122fa2203d0ab3590a5cb90c5fe27a8f43107c6e2269ea0c5a3711b8d221d5122676431e5249ad0d8ac34d7bf98971e576e770f5c0383ee3f84852fb
7
- data.tar.gz: 7b92da37e48d51ff3fab2d6bd49f50c7b2ab5b6cd7e33edb53b1206de621cab98c7024a305328be858b0cd09eb9c30ede80953fe39287733b0a032c8e8841c44
6
+ metadata.gz: 54a267ccc284fc78ac49e4d26660e6c5eaa43589f15e76cc3fe7fe55f265b3d83dbe091242c3877a48acde86d5e25669fe63cfd2ae78d48e84ad5d42eb972df5
7
+ data.tar.gz: c3b51aea7a6b1f976d7132a1ee3425882ace92eb802a1efd17c60a2623824119477a5535ded98647f1db6bbf8b5bac1d69aeda500933d62ba6635fe0efffaf10
data/README.md CHANGED
@@ -19,7 +19,7 @@ Add it to the gemfile, better suits on the development or deployment group
19
19
 
20
20
  Once installed uning bundler an after creating a deploy recipe with capistrano, edit the Capfile and add a line to load gem's tasks
21
21
 
22
- require 'capistrano-lazy-templates'
22
+ require 'capistrano/lazy-templates'
23
23
 
24
24
  ## Configuration
25
25
 
@@ -1,10 +1,10 @@
1
1
  lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'capistrano-lazy-templates/version'
3
+ require 'capistrano/lazy-templates/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'capistrano-lazy-templates'
7
- s.version = CapistranoLazyTemplates::VERSION
7
+ s.version = Capistrano::LazyTemplates::VERSION
8
8
  s.authors = ['Carlos Peñas']
9
9
  s.email = ['theistian@gmx.com']
10
10
  s.date = Time.now.utc.strftime('%Y-%m-%d')
@@ -0,0 +1,33 @@
1
+ module Capistrano
2
+ module LazyTemplates
3
+ module Helpers
4
+
5
+ def get_remote_file(file,local_base) ## Or dir!
6
+ if File::directory?(local_base)
7
+ file = file.chomp
8
+ if test("[ -d #{file} ]")
9
+ if test("[ -r #{file} ]")
10
+ file = file + "/" unless file =~ /\/$/
11
+ contents = capture :ls, "-1 #{file}"
12
+ contents.each_line do |sub_file|
13
+ get_remote_file(file + sub_file ,local_base)
14
+ end
15
+ end
16
+ else
17
+ if test("[ -r #{file} ]")
18
+ if test("[ -f #{file} ]")
19
+ FileUtils::mkdir_p(File::dirname(local_base + file))
20
+ download! file ,local_base + file
21
+ else
22
+ warn "Cannot read regular file: #{file}"
23
+ end
24
+ end
25
+ end
26
+ else
27
+ error "#{local_base} must exists before pick remote server files"
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module LazyTemplates
3
+ VERSION = '0.0.4'
4
+ end
5
+ end
@@ -1,28 +1,6 @@
1
- def get_remote_file(file,local_base) ## Or dir!
2
- if File::directory?(local_base)
3
- file = file.chomp
4
- if test("[ -d #{file} ]")
5
- if test("[ -r #{file} ]")
6
- file = file + "/" unless file =~ /\/$/
7
- contents = capture :ls, "-1 #{file}"
8
- contents.each_line do |sub_file|
9
- get_remote_file(file + sub_file ,local_base)
10
- end
11
- end
12
- else
13
- if test("[ -r #{file} ]")
14
- if test("[ -f #{file} ]")
15
- FileUtils::mkdir_p(File::dirname(local_base + file))
16
- download! file ,local_base + file
17
- else
18
- warn "Cannot read regular file: #{file}"
19
- end
20
- end
21
- end
22
- else
23
- error "#{local_base} must exists before pick remote server files"
24
- end
25
- end
1
+ require 'capistrano/lazy-templates/helpers'
2
+
3
+ include Capistrano::LazyTemplates::Helpers
26
4
 
27
5
  namespace :load do
28
6
  task :defaults do
@@ -1,5 +1,5 @@
1
- require 'capistrano-lazy-templates/version'
1
+ require 'capistrano/lazy-templates/version'
2
2
 
3
- load File.expand_path("../capistrano-lazy-templates/tasks/capistrano-lazy-templates.rake", __FILE__)
3
+ load File.expand_path("../capistrano/tasks/lazy-templates.rake", __FILE__)
4
4
 
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-lazy-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Peñas
@@ -42,8 +42,9 @@ files:
42
42
  - README.md
43
43
  - capistrano-lazy-templates.gemspec
44
44
  - lib/capistrano-lazy-templates.rb
45
- - lib/capistrano-lazy-templates/tasks/capistrano-lazy-templates.rake
46
- - lib/capistrano-lazy-templates/version.rb
45
+ - lib/capistrano/lazy-templates/helpers.rb
46
+ - lib/capistrano/lazy-templates/version.rb
47
+ - lib/capistrano/tasks/lazy-templates.rake
47
48
  homepage: https://github.com/theist/capistrano-lazy-templates
48
49
  licenses:
49
50
  - GPLv3
@@ -1,3 +0,0 @@
1
- module CapistranoLazyTemplates
2
- VERSION = '0.0.3'
3
- end