Commit graph

233 commits

Author SHA1 Message Date
mh
6eb8f9ca98 introduce create_ini_settings
create_ini_settings is a function that allows you to create
ini_setting resources from a simple hash:

    $settings = {  section1 => {
        setting1 => val1
      },
      section2 => {
        setting2 => val2,
        setting3 => {
          ensure => absent
        }
      }
    }
    $defaults = {
      path => '/tmp/foo.ini'
    }
    create_ini_settings($settings,$defaults)

Will create the following resources

    ini_setting{'[section1] setting1':
      ensure  => present,
      section => 'section1',
      setting => 'setting1',
      value   => 'val1',
      path    => '/tmp/foo.ini',
    }
    ini_setting{'[section2] setting2':
      ensure  => present,
      section => 'section2',
      setting => 'setting2',
      value   => 'val2',
      path    => '/tmp/foo.ini',
    }
    ini_setting{'[section2] setting3':
      ensure  => absent,
      section => 'section2',
      setting => 'setting3',
      path    => '/tmp/foo.ini',
    }

This allows one to create much easier classes
that should be able to manage an arbritary set of
ini-style settings without having to specify each
one of them.
2015-01-28 22:09:34 +01:00
Morgan Haskel
be5fc47f00 Merge pull request #141 from petems/dry_up_spec_test
Replace code with pre-existing shared_example
2015-01-15 08:49:00 -08:00
Morgan Haskel
7acd0323b3 Merge pull request #143 from cyberious/BeakerRspecPinAbility
Beaker-Rspec currently does not work with Windows, need to be able to
2015-01-14 10:26:53 -08:00
Travis Fields
46ad0bfff9 Beaker-Rspec currently does not work with Windows, need to be able to pin to previous version for testing 2015-01-14 10:20:57 -08:00
Hunter Haugen
e8ddd629e8 Merge pull request #142 from jonnytpuppet/fix_unit_tests_remove_pending
Removed pending unit tests.
2015-01-13 17:15:15 -08:00
Jonathan Tripathy
a21dd813b2 Removed pending unit tests.
This functionality does not exist and thus was cluttering the output.
2015-01-13 17:02:10 -08:00
Peter Souter
9280f81be5 Replace code with pre-existing shared_example
Noticed this when I was testing the module out with a FreeBSD host this code duplicates the shared_example used in the rest of the spec, so I DRY'd it up! 👍
2015-01-11 19:45:27 -08:00
Morgan Haskel
6d43adb26a Merge pull request #140 from cmurphy/master
Add IntelliJ files to the ignore list
2014-12-29 11:23:14 -08:00
Colleen Murphy
9ef15bc598 Add IntelliJ files to the ignore list 2014-12-29 10:41:05 -08:00
Colleen Murphy
2c9defda30 Merge pull request #139 from mhaskel/flexible_key_val
Flexible key val
2014-12-18 13:46:54 -08:00
Morgan Haskel
15f972d092 Rebase/fix the flexible k/v separator. 2014-12-18 10:45:30 -08:00
Pete Johns
c4fa6a614a Fix spec: predicates return booleans 2014-12-18 10:22:20 -08:00
Igor Galić
3288d415e9 WIP: Allow changing key value separator beyond indentation
We have many ini-style configuration files which use : as key value
separator. We'd like to be able to manage them with ini_setting as well.
This here is a naïve first attempt in that direction.

Please note that despite the fact that this *should* match, it's failing
unit tests.. This is a work in progress.
2014-12-18 10:22:20 -08:00
Morgan Haskel
6b399c2bc6 Merge pull request #137 from cmurphy/master
Update .travis.yml, Gemfile, Rakefile, and CONTRIBUTING.md
2014-12-09 08:21:55 -08:00
Colleen Murphy
7e6eba5d34 Add json gem
The puppet_facts gem implicitly depends on the json gem.
On Ruby 1.8.7, json is not built in. On Puppet 2.7, it is
not explicitly pulled in by the hiera gem. So we add it
here explicitly.
2014-12-08 22:52:17 -08:00
Colleen Murphy
113cb70ee2 Update .travis.yml, Gemfile, Rakefile, and CONTRIBUTING.md 2014-12-08 10:23:27 -08:00
Hunter Haugen
19ddca496b Merge pull request #134 from johnsyweb/less-restrictive-setting-names
Less restrictive setting names
2014-11-20 10:19:26 -08:00
Morgan Haskel
792d35cdb4 Merge pull request #135 from johnsyweb/The-Puppet-Labs-Issue-Tracker-has-Moved
The Puppet Labs Issue Tracker has Moved
2014-11-11 14:06:33 -08:00
Hunter Haugen
d2d9ed9478 Merge pull request #136 from mhaskel/merge_1.2.x
Merge 1.2.x
2014-11-10 16:26:54 -08:00
Pete Johns
927d87910a The Puppet Labs Issue Tracker has Moved
https://tickets.puppetlabs.com

Update the documentation accordingly
2014-11-11 07:03:07 +11:00
Pete Johns
3e46c13dc2 Fix Ruby 1.9.3 build 2014-11-08 18:52:20 +11:00
Pete Johns
efeb174427 Add spec for #123
I may have made this configuration file up
2014-11-08 18:47:08 +11:00
Pete Johns
c6dcad2657 Simplify COMMENTED_SETTING_REGEX to match SETTING_REGEX 2014-11-08 17:55:13 +11:00
Pete Johns
e65be6fb4b Simplify SECTION_REGEX 2014-11-08 17:07:01 +11:00
Pete Johns
d98e9bcb77 Add failing spec for KDE Configuration with braces in setting names
Refer https://github.com/puppetlabs/puppetlabs-inifile/pull/131
2014-11-08 17:05:59 +11:00
Travis Fields
91c17084b2 Merge pull request #133 from mhaskel/1.2.0-prep
1.2.0 prep
2014-11-07 14:58:48 -08:00
Morgan Haskel
5bc9ebc03a 1.2.0 prep 2014-11-07 14:06:59 -08:00
Morgan Haskel
3f4ad49b8c Merge pull request #126 from huan/master
fix issue where single characters settings were not being saved.
2014-11-06 15:27:05 -08:00
Travis Fields
12a42711be Merge pull request #132 from mhaskel/test
merge 1.1.x into master
2014-11-06 14:40:05 -08:00
Morgan Haskel
8db122cdeb Merge pull request #124 from cmurphy/master
Synchronize with modulesync
2014-11-06 14:36:54 -08:00
Morgan Haskel
d5164a9b81 Merge pull request #130 from jbondpdx/update-readme
DOC-1100: old inifile causes agent run failure in PE 3.3
2014-11-06 13:26:10 -08:00
jbondpdx
4e3f602d78 DOC-1100: old inifile causes agent run failure in PE 3.3
Added a warning about old, manually installed inifile modules cause failure of agent runs on master as of PE 3.3. User needs to update inifile module.

Bonus round: DOC-1267. Corrected a broken link in the contributor section.
2014-10-10 15:13:09 -07:00
Hunter Haugen
db28fa2d3b Merge pull request #128 from mhaskel/1.1.4-prep
1.1.4 prep
2014-09-30 09:13:20 -07:00
Morgan Haskel
3d3a2cfbe2 1.1.4-prep 2014-09-30 10:23:21 -05:00
Morgan Haskel
58883cdebd Merge pull request #127 from mhaskel/1.1.x-merged-into-master
1.1.x merged into master
2014-09-26 19:31:46 -04:00
Morgan Haskel
8621dfeb15 Merge remote-tracking branch 'upstream/1.1.x' into test 2014-09-26 19:26:00 -04:00
Huan Do
f343c41cd8 modify test to compare to a hash which better tests the state of each setting
also update @@COMMENTED_SETTING_REGEX to be roughly equal to "(\s*)[#;]+" + @@SETTING_REGEX
2014-09-12 16:55:24 -07:00
Huan Do
681f5c0cb4 fix issue where single characters settings were not being saved.
see https://github.com/boxen/puppet-git/issues/30
2014-09-08 23:12:09 -07:00
Ashley Penney
8aeddc8a8c Merge pull request #125 from mhaskel/spec_updates
Update spec_helper for consistency.
2014-08-28 17:39:47 -04:00
Morgan Haskel
7f54eb1279 Update spec_helper for consistency. 2014-08-28 12:39:44 -04:00
Hunter Haugen
90f88ec320 Merge pull request #122 from jbondpdx/new-readme
Docs: New inifile readme
2014-08-19 12:34:36 -07:00
Colleen Murphy
c916acad9c Synchronize with modulesync 2014-08-19 10:16:34 -07:00
jbondpdx
4c94689e5d Docs: fixed code formatting
Fixed code indentation for Implementing Child Providers section.
2014-08-13 14:21:46 -07:00
jbondpdx
9f9e1d4ec9 Docs: New inifile readme 2014-08-13 10:28:03 -07:00
Travis Fields
41e2ddbc1c Merge pull request #121 from apenney/113-release
Prepare a 1.1.3 release.
2014-07-15 09:16:40 -07:00
Ashley Penney
62434bb705 Prepare a 1.1.3 release. 2014-07-15 11:35:05 -04:00
Hunter Haugen
0e8abb96dc Merge pull request #120 from mhaskel/1.1.2-prep
1.1.2-prep.
2014-07-09 12:06:33 -07:00
Morgan Haskel
33147cbfbd 1.1.2-prep. 2014-07-09 14:27:38 -04:00
Ashley Penney
d6335f55f1 Merge pull request #119 from hunner/release_1.1.1
Release 1.1.1
2014-07-07 17:59:51 -04:00
Hunter Haugen
f08a394bf0 Release 1.1.1
Summary
This supported bugfix release corrects the inifile section header
detection regex (so you can use more characters in your section titles).

Bugfixes
- Correct section regex to allow anything other than ]
- Correct `exists?` to return a boolean
- Lots of test updates
- Add missing CONTRIBUTING.md
2014-07-07 14:55:52 -07:00