puppet-repl 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 395dca824498b20ef6c0c3fbcdbbd70f77e1b44f
4
- data.tar.gz: a2695e31bf0cdb543fff05c8437af71505ca75a6
3
+ metadata.gz: f4519dc48054ca323c370206dcff4ef6176bf71c
4
+ data.tar.gz: d44b234c9b5c22bfa183485e85f2684985b54899
5
5
  SHA512:
6
- metadata.gz: e69332b0167a1db4d32ad151eb6468e7463ec1ca8bb3deff7d1698226924b665169d52a0fc7add5ff2a38385f2f3dc2264e3a2099b3513d23949f3f05f174d49
7
- data.tar.gz: 05259e58f876fdc50a83711adf9cf7e2c57f0941b41610130a2d89e2be247074a58ff5b33cd70c629caf565756a56b162c3c622a0efdf3eca7ce923be95fef2f
6
+ metadata.gz: d62feb4b6134fdf6f791432760497f6202a0607a71fbb7f3bde02655f7914cac5f6baf1177f60f13db740973e7c5ed1c1eff3d9b44c8f84778439f553967eb14
7
+ data.tar.gz: fdb5b9ea4d7b7e8327fc84028308dead5a1a71fb04ebf88db2a7bd7f92b7715f5003e48e091f12886a500d47aa2614717c6712421c5a6e19a45d3771a2133445
data/CHANGELOG.md CHANGED
@@ -1,26 +1,36 @@
1
+ ## 0.2.1
2
+ * Fixes #2 - adds support for multiline input
3
+
1
4
  ## 0.2.0
2
5
  * Fixes #19 - lock down dependency versions
3
6
  * fixes #18 - add ability to filter out functions based on namespace
4
7
  * fixes #15 - node classes return error
5
8
  * fixes #16 - use auto complete on functions and variables
6
9
  * Fixes #14 - add functionality to set node object from remote source
10
+ * adds support for server_facts
7
11
  * fixes other minor bugs found along the way
8
12
  * adds ability to list classification parameters from ENC
13
+
9
14
  ## 0.1.1
10
15
  * adds ability to load files or urls
16
+
11
17
  ## 0.1.0
12
18
  * ensure the title of classes contains quotes
13
19
  * adds support to import a file or import from stdin
14
20
  * added additional ap support for puppet::pops::types
15
21
  * adds ability to print resources and classes
16
22
  * adds the ability to pass in a scope
23
+
17
24
  ## 0.0.8
18
25
  * adds ability to list currently loaded classes
19
26
  * adds formatted output using awesome print
20
27
  * adds verbose type output when creating resources
28
+
21
29
  ## 0.0.7
22
30
  * Added ability to list scope variables
31
+
23
32
  ## 0.0.6
24
33
  * Bug fix for puppet 3.8
34
+
25
35
  ## 0.0.5
26
36
  * Added ability to set puppet log level
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -153,11 +153,38 @@ Type "exit", "functions", "vars", "krt", "facts", "resources", "classes",
153
153
  output
154
154
  end
155
155
 
156
+ # tries to determine if the input is going to be a multiline input
157
+ # by reading the parser error message
158
+ def multiline_input?(e)
159
+ case e.message
160
+ when /Syntax error at end of file/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ end
166
+
156
167
  # reads input from stdin, since readline requires a tty
157
168
  # we cannot read from other sources as readline requires a file object
169
+ # we parse the string after each input to determine if the input is a multiline_input
170
+ # entry. If it is multiline we run through the loop again and concatenate the
171
+ # input
158
172
  def read_loop
159
- while buf = Readline.readline(">> ", true)
160
- handle_input(buf)
173
+ line_number = 1
174
+ full_buffer = ''
175
+ while buf = Readline.readline("#{line_number}:>> ", true)
176
+ begin
177
+ line_number = line_number.next
178
+ full_buffer += buf
179
+ parser.parse_string(full_buffer)
180
+ rescue Puppet::ParseErrorWithIssue => e
181
+ if multiline_input?(e)
182
+ out_buffer.print ' '
183
+ next
184
+ end
185
+ end
186
+ handle_input(full_buffer)
187
+ full_buffer = ''
161
188
  end
162
189
  end
163
190
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PuppetRepl
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
data/puppet-repl.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: puppet-repl 0.2.0 ruby lib
5
+ # stub: puppet-repl 0.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "puppet-repl"
9
- s.version = "0.2.0"
9
+ s.version = "0.2.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Corey Osman"]
14
- s.date = "2016-05-17"
14
+ s.date = "2016-05-19"
15
15
  s.description = "A interactive command line tool for evaluating the puppet language"
16
16
  s.email = "corey@nwops.io"
17
17
  s.executables = ["prepl"]
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.2.0
4
+ version: 0.2.1
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-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet