-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(MODULES-773) Use string for host_iteration titles in future parser
In the future parser, integers are not allowed as titles. The range() function in stdlib explicitly returns integers when the arguments are digits (even String digits), so they must be cast from integers to strings to use as titles. String + Integer math is still valid in the future parser, so this should still work as intended. It already has unit tests showing this behavior with the standard parser. rspec-puppet does not yet work with the future parser due to its use of `import`.
- Loading branch information
Showing
3 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
branches: | ||
only: | ||
- master | ||
--- | ||
language: ruby | ||
bundler_args: --without development | ||
script: "bundle exec rake spec SPEC_OPTS='--format documentation'" | ||
after_success: | ||
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-release | ||
- .forge-release/publish | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.3 | ||
- 2.0.0 | ||
env: | ||
matrix: | ||
- PUPPET_GEM_VERSION="~> 3.4.0" | ||
- PUPPET_GEM_VERSION="~> 3.5.0" | ||
- PUPPET_GEM_VERSION="~> 3.6.0" | ||
global: | ||
- PUBLISHER_LOGIN=puppetlabs | ||
- secure: iI91FnYPqlR7+KQBga6ujKB/3N+Wv91mvGhSdAkLl+HsncKLglH+epjXMJ4DLrv08W9msQ+u/ZA6nvAKv9sQTPb/RKx67mC56CHEHguKwCBPsVdJRVjMBseMTl+9INiG58s9uJKA3LRfGd760+WMYJUwDyh+lWTrTOmwNm4WfKI= | ||
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" | ||
matrix: | ||
fast_finish: true | ||
include: | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
# vim: set sw=2 sts=2 et tw=80 : | ||
Puppet::Parser::Functions.newfunction(:mco_array_to_string, :type => :rvalue) do |args| | ||
if ! args[0].is_a? Array | ||
raise ArgumentError, "Expected an array, but got a #{args[0].class}" | ||
end | ||
|
||
args[0].collect do |elem| | ||
elem.to_s | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters