bosh-plugin-pipeline 0.2.0 → 0.2.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/bosh/plugin_generator.rb +1 -1
- data/lib/bosh/plugin_generator/helpers.rb +1 -1
- data/lib/bosh/plugin_pipeline/version.rb +1 -1
- data/lib/bosh/template_generator/generator.rb +29 -0
- data/spec/plugin_generator/generator_spec.rb +2 -2
- data/spec/plugin_generator_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1dfa91a47b281e12c626490ba08a15b08ac308e
|
4
|
+
data.tar.gz: 78aebf757be7578d10ebe46495588cd7837ba5de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbe52d8a502daa9998f34d13ab658a1bc66aadb4b864bf5f9d49b7bec39ebf34f062ed200570ba26f75e20735f60f3a95ab3b1a35e7cebaa8be37b37f9ec63ee
|
7
|
+
data.tar.gz: 4ad5eb3714fe6cf54251782c40908760018518587cbdf06623dd8c253a0a5de8994a28394051179dfd6030532523938cadd540e42a0da9cb9d20e44d5f9030e0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -35,6 +35,8 @@ To publish your plugin as a gem on [rubygems.org](http://rubygems.org/) see [thi
|
|
35
35
|
|
36
36
|
### Updating BOSH version in your plugin
|
37
37
|
|
38
|
+
This command helps you to have support for uptodate BOSH version. You also may consider to use [gemnasium](https://gemnasium.com/) to keep track of other dependencies.
|
39
|
+
|
38
40
|
```
|
39
41
|
bosh update-bosh-version [path]
|
40
42
|
```
|
@@ -47,7 +49,6 @@ Possible attributes:
|
|
47
49
|
* `--without-commit` - Don't do commit after update
|
48
50
|
* `--without-push` - Don't push updated gem to github and rubygems
|
49
51
|
|
50
|
-
|
51
52
|
## Contributing
|
52
53
|
|
53
54
|
1. Fork it
|
@@ -35,7 +35,7 @@ module Bosh
|
|
35
35
|
context = default_context.merge(options)
|
36
36
|
raise "You need to specify email and author" if context[:email].nil? || context[:author].nil?
|
37
37
|
templates_folder = File.expand_path("../../../../templates", __FILE__)
|
38
|
-
@generator = Bosh::
|
38
|
+
@generator = Bosh::TemplateGenerator::Generator.new(context, source_folder: templates_folder)
|
39
39
|
end
|
40
40
|
|
41
41
|
def generate_files
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'erubis'
|
2
|
+
|
3
|
+
module Bosh
|
4
|
+
module TemplateGenerator
|
5
|
+
class Generator
|
6
|
+
|
7
|
+
attr_accessor :context, :options
|
8
|
+
def initialize(context, options = {})
|
9
|
+
@options = options
|
10
|
+
@context = context
|
11
|
+
end
|
12
|
+
|
13
|
+
def generate(source, target)
|
14
|
+
folder = File.dirname(target)
|
15
|
+
FileUtils.mkdir_p(folder)
|
16
|
+
template = File.read(File.join(source_folder, source))
|
17
|
+
result = Erubis::Eruby.new(template).result(context)
|
18
|
+
File.write(target, result)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def source_folder
|
24
|
+
options[:source_folder] || Dir.pwd
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
describe Bosh::
|
1
|
+
describe Bosh::TemplateGenerator::Generator do
|
2
2
|
let(:context) { { people: ['you', 'me'] } }
|
3
3
|
let(:tmpdir) { Dir.mktmpdir }
|
4
4
|
let(:target) { File.join(tmpdir, 'subfolder-1', 'subfolder-2', 'result.txt') }
|
5
|
-
subject { Bosh::
|
5
|
+
subject { Bosh::TemplateGenerator::Generator.new(context, source_folder: File.expand_path('../../assets', __FILE__)) }
|
6
6
|
after { FileUtils.remove_entry_secure tmpdir }
|
7
7
|
|
8
8
|
describe '#generate' do
|
@@ -66,7 +66,7 @@ CMD
|
|
66
66
|
expect(File).to exist(plugin_folder)
|
67
67
|
end
|
68
68
|
|
69
|
-
it 'creates gem with
|
69
|
+
it 'creates gem with "bosh-" prefix' do
|
70
70
|
gemspec_file = File.join(plugin_folder, 'bosh-magic.gemspec')
|
71
71
|
expect(File).to exist(gemspec_file)
|
72
72
|
expect(File.read(gemspec_file)).to match(/bosh-magic/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-plugin-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Lomov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_cli
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/bosh/plugin_generator/generator.rb
|
203
203
|
- lib/bosh/plugin_generator/helpers.rb
|
204
204
|
- lib/bosh/plugin_pipeline/version.rb
|
205
|
+
- lib/bosh/template_generator/generator.rb
|
205
206
|
- spec/assets/simple-template.txt
|
206
207
|
- spec/plugin_generator/generator_spec.rb
|
207
208
|
- spec/plugin_generator_spec.rb
|