summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-04-03Merge pull request #36 from bodepd/travis_part_threeHEADmasterChris Price
Add travisfile and Gemfile
2013-04-02Add travisfile and GemfileDan Bode
in order to automate travis-ci tests.
2013-04-02Update README.markdownChris Price
2013-04-02Merge pull request #33 from bodepd/doc_updateChris Price
Update Modulefile and Changelog, prepping for 0.10.0 release
2013-04-02Update Modulefile and Changelog, prepping for 0.10.0 releaseChris Price
This commit also adds some comments clarifying the new code that was added to support purging.
2013-04-01Merge pull request #32 from bodepd/fix_test_failuresChris Price
fix unit test failures
2013-04-01fix unit test failuresDan Bode
the previous tests were stubbing global class instances in a way that was causing other tests to fail. This commit updates the tests, and introdcuces child classes which can safely be stubbed (and more closely test the real behavior intended to be tested here)
2013-03-25Merge pull request #29 from kbrezina/subsettingChris Price
Added 'ini_subsetting' custom resource type
2013-03-25Added 'ini_subsetting' custom resource typeKarel Brezina
2013-03-12Merge pull request #30 from bodepd/fix_nil_indentationChris Price
guard against nil indentation values
2013-03-11guard against nil indentation valuesDan Bode
This commit is intended to resolves an issue where the indentation value can be nil (which leads to a run time exception) This occurrs in cases where a section is following by only one of more comments. The proposed fix is to guard against potential nil values where the error occurs. This fix is idential to code used at line 125 of the same file.
2013-03-11Merge pull request #25 from bodepd/add_purging_supportChris Price
Add purging support to ini file
2013-03-04Add purging support to ini fileDan Bode
This commit adds purging to ini file native types. Purging will only work for child providers that implement the method: self.file_path. This is because collecting all instances of the type ( which is a requirement for purging) is only possible when the path of the file that is being managed can be accessed by the class instance (in the method self.instances.) This commit adds the following method to the internal of the ini_file: - get_settings - has of all settings/values for a given section It also adds the following method to the section class: - setting_names - list of all setting names in a section. These methods are required for the instances method to be able to list the values for all settings of each section.
2013-02-06Merge pull request #28 from supercow/masterChris Price
Fix the key_val_setting parameter
2013-02-05Fix test to use correct key_val_parameterJames Sweeny
2012-11-06Added license file w/Apache 2.0 licenseChris Price
2012-11-02Update Modulefile/CHANGELOG ; final commit for v0.9.0 releaseChris Price
2012-10-26Merge pull request #20 from ↵Chris Price
cprice-puppet/feature/master/detect-commented-settings Add detection for commented versions of settings
2012-10-26Add detection for commented versions of settingsChris Price
This commit adds support for detecting commented versions of settings in an existing version of an inifile. If you are setting a value for a setting that isn't currently set in the file, but a commented version is found, then we add the new setting immediately following the commented version, rather than at the end of the section.
2012-10-22Merge pull request #19 from ↵Chris Price
cprice-puppet/feature/master/use-existing-indentation Feature/master/use existing indentation
2012-10-20Refactor to clarify implementation of `save`Chris Price
The `save` method was previously relying on some really specific implementation details of the `section` class (when the start/end_line would be nil, etc.). This made the code a bit hard to follow. This commit introduces a few utility methods in the `section` class (`is_new_section?`, `is_global?`), and refactors the `save` method to use them... this makes the logic a little easier to follow and should hopefully make it easier to maintain.
2012-10-20Add example for `ensure=absent`Chris Price
2012-10-20Better handling of whitespace lines at ends of sectionsChris Price
This is another bit of cosmetic functionality; prior to this commit, when adding a new setting to a section, we'd write it on the very last line before the next section, even if there was a chunk of trailing whitespace lines at the end of the existing section. This was functional, but the output was not always particularly pleasant for human consumption. This commit tweaks things so that we insert new settings just before the final chunk of whitespace lines in an existing section. This keeps things a bit cleaner.
2012-10-20Respect indentation / spacing for existing sections and settingsChris Price
This commit adds some cosmetic functionality. The main two improvements are: * We'll now pay attention to indentation within existing sections, and when we write new settings or update existing ones, we'll match the existing indentation. * When modifying existing settings, the regex now captures a greater portion of the original line and preserves it. Basically, the original whitespacing in the line should remain intact and only the value should be modified.
2012-10-17Merge pull request #18 from ↵Chris Price
cprice-puppet/feature/master/tweaks-to-setting-removal Feature/master/tweaks to setting removal
2012-10-17Minor tweaks to handling of removing settingsChris Price
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-10Add support for removing linesDan Bode
This commit adds the ability to ensure that lines are absent.
2012-10-03Merge pull request #16 from bodepd/masterChris Price
changes for child provider usage
2012-10-02Make value a propertyDan Bode
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-02Make ruby provider a better parent.Dan Bode
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-01Merge pull request #15 from reidmv/bug/master/spacesChris Price
Cool, thanks!
2012-09-29Allow values with spaces to be parsed and setReid Vandewiele
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-24Updated CHANGELOG and Modulefile; final commit for 0.0.3 releaseChris Price
2012-09-20Merge pull request #9 from ↵Chris Price
cprice-puppet/feature/master/allow-override-of-separator-str Allow overriding separator string between key/val pairs
2012-09-20Add validation for key_val_separatorChris Price
For now, the key_val_separator is required to contain exactly one '=' character. This commit simply validates that that is the case.
2012-09-19Allow overriding separator string between key/val pairsChris Price
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-04Merge pull request #5 from jtopjian/jtopjian-colonChris Price
Added support for colons in section names
2012-09-04Added tests for sections with colonsJoe Topjian
2012-09-04Fixed spec_helper.rb so original tests can pass.Joe Topjian
2012-08-24Added support for colons in section namesJoe Topjian
2012-08-20Add CHANGELOG and update README; final commit for 0.0.2 releaseChris Price
2012-08-17Add support for "global" section at beginning of fileChris Price
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-16final commit for 0.0.1 releaseChris Price
* 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-16Add ModulefileChris Price
2012-08-14Merge pull request #4 from stephenrjohnson/miscfixesChris Price
Updated Section/ Setting regex, fixed bug with empty files and updated provider to not care about variable type
2012-08-14make the regex less matchyStephen
2012-08-14Fixed regex to match sections and settings with non alphanumericStephen
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-13Merge pull request #1 from stephenrjohnson/masterChris Price
Fix require paths
2012-08-13fix path for require statementStephen
2012-07-28First (basic) working version of ini_setting providerChris Price