librarian-puppet 0.9.10 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +82 -19
  3. data/bin/librarian-puppet +0 -2
  4. data/lib/librarian/puppet.rb +32 -4
  5. data/lib/librarian/puppet/cli.rb +7 -0
  6. data/lib/librarian/puppet/dsl.rb +13 -0
  7. data/lib/librarian/puppet/environment.rb +5 -8
  8. data/lib/librarian/puppet/extension.rb +212 -0
  9. data/lib/librarian/puppet/requirement.rb +6 -2
  10. data/lib/librarian/puppet/source.rb +1 -0
  11. data/lib/librarian/puppet/source/forge.rb +62 -35
  12. data/lib/librarian/puppet/source/git.rb +51 -36
  13. data/lib/librarian/puppet/source/githubtarball.rb +44 -28
  14. data/lib/librarian/puppet/source/local.rb +4 -1
  15. data/lib/librarian/puppet/templates/Puppetfile +3 -0
  16. data/lib/librarian/puppet/util.rb +27 -0
  17. data/lib/librarian/puppet/version.rb +1 -1
  18. metadata +106 -207
  19. data/vendor/librarian/CHANGELOG.md +0 -185
  20. data/vendor/librarian/Gemfile +0 -6
  21. data/vendor/librarian/MIT-LICENSE +0 -20
  22. data/vendor/librarian/README.md +0 -403
  23. data/vendor/librarian/Rakefile +0 -34
  24. data/vendor/librarian/bin/librarian-chef +0 -7
  25. data/vendor/librarian/bin/librarian-mock +0 -7
  26. data/vendor/librarian/config/cucumber.yaml +0 -1
  27. data/vendor/librarian/features/chef/cli/init.feature +0 -11
  28. data/vendor/librarian/features/chef/cli/install.feature +0 -64
  29. data/vendor/librarian/features/chef/cli/show.feature +0 -77
  30. data/vendor/librarian/features/chef/cli/version.feature +0 -11
  31. data/vendor/librarian/features/support/env.rb +0 -9
  32. data/vendor/librarian/lib/librarian.rb +0 -19
  33. data/vendor/librarian/lib/librarian/action.rb +0 -5
  34. data/vendor/librarian/lib/librarian/action/base.rb +0 -24
  35. data/vendor/librarian/lib/librarian/action/clean.rb +0 -44
  36. data/vendor/librarian/lib/librarian/action/ensure.rb +0 -24
  37. data/vendor/librarian/lib/librarian/action/install.rb +0 -99
  38. data/vendor/librarian/lib/librarian/action/resolve.rb +0 -81
  39. data/vendor/librarian/lib/librarian/action/update.rb +0 -78
  40. data/vendor/librarian/lib/librarian/chef.rb +0 -1
  41. data/vendor/librarian/lib/librarian/chef/cli.rb +0 -48
  42. data/vendor/librarian/lib/librarian/chef/dsl.rb +0 -15
  43. data/vendor/librarian/lib/librarian/chef/environment.rb +0 -27
  44. data/vendor/librarian/lib/librarian/chef/extension.rb +0 -9
  45. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +0 -42
  46. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +0 -59
  47. data/vendor/librarian/lib/librarian/chef/source.rb +0 -3
  48. data/vendor/librarian/lib/librarian/chef/source/git.rb +0 -25
  49. data/vendor/librarian/lib/librarian/chef/source/local.rb +0 -69
  50. data/vendor/librarian/lib/librarian/chef/source/path.rb +0 -12
  51. data/vendor/librarian/lib/librarian/chef/source/site.rb +0 -452
  52. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +0 -15
  53. data/vendor/librarian/lib/librarian/cli.rb +0 -205
  54. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +0 -79
  55. data/vendor/librarian/lib/librarian/config.rb +0 -7
  56. data/vendor/librarian/lib/librarian/config/database.rb +0 -205
  57. data/vendor/librarian/lib/librarian/config/file_source.rb +0 -47
  58. data/vendor/librarian/lib/librarian/config/hash_source.rb +0 -33
  59. data/vendor/librarian/lib/librarian/config/source.rb +0 -149
  60. data/vendor/librarian/lib/librarian/dependency.rb +0 -91
  61. data/vendor/librarian/lib/librarian/dsl.rb +0 -108
  62. data/vendor/librarian/lib/librarian/dsl/receiver.rb +0 -48
  63. data/vendor/librarian/lib/librarian/dsl/target.rb +0 -172
  64. data/vendor/librarian/lib/librarian/environment.rb +0 -134
  65. data/vendor/librarian/lib/librarian/error.rb +0 -4
  66. data/vendor/librarian/lib/librarian/helpers.rb +0 -13
  67. data/vendor/librarian/lib/librarian/lockfile.rb +0 -29
  68. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +0 -66
  69. data/vendor/librarian/lib/librarian/lockfile/parser.rb +0 -100
  70. data/vendor/librarian/lib/librarian/logger.rb +0 -46
  71. data/vendor/librarian/lib/librarian/manifest.rb +0 -234
  72. data/vendor/librarian/lib/librarian/manifest_set.rb +0 -153
  73. data/vendor/librarian/lib/librarian/mock.rb +0 -1
  74. data/vendor/librarian/lib/librarian/mock/cli.rb +0 -19
  75. data/vendor/librarian/lib/librarian/mock/dsl.rb +0 -15
  76. data/vendor/librarian/lib/librarian/mock/environment.rb +0 -24
  77. data/vendor/librarian/lib/librarian/mock/extension.rb +0 -9
  78. data/vendor/librarian/lib/librarian/mock/source.rb +0 -1
  79. data/vendor/librarian/lib/librarian/mock/source/mock.rb +0 -103
  80. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +0 -83
  81. data/vendor/librarian/lib/librarian/resolution.rb +0 -44
  82. data/vendor/librarian/lib/librarian/resolver.rb +0 -78
  83. data/vendor/librarian/lib/librarian/resolver/implementation.rb +0 -118
  84. data/vendor/librarian/lib/librarian/source.rb +0 -2
  85. data/vendor/librarian/lib/librarian/source/git.rb +0 -156
  86. data/vendor/librarian/lib/librarian/source/git/repository.rb +0 -217
  87. data/vendor/librarian/lib/librarian/source/local.rb +0 -61
  88. data/vendor/librarian/lib/librarian/source/path.rb +0 -80
  89. data/vendor/librarian/lib/librarian/spec.rb +0 -13
  90. data/vendor/librarian/lib/librarian/spec_change_set.rb +0 -173
  91. data/vendor/librarian/lib/librarian/specfile.rb +0 -18
  92. data/vendor/librarian/lib/librarian/support/abstract_method.rb +0 -21
  93. data/vendor/librarian/lib/librarian/ui.rb +0 -64
  94. data/vendor/librarian/lib/librarian/version.rb +0 -3
  95. data/vendor/librarian/librarian.gemspec +0 -34
  96. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +0 -432
  97. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +0 -215
  98. data/vendor/librarian/spec/functional/source/git/repository_spec.rb +0 -149
  99. data/vendor/librarian/spec/unit/action/base_spec.rb +0 -18
  100. data/vendor/librarian/spec/unit/action/clean_spec.rb +0 -102
  101. data/vendor/librarian/spec/unit/action/ensure_spec.rb +0 -37
  102. data/vendor/librarian/spec/unit/action/install_spec.rb +0 -111
  103. data/vendor/librarian/spec/unit/config/database_spec.rb +0 -319
  104. data/vendor/librarian/spec/unit/dependency_spec.rb +0 -36
  105. data/vendor/librarian/spec/unit/dsl_spec.rb +0 -194
  106. data/vendor/librarian/spec/unit/environment_spec.rb +0 -9
  107. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +0 -162
  108. data/vendor/librarian/spec/unit/lockfile_spec.rb +0 -65
  109. data/vendor/librarian/spec/unit/manifest_set_spec.rb +0 -202
  110. data/vendor/librarian/spec/unit/manifest_spec.rb +0 -36
  111. data/vendor/librarian/spec/unit/manifest_version_spec.rb +0 -94
  112. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +0 -22
  113. data/vendor/librarian/spec/unit/resolver_spec.rb +0 -192
  114. data/vendor/librarian/spec/unit/source/git_spec.rb +0 -29
  115. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +0 -169
@@ -1,6 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in librarian.gemspec
4
- gemspec
5
-
6
- gem "fakefs", :require => "fakefs/safe"
@@ -1,20 +0,0 @@
1
- Copyright (c) 2011 ApplicationsOnline, LLC.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,403 +0,0 @@
1
- Librarian [![Build Status](https://secure.travis-ci.org/applicationsonline/librarian.png)](http://travis-ci.org/applicationsonline/librarian)
2
- =========
3
-
4
- Librarian is a framework for writing bundlers, which are tools that resolve,
5
- fetch, install, and isolate a project's dependencies, in Ruby.
6
-
7
- Librarian ships with Librarian-Chef, which is a bundler for your Chef-based
8
- infrastructure repositories. In the future, Librarian-Chef will be a separate
9
- project.
10
-
11
- A bundler written with Librarian will expect you to provide a specfile listing
12
- your project's declared dependencies, including any version constraints and
13
- including the upstream sources for finding them. Librarian can resolve the spec,
14
- write a lockfile listing the full resolution, fetch the resolved dependencies,
15
- install them, and isolate them in your project.
16
-
17
- A bundler written with Librarian will be similar in kind to [Bundler](http://gembundler.com),
18
- the bundler for Ruby gems that many modern Rails applications use.
19
-
20
- Librarian-Chef
21
- ---------------
22
-
23
- Librarian-Chef is a tool that helps you manage the cookbooks that your chef-repo
24
- depends on. Here are some more details.
25
-
26
- Librarian-Chef is a bundler for infrastructure repositories using Chef. You can
27
- use Librarian-Chef to resolve your infrastructure's cookbook dependencies, fetch
28
- them, and install them into your infrastructure repository.
29
-
30
- Librarian-Chef can resolve and fetch third-party, publicly-released cookbooks,
31
- and install them into your infrastructure repository. It can also source
32
- cookbooks directly from their own source control repositories.
33
-
34
- Librarian-Chef can also deal with cookbooks you may actively be working on
35
- outside your infrastructure repository. For example, it can deal with cookbooks
36
- directly from their own private source control repositories, whether they are
37
- remote or local to your machine, and it can deal with cookbooks released to and
38
- hosted on a private cookbooks server.
39
-
40
- Librarian-Chef is not primarily intended for dealing with the cookbooks you are
41
- actively working on *within* your infrastructure repository. In such a case, you
42
- can still use Librarian-Chef, but it is likely unnecessary.
43
-
44
- Librarian-Chef *takes over* your `cookbooks/` directory and manages it for you
45
- based on your `Cheffile`. Your `Cheffile` becomes the authoritative source for
46
- the cookbooks your infrastructure repository depends on. You should not modify
47
- the contents of your `cookbooks/` directory when using Librarian-Chef. If you
48
- have cookbooks which are, rather than being separate projects, inherently part
49
- of your infrastructure repository, then they should go in a separate directory,
50
- like your `site-cookbooks/` directory, and you do not need to use Librarian-Chef
51
- to manage them.
52
-
53
- ### The Cheffile
54
-
55
- Every infrastruture repository that uses Librarian-Chef will have a file named
56
- `Cheffile` in the root directory of that repository. The full specification for
57
- which third-party, publicly-released cookbooks your infrastructure repository
58
- depends will go here.
59
-
60
- Here's an example `Cheffile`:
61
-
62
- site "http://community.opscode.com/api/v1"
63
-
64
- cookbook "ntp"
65
- cookbook "timezone", "0.0.1"
66
-
67
- cookbook "rvm",
68
- :git => "https://github.com/fnichol/chef-rvm",
69
- :ref => "v0.7.1"
70
-
71
- cookbook "cloudera",
72
- :path => "vendor/cookbooks/cloudera-cookbook"
73
-
74
- Here's how it works:
75
-
76
- We start off by declaring the *default source* for this `Cheffile`.
77
-
78
- site "http://community.opscode.com/api/v1"
79
-
80
- This default source in this example is the Opscode Community Site API. This is
81
- most likely what you will want for your default source. However, you can
82
- certainly set up your own API-compatible HTTP endpoint if you want more control.
83
-
84
- Any time we declare a cookbook dependency without also declaring a source for
85
- that cookbook dependency, Librarian-Chef assumes we want it to look for that
86
- cookbook in the default source.
87
-
88
- Any time we declare a cookbook dependency that has subsidiary cookbook
89
- dependencies of its own, Librarian-Chef assumes we want it to look for the
90
- subsidiary cookbook dependencies in the default source.
91
-
92
- cookbook "ntp"
93
-
94
- Our infrastructure repository depends on the `ntp` cookbook from the default
95
- source. Any version of the `ntp` cookbook will fulfill our requirements.
96
-
97
- cookbook "timezone", "0.0.1"
98
-
99
- Our infrastructure repository depends on the `timezone` cookbook from the
100
- default source. But only version `0.0.1` of that cookbook will do.
101
-
102
- cookbook "rvm",
103
- :git => "https://github.com/fnichol/chef-rvm",
104
- :ref => "v0.7.1"
105
-
106
- Our infrastructure repository depends on the `rvm` cookbook, but not the one
107
- from the default source. Instead, the cookbook is to be fetched from the
108
- specified Git repository and from the specified Git tag only.
109
-
110
- When using a Git source, we do not have to use a `:ref =>`. If we do not,
111
- then Librarian-Chef will assume we meant the `master` branch. (In the future,
112
- this will be changed to whatever branch is the default branch according to
113
- the Git remote, which may not be `master`.)
114
-
115
- If we use a `:ref =>`, we can use anything that Git will recognize as a ref.
116
- This includes any branch name, tag name, SHA, or SHA unique prefix. If we use a
117
- branch, we can later ask Librarian-Chef to update the cookbook by fetching the
118
- most recent version of the cookbook from that same branch.
119
-
120
- The Git source also supports a `:path =>` option. If we use the path option,
121
- Librarian-Chef will navigate down into the Git repository and only use the
122
- specified subdirectory. Many people have the habit of having a single repository
123
- with many cookbooks in it. If we need a cookbook from such a repository, we can
124
- use the `:path =>` option here to help Librarian-Chef drill down and find the
125
- cookbook subdirectory.
126
-
127
- cookbook "cloudera",
128
- :path => "vendor/cookbooks/cloudera-cookbook"
129
-
130
- Our infrastructure repository depends on the `cloudera` cookbook, which we have
131
- downloaded and copied into our repository. In this example, `vendor/cookbooks/`
132
- is only for use with Librarian-Chef. This directory should not appear in the
133
- `.chef/knife.rb`. Librarian-Chef will, instead, copy this cookbook from where
134
- we vendored it in our repository into the `cookbooks/` directory for us.
135
-
136
- The `:path =>` source won't be confused with the `:git =>` source's `:path =>`
137
- option.
138
-
139
- ### How to Use
140
-
141
- Install Librarian-Chef:
142
-
143
- $ gem install librarian
144
-
145
- Prepare your infrastructure repository:
146
-
147
- $ cd ~/path/to/chef-repo
148
- $ git rm -r cookbooks
149
- $ echo /cookbooks >> .gitignore
150
- $ echo /tmp >> .gitignore
151
-
152
- Librarian-Chef takes over your `cookbooks/` directory, and will always reinstall
153
- the cookbooks listed the `Cheffile.lock` into your `cookbooks/` directory. Hence
154
- you do not need your `cookbooks/` directory to be tracked in Git. If you
155
- nevertheless want your `cookbooks/` directory to be tracked in Git, simple don't
156
- `.gitignore` the directory.
157
-
158
- If you are manually tracking/vendoring outside cookbooks within the repository,
159
- put them in another directory such as `vendor/cookbooks/` and use the `:path =>`
160
- source when declaring these cookbooks in your `Cheffile`. Most people will
161
- typically not be manually tracking/vendoring outside cookbooks.
162
-
163
- Librarian-Chef uses your `tmp/` directory for tempfiles and caches. You do not
164
- need to track this directory in Git.
165
-
166
- Make a Cheffile:
167
-
168
- $ librarian-chef init
169
-
170
- This creates an empty `Cheffile` with the Opscode Community Site API as the
171
- default source.
172
-
173
- Add dependencies and their sources to the `Cheffile`:
174
-
175
- $ cat Cheffile
176
- site 'http://community.opscode.com/api/v1'
177
- cookbook 'ntp'
178
- cookbook 'timezone', '0.0.1'
179
- cookbook 'rvm',
180
- :git => 'https://github.com/fnichol/chef-rvm',
181
- :ref => 'v0.7.1'
182
- cookbook 'cloudera',
183
- :path => 'vendor/cookbooks/cloudera-cookbook'
184
-
185
- This is the same `Cheffile` we saw above.
186
-
187
- $ librarian-chef install [--clean] [--verbose]
188
-
189
- This command looks at each `cookbook` declaration and fetches the cookbook from
190
- the source specified, or from the default source if none is provided.
191
-
192
- Each cookbook is inspected, its dependencies are determined, and each dependency
193
- is also fetched. For example, if you declare `cookbook 'nagios'`, which
194
- depends on other cookbooks such as `'php'`, then those other cookbooks
195
- including `'php'` will be fetched. This goes all the way down the chain of
196
- dependencies.
197
-
198
- This command writes the complete resolution into `Cheffile.lock`.
199
-
200
- This command then copies all of the fetched cookbooks into your `cookbooks/`
201
- directory, overwriting whatever was there before. You can then use `knife
202
- cookbook upload -all` to upload the cookbooks to your chef-server, if you are
203
- using the client-server model.
204
-
205
- Check your `Cheffile` and `Cheffile.lock` into version control:
206
-
207
- $ git add Cheffile
208
- $ git add Cheffile.lock
209
- $ git commit -m "I want these particular versions of these particular cookbooks from these particular."
210
-
211
- Make sure you check your `Cheffile.lock` into version control. This will ensure
212
- dependencies do not need to be resolved every run, greatly reducing dependency
213
- resolution time.
214
-
215
- Get an overview of your `Cheffile.lock` with:
216
-
217
- $ librarian-chef show
218
-
219
- Inspect the details of specific resolved dependencies with:
220
-
221
- $ librarian-chef show NAME1 [NAME2, ...]
222
-
223
- Update your `Cheffile` with new/changed/removed constraints/sources/dependencies:
224
-
225
- $ cat Cheffile
226
- site 'http://community.opscode.com/api/v1'
227
- cookbook 'ntp'
228
- cookbook 'timezone', '0.0.1'
229
- cookbook 'rvm',
230
- :git => 'https://github.com/fnichol/chef-rvm',
231
- :ref => 'v0.7.1'
232
- cookbook 'monit' # new!
233
- $ git diff Cheffile
234
- $ librarian-chef install [--verbose]
235
- $ git diff Cheffile.lock
236
- $ git add Cheffile
237
- $ git add Cheffile.lock
238
- $ git commit -m "I also want these additional cookbooks."
239
-
240
- Find out which dependencies are outdated and may be updated:
241
-
242
- $ librarian-chef outdated [--verbose]
243
-
244
- Update the version of a dependency:
245
-
246
- $ librarian-chef update ntp timezone monit [--verbose]
247
- $ git diff Cheffile.lock
248
- $ git add Cheffile.lock
249
- $ git commit -m "I want updated versions of these cookbooks."
250
-
251
- Push your changes to the git repository:
252
-
253
- $ git push origin master
254
-
255
- Upload the cookbooks to your chef-server:
256
-
257
- $ knife cookbook upload --all
258
-
259
- ### Configuration
260
-
261
- Configuration comes from three sources with the following highest-to-lowest
262
- precedence:
263
-
264
- * The local config (`./.librarian/chef/config`)
265
- * The environment
266
- * The global config (`~/.librarian/chef/config`)
267
-
268
- You can inspect the final configuration with:
269
-
270
- $ librarian-chef config
271
-
272
- You can find out where a particular key is set with:
273
-
274
- $ librarian-chef config KEY
275
-
276
- You can set a key at the global level with:
277
-
278
- $ librarian-chef config KEY VALUE --global
279
-
280
- And remove it with:
281
-
282
- $ librarian-chef config KEY --global --delete
283
-
284
- You can set a key at the local level with:
285
-
286
- $ librarian-chef config KEY VALUE --local
287
-
288
- And remove it with:
289
-
290
- $ librarian-chef config KEY --local --delete
291
-
292
- You cannot set or delete environment-level config keys with the CLI.
293
-
294
- Configuration set at either the global or local level will affect subsequent
295
- invocations of `librarian-chef`. Configurations set at the environment level are
296
- not saved and will not affect subsequent invocations of `librarian-chef`.
297
-
298
- You can pass a config at the environment level by taking the original config key
299
- and transforming it: replace hyphens (`-`) with underscores (`_`) and periods
300
- (`.`) with doubled underscores (`__`), uppercase, and finally prefix with
301
- `LIBRARIAN_CHEF_`. For example, to pass a config in the environment for the key
302
- `part-one.part-two`, set the environment variable
303
- `LIBRARIAN_CHEF_PART_ONE__PART_TWO`.
304
-
305
- Configuration affects how various commands operate.
306
-
307
- * The `path` config sets the cookbooks directory to install to. If a relative
308
- path, it is relative to the directory containing the `Cheffile`. The
309
- equivalent environment variable is `LIBRARIAN_CHEF_PATH`.
310
-
311
- * The `install.strip-dot-git` config causes the `.git/` directory to be stripped
312
- out when installing cookbooks from a git source. This must be set to exactly
313
- "1" to cause this behavior. The equivalent environment variable is
314
- `LIBRARIAN_CHEF_INSTALL__STRIP_DOT_GIT`.
315
-
316
- Configuration can be set by passing specific options to other commands.
317
-
318
- * The `path` config can be set at the local level by passing the `--path` option
319
- to the `install` command. It can be unset at the local level by passing the
320
- `--no-path` option to the `install` command. Note that if this is set at the
321
- environment or global level then, even if `--no-path` is given as an option,
322
- the environment or global config will be used.
323
-
324
- * The `install.strip-dot-git` config can be set at the local level by passing
325
- the `--strip-dot-git` option to the `install` command. It can be unset at the
326
- local level by passing the `--no-strip-dot-git` option.
327
-
328
- ### Knife Integration
329
-
330
- You can integrate your `knife.rb` with Librarian-Chef.
331
-
332
- Stick the following in your `knife.rb`:
333
-
334
- require 'librarian/chef/integration/knife'
335
- cookbook_path Librarian::Chef.install_path,
336
- "/path/to/chef-repo/site-cookbooks"
337
-
338
- In the above, do *not* to include the path to your `cookbooks/` directory. If
339
- you have additional cookbooks directories in your chef-repo that you use for
340
- vendored cookbooks (where you use the `:path =>` source in your `Cheffile`),
341
- make sure *not* to include the paths to those additional cookbooks directories
342
- either.
343
-
344
- You still need to include your `site-cookbooks/` directory in the above list.
345
-
346
- What this integration does is whenever you use any `knife` command, it will:
347
-
348
- * Enforce that your `Cheffile` and `Cheffile.lock` are in sync
349
- * Install the resolved cookbooks to a temporary directory
350
- * Configure Knife to look in the temporary directory for the installed cookbooks
351
- and not in the normal `cookbooks/` directory.
352
-
353
- When you use this integration, any changes you make to anything in the
354
- `cookbooks/` directory will be ignored by Knife, because Knife won't look in
355
- that directory for your cookbooks.
356
-
357
- How to Contribute
358
- -----------------
359
-
360
- ### Running the tests
361
-
362
- # Either
363
- $ rspec spec
364
- $ cucumber
365
-
366
- # Or
367
- $ rake
368
-
369
- You will probably need some way to isolate gems. Librarian provides a `Gemfile`,
370
- so if you want to use bundler, you can prepare the directory with the usual
371
- `bundle install` and run each command prefixed with the usual `bundle exec`, as:
372
-
373
- $ bundle install
374
- $ bundle exec rspec spec
375
- $ bundle exec cucumber
376
- $ bundle exec rake
377
-
378
- ### Installing locally
379
-
380
- $ rake install
381
-
382
- You should typically not need to install locally, if you are simply trying to
383
- patch a bug and test the result on a test case. Instead of installing locally,
384
- you are probably better served by:
385
-
386
- $ cd $PATH_TO_INFRASTRUCTURE_REPO
387
- $ $PATH_TO_LIBRARIAN_CHECKOUT/bin/librarian-chef install [--verbose]
388
-
389
- ### Reporting Issues
390
-
391
- Please include relevant `Cheffile` and `Cheffile.lock` files. Please run the
392
- `librarian-chef` commands in verbose mode by using the `--verbose` flag, and
393
- include the verbose output in the bug report as well.
394
-
395
- License
396
- -------
397
-
398
- Written by Jay Feldblum.
399
-
400
- Copyright (c) 2011-2012 ApplicationsOnline, LLC.
401
-
402
- Released under the terms of the MIT License. For further information, please see
403
- the file `MIT-LICENSE`.
@@ -1,34 +0,0 @@
1
- require 'bundler'
2
-
3
- module Bundler
4
- class GemHelper
5
-
6
- def build_gem_with_built_spec
7
- spec = Gem::Specification.load(spec_path)
8
- spec_ruby = spec.to_ruby
9
- original_spec_path = spec_path + ".original"
10
- FileUtils.mv(spec_path, original_spec_path)
11
- File.open(spec_path, "wb"){|f| f.write(spec_ruby)}
12
- build_gem_without_built_spec
13
- ensure
14
- FileUtils.mv(original_spec_path, spec_path)
15
- end
16
-
17
- alias build_gem_without_built_spec build_gem
18
- alias build_gem build_gem_with_built_spec
19
-
20
- end
21
- end
22
-
23
- Bundler::GemHelper.install_tasks
24
-
25
- begin
26
- require 'rspec/core/rake_task'
27
- RSpec::Core::RakeTask.new(:spec)
28
-
29
- require 'cucumber/rake/task'
30
- Cucumber::Rake::Task.new(:features)
31
-
32
- task :default => [:spec, :features]
33
- rescue LoadError
34
- end