capistrano-templ 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b091b10cceecccba5b2c8cee3180e0f6b7dea8ca
4
+ data.tar.gz: 9dabfa2ad8a4b1574490f7752e39aa4658b30f31
5
+ SHA512:
6
+ metadata.gz: feb603b06f1729a353bd197b7f2ae3a44159bed60e4d26aeaaa2eaea3a4fb6731d84a54064935bb962d90b5c6fa4b8152d9d8e2cbed44f07b9a741774ec6d5b3
7
+ data.tar.gz: a6493ba2d4579d3e5cbf2552c6973b8ea14ae587dea84bb9e67cc10973ab22feb7b56781dd77ee1d473819e3df01f2c5a9bcb292aab6d5d0fbd47a97f30c7d89
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-templ.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 m4rCsi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,39 @@
1
+ # Capistrano::Templ
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/templ`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-templ'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install capistrano-templ
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( https://github.com/[my-github-username]/capistrano-templ/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create a new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,22 @@
1
+ lib = File.expand_path('../lib',__FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'capistrano/templ/version'
4
+
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'capistrano-templ'
8
+ s.version = Capistrano::Templ::VERSION
9
+ s.summary = "Capistrano template plugin"
10
+ s.description = "Capistrano template plugin"
11
+ s.authors = ["Marc Siegenthaler"]
12
+ s.email = 'shin@marcsi.ch'
13
+ s.files = `git ls-files`.split($/)
14
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
15
+ s.require_paths = ["lib"]
16
+ s.homepage =
17
+ 'https://github.com/m4rCsi/capistrano-templ'
18
+ s.license = 'MIT'
19
+
20
+ s.required_ruby_version = '>= 1.9.3'
21
+ s.add_dependency 'capistrano', '~> 3.4'
22
+ end
File without changes
@@ -0,0 +1 @@
1
+ require 'capistrano/templ/dsl'
@@ -0,0 +1,3 @@
1
+ require 'capistrano/templ/dsl/templ.rb'
2
+
3
+ SSHKit::Backend::Netssh.send(:include,Capistrano::Templ::DSL)
@@ -0,0 +1,19 @@
1
+ require 'erb'
2
+ require 'ostruct'
3
+
4
+ module Capistrano
5
+ module Templ
6
+ module DSL
7
+ def erb(template, vars)
8
+ ERB.new(File.read(template)).result(OpenStruct.new(vars).instance_eval { binding })
9
+ end
10
+
11
+ def template(template,to,vars ={})
12
+ res = erb(template,vars)
13
+ tmp_file = "/tmp/cap_erb_tmp_file"
14
+ upload! StringIO.new(res), tmp_file
15
+ execute :sudo, "mv #{tmp_file} #{to}"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Templ
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-templ
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marc Siegenthaler
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.4'
27
+ description: Capistrano template plugin
28
+ email: shin@marcsi.ch
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - ".gitignore"
34
+ - Gemfile
35
+ - LICENSE
36
+ - README.md
37
+ - Rakefile
38
+ - capistrano-templ.gemspec
39
+ - lib/capistrano-templ.rb
40
+ - lib/capistrano/templ.rb
41
+ - lib/capistrano/templ/dsl.rb
42
+ - lib/capistrano/templ/dsl/templ.rb
43
+ - lib/capistrano/templ/version.rb
44
+ homepage: https://github.com/m4rCsi/capistrano-templ
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.9.3
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.4.5
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Capistrano template plugin
68
+ test_files: []