prospectus_puppet 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecc09b5a3505309e2a4fde002232f2f72f51816b
4
+ data.tar.gz: 745070d93fa020d2f0048e996ad1520214091537
5
+ SHA512:
6
+ metadata.gz: fd51266690798f930b8f4a5390e83156573a0ea56528f5f3aa7a652637bbb1fd35f46da5d05d6a0912ff8b5d086766230eff34e41cbfc9ddd4604f7171fa1aea
7
+ data.tar.gz: cbddcad7c6919a34e0cab7034b7bbca698256fc48f9659ecf6c07d60a1d350e838e71e827d01776d1a457a719eb44b8e6bb5c3e8b2c8ae6f05e6bc3c7c4b87f6
data/.circle-ruby ADDED
@@ -0,0 +1,3 @@
1
+ 2.4.1
2
+ 2.3.4
3
+ 2.2.7
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ pkg/*.gem
2
+ coverage/
3
+ .coveralls.yml
4
+ .bundle
5
+ Gemfile.lock
data/.prospectus ADDED
@@ -0,0 +1,11 @@
1
+ item do
2
+ expected do
3
+ static
4
+ set 'green'
5
+ end
6
+
7
+ actual do
8
+ gemnasium
9
+ slug 'halyard/prospectus_puppet'
10
+ end
11
+ end
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format Fuubar
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Encoding:
2
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Les Aker
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.
22
+
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ prospectus_puppet
2
+ =========
3
+
4
+ [![Gem Version](https://img.shields.io/gem/v/prospectus_puppet.svg)](https://rubygems.org/gems/prospectus_puppet)
5
+ [![Dependency Status](https://img.shields.io/gemnasium/akerl/prospectus_puppet.svg)](https://gemnasium.com/akerl/prospectus_puppet)
6
+ [![Build Status](https://img.shields.io/circleci/project/akerl/prospectus_puppet.svg)](https://circleci.com/gh/akerl/prospectus_puppet)
7
+ [![Coverage Status](https://img.shields.io/codecov/c/github/akerl/prospectus_puppet.svg)](https://codecov.io/github/akerl/prospectus_puppet)
8
+ [![Code Quality](https://img.shields.io/codacy/c5623564a4034ece993510d28edb19de.svg)](https://www.codacy.com/app/akerl/prospectus_puppet)
9
+ [![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
10
+
11
+ [Prospectus](https://github.com/akerl/prospectus) helpers for checking puppet build status
12
+
13
+ ## Usage
14
+
15
+ Add the following 2 lines to the .prospectus:
16
+
17
+ ```
18
+ ## Add this at the top
19
+ Prospectus.extra_dep('file', 'prospectus_puppet')
20
+
21
+ ## Add this inside your item that has a build
22
+ extend ProspectusPuppet::Deps
23
+ ```
24
+
25
+ ## Installation
26
+
27
+ gem install prospectus_puppet
28
+
29
+ ## License
30
+
31
+ prospectus_puppet is released under the MIT License. See the bundled LICENSE file for details.
32
+
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ desc 'Run tests'
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ desc 'Run Rubocop on the gem'
9
+ RuboCop::RakeTask.new(:rubocop) do |task|
10
+ task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
11
+ task.fail_on_error = true
12
+ end
13
+
14
+ task default: [:spec, :rubocop, :build, :install]
data/circle.yml ADDED
@@ -0,0 +1,6 @@
1
+ dependencies:
2
+ override:
3
+ - 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done'
4
+ test:
5
+ override:
6
+ - 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done'
@@ -0,0 +1,70 @@
1
+ require 'json'
2
+
3
+ module ProspectusPuppet
4
+ DEP_REGEX = /^(\d+\.\d+)\.\d+$/
5
+ DEP_FILTER = /^\d+\.\d+.\d+$/
6
+
7
+ ##
8
+ # Helper for automatically adding Puppet deps
9
+ module Deps
10
+ def extended(other) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
11
+ dep_list = parse_deps
12
+
13
+ other.deps do
14
+ dep_list.each do |x|
15
+ item do
16
+ name x[:name]
17
+
18
+ expected do
19
+ github_tag
20
+ repo x[:slug]
21
+ regex(DEP_REGEX)
22
+ filter(DEP_FILTER)
23
+ end
24
+
25
+ actual do
26
+ static
27
+ set x[:version]
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def parse_deps
37
+ raw_deps.map do |dep|
38
+ {
39
+ name: parse_name(dep),
40
+ slug: parse_slug(dep),
41
+ version: parse_version(dep)
42
+ }
43
+ end
44
+ end
45
+
46
+ def parse_version(dep)
47
+ dep['version_requirement'].sub(/\.x/, '')
48
+ end
49
+
50
+ def parse_slug(dep)
51
+ parse_org(dep) + '/' + parse_name(dep)
52
+ end
53
+
54
+ def parse_name(dep)
55
+ parse_prefix(dep) + '-' + dep['name'].split('/').last
56
+ end
57
+
58
+ def parse_prefix(dep)
59
+ parse_org(dep) == 'puppetlabs' ? 'puppetlabs' : 'puppet'
60
+ end
61
+
62
+ def parse_org(dep)
63
+ dep['name'].split('/').first
64
+ end
65
+
66
+ def raw_deps
67
+ @raw_deps ||= JSON.parse(File.read('metadata.json'))['dependencies']
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'prospectus_puppet'
3
+ s.version = '0.0.1'
4
+ s.date = Time.now.strftime('%Y-%m-%d')
5
+
6
+ s.summary = 'Prospectus helpers for puppet'
7
+ s.description = "Prospectus helpers for puppet"
8
+ s.authors = ['Les Aker']
9
+ s.email = 'me@lesaker.org'
10
+ s.homepage = 'https://github.com/amylum/prospectus_puppet'
11
+ s.license = 'MIT'
12
+
13
+ s.files = `git ls-files`.split
14
+ s.test_files = `git ls-files spec/*`.split
15
+
16
+ s.add_dependency 'prospectus', '~> 0.2.0'
17
+
18
+ s.add_development_dependency 'rubocop', '~> 0.49.0'
19
+ s.add_development_dependency 'rake', '~> 12.0.0'
20
+ s.add_development_dependency 'codecov', '~> 0.1.1'
21
+ s.add_development_dependency 'rspec', '~> 3.6.0'
22
+ s.add_development_dependency 'fuubar', '~> 2.2.0'
23
+ end
@@ -0,0 +1 @@
1
+ require 'spec_helper'
@@ -0,0 +1,11 @@
1
+ if ENV['CI'] == 'true'
2
+ require 'simplecov'
3
+ require 'codecov'
4
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
5
+ SimpleCov.start do
6
+ add_filter '/spec/'
7
+ end
8
+ end
9
+
10
+ require 'rspec'
11
+ require 'prospectus_puppet'
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: prospectus_puppet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Les Aker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: prospectus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.49.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.49.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 12.0.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 12.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: codecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.1.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 3.6.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 3.6.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: fuubar
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.2.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.2.0
97
+ description: Prospectus helpers for puppet
98
+ email: me@lesaker.org
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - ".circle-ruby"
104
+ - ".gitignore"
105
+ - ".prospectus"
106
+ - ".rspec"
107
+ - ".rubocop.yml"
108
+ - Gemfile
109
+ - LICENSE
110
+ - README.md
111
+ - Rakefile
112
+ - circle.yml
113
+ - lib/prospectus_puppet.rb
114
+ - prospectus_circleci.gemspec
115
+ - spec/prospectus_puppet_spec.rb
116
+ - spec/spec_helper.rb
117
+ homepage: https://github.com/amylum/prospectus_puppet
118
+ licenses:
119
+ - MIT
120
+ metadata: {}
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.6.11
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: Prospectus helpers for puppet
141
+ test_files:
142
+ - spec/prospectus_puppet_spec.rb
143
+ - spec/spec_helper.rb