bosh-manifest-organizer 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1344cdc8cd7ca96d570ba0702cbcc08eb9099d9e
4
+ data.tar.gz: 715c14e752e8e0839841bc9824840ea6caf6228a
5
+ SHA512:
6
+ metadata.gz: 5cf8d5d3a26c32fc7a17ad625a46b9e595d4194a6ee0e65fee0a1465ea8dbe81b8478d3d444d18235ce053792174ff74ec7bfa9be757a964412cf2db45897ff9
7
+ data.tar.gz: 0265541e719dd4fa386b61467f3e671af46c35573d7e811966fcc88dfda30e8494599c51227be9d447fb02e36ab40068d9af9d417e9d19609de56782249fd2bb
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .idea/
11
+ *.iml
12
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bosh-manifest-organizer.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Jean de Klerk
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Bosh::Manifest::Organizer
2
+
3
+ Reorganize your bosh manifests!
4
+
5
+ ## Installation
6
+
7
+ `gem install bosh-manifest-organizer`
8
+
9
+ ## Usage
10
+
11
+ `bosh download manifest some-deployment | bosh-manifest-organizer`
12
+
13
+ ## Development
14
+
15
+ Building:
16
+
17
+ 1. `gem build bosh-manifest-organizer.gemspec`
18
+ 1. `gem install bosh-manifest-organizer-0.1.0.gem`
19
+ 1. `echo "foo: 5" | bosh-manifest-organizer`
20
+
21
+ Testing:
22
+
23
+ 1. `rspec`
24
+
25
+ ## Contributing
26
+
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bosh-manifest-organizer.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bosh/manifest/organizer'
4
+
5
+ Bosh::Manifest::Organizer.organize
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bosh/manifest/organizer/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'bosh-manifest-organizer'
8
+ spec.version = Bosh::Manifest::Organizer::VERSION
9
+ spec.authors = ['Jean de Klerk']
10
+ spec.email = ['jadekler@gmail.com']
11
+
12
+ spec.summary = %q{Organize your bosh manifests!}
13
+ spec.description = %q{Organize your bosh manifests!}
14
+ spec.homepage = "https://github.com/jadekler/git-bosh-manifest-organizer"
15
+ spec.license = 'MIT'
16
+
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
19
+ else
20
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
21
+ end
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ spec.bindir = 'bin'
25
+ spec.executables = ['bosh-manifest-organizer']
26
+ spec.require_paths = ['lib']
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.11'
29
+ spec.add_development_dependency 'rake', '~> 10.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.0'
31
+ end
@@ -0,0 +1,7 @@
1
+ module Bosh
2
+ module Manifest
3
+ module Organizer
4
+ VERSION = '0.2.0'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,36 @@
1
+ require 'bosh/manifest/organizer/version'
2
+ require 'yaml'
3
+
4
+ module Bosh
5
+ module Manifest
6
+ module Organizer
7
+ def self.organize
8
+ str = (STDIN.tty?) ? nil : $stdin.read
9
+
10
+ if str
11
+ puts self.organize_yml str
12
+ else
13
+ raise 'Incorrect usage: cat something.yml | bosh-manifest-organizer'
14
+ end
15
+ end
16
+
17
+ def self.organize_yml(str)
18
+ yml = YAML.load str
19
+
20
+ new_hash = {}
21
+
22
+ if yml.key? 'director_uuid'
23
+ new_hash['director_uuid'] = yml['director_uuid']
24
+ end
25
+
26
+ if yml.key? 'name'
27
+ new_hash['name'] = yml['name']
28
+ end
29
+
30
+ new_hash.merge!(yml)
31
+
32
+ YAML.dump(new_hash)
33
+ end
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bosh-manifest-organizer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Jean de Klerk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Organize your bosh manifests!
56
+ email:
57
+ - jadekler@gmail.com
58
+ executables:
59
+ - bosh-manifest-organizer
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/bosh-manifest-organizer
71
+ - bosh-manifest-organizer.gemspec
72
+ - lib/bosh/manifest/organizer.rb
73
+ - lib/bosh/manifest/organizer/version.rb
74
+ homepage: https://github.com/jadekler/git-bosh-manifest-organizer
75
+ licenses:
76
+ - MIT
77
+ metadata:
78
+ allowed_push_host: https://rubygems.org
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.6
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Organize your bosh manifests!
99
+ test_files: []