puppet-repl 0.0.5 → 0.0.6
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/.travis.yml +8 -3
- data/Gemfile +1 -4
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/puppet-repl/support.rb +1 -2
- data/lib/version.rb +1 -1
- data/puppet-repl.gemspec +2 -2
- data/spec/puppet-repl_spec.rb +6 -5
- data/spec/spec_helper.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 157dfb5c0e9d81188f376d8baa9c8e365e76dbb8
|
4
|
+
data.tar.gz: 58ccca9e95a7033ea5bd621c93c299a69cf6fc74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c32ed3f424316cca76ed22f856162e7b942b2528fb38f8b9690067e5cf78b21b91da5bebb7e00b5c12b285002ff74ea559307413cc4d666c8c2b66de591de66
|
7
|
+
data.tar.gz: 93d04ab8eb1cab1706098a9fcb2782409a413f61782099e7efbfdf3e24922fb40d52158069ea3f69d77bb8e4e145acd37de7e202cd986b875f9a03fc9dd30b9c
|
data/.travis.yml
CHANGED
@@ -4,9 +4,9 @@ install: "bundle install --without development"
|
|
4
4
|
before_script: "bundle exec puppet module install puppetlabs-stdlib"
|
5
5
|
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
|
6
6
|
rvm:
|
7
|
-
- 1.9.3
|
8
|
-
- 2.0.0
|
9
|
-
- 2.2.1
|
7
|
+
- 1.9.3
|
8
|
+
- 2.0.0
|
9
|
+
- 2.2.1
|
10
10
|
env:
|
11
11
|
matrix:
|
12
12
|
- PUPPET_GEM_VERSION="~> 3.8"
|
@@ -15,3 +15,8 @@ env:
|
|
15
15
|
- PUPPET_GEM_VERSION="~> 4.4"
|
16
16
|
notifications:
|
17
17
|
email: corey@logicminds.biz
|
18
|
+
|
19
|
+
matrix:
|
20
|
+
exclude:
|
21
|
+
- rvm: 2.2.1
|
22
|
+
env: PUPPET_GEM_VERSION="~> 3.8"
|
data/Gemfile
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem 'puppet', ">= 3.8"
|
2
|
+
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || ">= 3.8"
|
6
3
|
gem 'facterdb'
|
7
4
|
# Add dependencies to develop your gem here.
|
8
5
|
# Include everything needed to run rake, tests, features, etc.
|
data/README.md
CHANGED
@@ -100,8 +100,8 @@ You can reset the parser by running `reset` within the repl without having to ex
|
|
100
100
|
|
101
101
|
## Setting the puppet log level
|
102
102
|
If you want to see what puppet is doing behind the scenes you can set the log level
|
103
|
-
via `:set loglevel debug`. Valid log levels are `debug`, `info`, `
|
104
|
-
levels defined in puppet
|
103
|
+
via `:set loglevel debug`. Valid log levels are `debug`, `info`, `warning` and other
|
104
|
+
levels defined in puppet [config reference](https://docs.puppetlabs.com/puppet/4.4/reference/configuration.html#loglevel) .
|
105
105
|
|
106
106
|
```
|
107
107
|
>> hiera('value')
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/puppet-repl/support.rb
CHANGED
@@ -7,7 +7,7 @@ module PuppetRepl
|
|
7
7
|
# returns an array of module directories
|
8
8
|
def module_dirs
|
9
9
|
dirs = []
|
10
|
-
dirs << File.join(Puppet[:environmentpath],puppet_env_name,'modules')
|
10
|
+
dirs << File.join(Puppet[:environmentpath],puppet_env_name,'modules') unless Puppet[:environmentpath].empty?
|
11
11
|
dirs << Puppet.settings[:basemodulepath].split(':')
|
12
12
|
dirs.flatten
|
13
13
|
end
|
@@ -76,7 +76,6 @@ module PuppetRepl
|
|
76
76
|
|
77
77
|
# returns a future parser for evaluating code
|
78
78
|
def parser
|
79
|
-
Puppet::Parser::ParserFactory.evaluating_parser
|
80
79
|
@parser || ::Puppet::Pops::Parser::EvaluatingParser.new
|
81
80
|
end
|
82
81
|
|
data/lib/version.rb
CHANGED
data/puppet-repl.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "puppet-repl"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Corey Osman"]
|
12
|
-
s.date = "2016-03-
|
12
|
+
s.date = "2016-03-30"
|
13
13
|
s.description = "A interactive command line tool for evaluating the puppet language"
|
14
14
|
s.email = "corey@nwops.io"
|
15
15
|
s.executables = ["prepl"]
|
data/spec/puppet-repl_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "PuppetRepl" do
|
4
|
+
|
4
5
|
let(:resource) do
|
5
6
|
"service{'httpd': ensure => running}"
|
6
7
|
end
|
@@ -14,7 +15,7 @@ describe "PuppetRepl" do
|
|
14
15
|
'help'
|
15
16
|
end
|
16
17
|
it 'can show the help screen' do
|
17
|
-
repl_output =
|
18
|
+
repl_output = /Ruby Version: #{RUBY_VERSION}\nPuppet Version: \d.\d.\d\nPuppet Repl Version: \d.\d.\d\nCreated by: NWOps <corey@nwops.io>\nType \"exit\", \"functions\", \"facts\", \"reset\", \"help\" for more information.\n\n/
|
18
19
|
expect{repl.handle_input(input)}.to output(repl_output).to_stdout
|
19
20
|
end
|
20
21
|
end
|
@@ -98,7 +99,7 @@ describe "PuppetRepl" do
|
|
98
99
|
":set loglevel debug"
|
99
100
|
end
|
100
101
|
it 'should set the loglevel' do
|
101
|
-
output =
|
102
|
+
output = /loglevel debug is set/
|
102
103
|
expect{repl.handle_input(input)}.to output(output).to_stdout
|
103
104
|
expect(Puppet::Util::Log.level).to eq(:debug)
|
104
105
|
expect(Puppet::Util::Log.destinations[:console].name).to eq(:console)
|
@@ -109,13 +110,13 @@ describe "PuppetRepl" do
|
|
109
110
|
let(:input) do
|
110
111
|
"md5('hello')"
|
111
112
|
end
|
112
|
-
it '
|
113
|
+
it 'execute md5' do
|
113
114
|
sum = " => 5d41402abc4b2a76b9719d911017c592\n"
|
114
115
|
expect{repl.handle_input(input)}.to output(sum).to_stdout
|
115
116
|
end
|
116
|
-
it '
|
117
|
+
it 'execute swapcase' do
|
117
118
|
output = " => HELLO\n"
|
118
|
-
expect{repl.handle_input("swapcase(hello)")}.to output(output).to_stdout
|
119
|
+
expect{repl.handle_input("swapcase('hello')")}.to output(output).to_stdout
|
119
120
|
end
|
120
121
|
|
121
122
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -25,6 +25,16 @@ require 'puppet-repl'
|
|
25
25
|
# in ./support/ and its subdirectories.
|
26
26
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
27
27
|
|
28
|
+
def stdlib_path
|
29
|
+
File.join(Puppet[:basemodulepath].split(':').first, 'stdlib')
|
30
|
+
end
|
31
|
+
|
32
|
+
# def install_stdlib
|
33
|
+
# `bundle exec puppet module install puppetlabs/stdlib` unless File.exists?(stdlib_path)
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# install_stdlib
|
37
|
+
|
28
38
|
RSpec.configure do |config|
|
29
39
|
|
30
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-repl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Osman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet
|