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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9089f9dc8c810a6d5da790fb00fbee117b531e9e
4
- data.tar.gz: 281dbf6141bcf7b4a3935e68777fe6f388202cf5
3
+ metadata.gz: d1dfa91a47b281e12c626490ba08a15b08ac308e
4
+ data.tar.gz: 78aebf757be7578d10ebe46495588cd7837ba5de
5
5
  SHA512:
6
- metadata.gz: 956e22c11d04394b5bec843165d4a7c94a33e535710ee21064d48ae5f8a8e6b336505f1cc006eead833496792be32963500a7af7fbc705a5f5525059382f13b2
7
- data.tar.gz: cf2fc8bf2bbb464a271b60bdf594151527092f834e77e097d34a4a5c1921b8608d5085c87a25850664d6a69af3100f71b5bc8bfe9aee5366f88c05616771ac51
6
+ metadata.gz: fbe52d8a502daa9998f34d13ab658a1bc66aadb4b864bf5f9d49b7bec39ebf34f062ed200570ba26f75e20735f60f3a95ab3b1a35e7cebaa8be37b37f9ec63ee
7
+ data.tar.gz: 4ad5eb3714fe6cf54251782c40908760018518587cbdf06623dd8c253a0a5de8994a28394051179dfd6030532523938cadd540e42a0da9cb9d20e44d5f9030e0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bosh-plugin-pipeline (0.1.0)
4
+ bosh-plugin-pipeline (0.2.0)
5
5
  bosh-versions (~> 0.1.1)
6
6
  bosh_cli (>= 1.3098.0)
7
7
  bosh_common (>= 1.3098.0)
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
@@ -7,5 +7,5 @@ module Bosh
7
7
  end
8
8
  end
9
9
 
10
- require "bosh/plugin_generator/generator"
10
+ require "bosh/template_generator/generator"
11
11
  require "bosh/plugin_generator/helpers"
@@ -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::PluginGenerator::Generator.new(context, source_folder: templates_folder)
38
+ @generator = Bosh::TemplateGenerator::Generator.new(context, source_folder: templates_folder)
39
39
  end
40
40
 
41
41
  def generate_files
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module PluginPipeline
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -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::PluginGenerator::Generator do
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::PluginGenerator::Generator.new(context, source_folder: File.expand_path('../../assets', __FILE__)) }
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 'bosh-' prefix' do
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.0
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-09 00:00:00.000000000 Z
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