Commit graph

28 commits

Author SHA1 Message Date
Chris Price
a5eebcfca0 Merge pull request #18 from cprice-puppet/feature/master/tweaks-to-setting-removal
Feature/master/tweaks to setting removal
2012-10-17 15:50:02 -07:00
Chris Price
cda30a6ab9 Minor tweaks to handling of removing settings
This commit makes some minor changes to how we handle removing
settings.  In particular, it updates all of the line numbers
of the various 'section' objects to correspond to the new
state of the world based on the removal of a line that appeared
before them.

Also adds one more test related to setting removal.
2012-10-17 13:27:28 -07:00
Dan Bode
1106d70e88 Add support for removing lines
This commit adds the ability to ensure that lines are absent.
2012-10-10 17:40:38 -07:00
Chris Price
842b2f06b2 Merge pull request #16 from bodepd/master
changes for child provider usage
2012-10-03 09:29:27 -07:00
Dan Bode
cbc90d3834 Make value a property
This commit converts value to a property so that it
can be managed and modified when a file already has
a value set.

It was previously treating the line creation state
the same as the update case, which is not in
alignment with Puppet's model.
2012-10-02 18:53:53 -07:00
Dan Bode
1564c473a9 Make ruby provider a better parent.
In order to allow the provider to be a parent for
other providers, I have implemented the following
methods: section, setting, file_path, separator so
that they can be overridden by child providers and
decouple this provider from its type.
2012-10-02 18:52:34 -07:00
Chris Price
6d3e6a137a Merge pull request #15 from reidmv/bug/master/spaces
Cool, thanks!
2012-10-01 09:31:59 -07:00
Reid Vandewiele
3829e20c49 Allow values with spaces to be parsed and set
Previously, the following stanza would fail as a result of the
ini_setting type not being able to parse spaces in setting values.

  ini_setting { 'main_config_version':
    ensure  => present,
    path    => '/etc/puppetlabs/puppet/puppet.conf',
    section => 'main',
    setting => 'config_version',
    value   => '/etc/puppetlabs/puppet/config_version.sh $environment',
  }

This commit modifes the SETTING_REGEX to account for spaces in setting values.
2012-09-29 12:39:00 -07:00
Chris Price
e81a69adb5 Updated CHANGELOG and Modulefile; final commit for 0.0.3 release 2012-09-24 10:20:45 -07:00
Chris Price
4ff4995d9e Merge pull request #9 from cprice-puppet/feature/master/allow-override-of-separator-str
Allow overriding separator string between key/val pairs
2012-09-20 12:53:59 -07:00
Chris Price
e527908b7c Add validation for key_val_separator
For now, the key_val_separator is required to contain
exactly one '=' character.  This commit simply validates
that that is the case.
2012-09-20 11:35:45 -07:00
Chris Price
8d1fdc5c29 Allow overriding separator string between key/val pairs
This introduces a new parameter, 'key_val_separator', which
can be set in order to override the string that is used
as a separator between the key/value pair of a setting line.
The default is ' = ', but you could set the param to '=' if
you don't want to include whitespace in your settings file.
2012-09-19 15:42:16 -07:00
Chris Price
310a4b1575 Merge pull request #5 from jtopjian/jtopjian-colon
Added support for colons in section names
2012-09-04 10:27:39 -07:00
Joe Topjian
4d3acd8fae Added tests for sections with colons 2012-09-04 17:16:05 +00:00
Joe Topjian
5de1731151 Fixed spec_helper.rb so original tests can pass. 2012-09-04 16:55:36 +00:00
Joe Topjian
63ddc0c926 Added support for colons in section names 2012-08-24 08:37:08 +00:00
Chris Price
04e2c5ea3b Add CHANGELOG and update README; final commit for 0.0.2 release 2012-08-20 14:13:37 -07:00
Chris Price
c57dab4903 Add support for "global" section at beginning of file
This commit does the following:

* Fixes a bug in ExternalIterator
* Adds support for a "global" section before the first named
  section at the beginning of the INI file
* Improves test coverage
2012-08-17 04:48:28 -07:00
Chris Price
4f0e7264e3 final commit for 0.0.1 release
* Updated README
* Fixed a small bug that would be triggered if the file specified
  by `path` didn't exist.
* Added a smoke test manifest
2012-08-16 21:50:20 -07:00
Chris Price
bf06644b4a Add Modulefile 2012-08-16 18:49:40 -07:00
Chris Price
1740608847 Merge pull request #4 from stephenrjohnson/miscfixes
Updated Section/ Setting  regex, fixed bug with empty files and updated provider to not care about variable type
2012-08-14 13:48:57 -07:00
Stephen
8d2a8c859d make the regex less matchy 2012-08-14 19:30:14 +01:00
Stephen
d2c1e07e80 Fixed regex to match sections and settings with non alphanumeric
characters. Fixed writing to file without any sections at all.
Fixed exists checking for variable type by always casting to string
and added all the tests for the above items.
2012-08-14 13:38:08 +01:00
Chris Price
e2954b26c1 Merge pull request #1 from stephenrjohnson/master
Fix require paths
2012-08-13 11:26:42 -07:00
Stephen
dde3a14ab0 fix path for require statement 2012-08-13 18:54:01 +01:00
Chris Price
9c76b6af12 First (basic) working version of ini_setting provider 2012-07-28 21:59:54 -07:00
Chris Price
91273a5a2b Started writing some tests, work has been punted 2012-06-14 11:42:49 -07:00
Chris Price
74fbedcf5b Initial commit 2012-06-14 07:52:17 -07:00