omnibus 6.1.7 → 8.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -4
  3. data/README.md +54 -12
  4. data/Rakefile +1 -1
  5. data/bin/omnibus +1 -1
  6. data/lib/omnibus.rb +2 -2
  7. data/lib/omnibus/build_version.rb +1 -1
  8. data/lib/omnibus/build_version_dsl.rb +6 -7
  9. data/lib/omnibus/builder.rb +10 -9
  10. data/lib/omnibus/changelog_printer.rb +7 -4
  11. data/lib/omnibus/cleaner.rb +4 -1
  12. data/lib/omnibus/cli.rb +2 -2
  13. data/lib/omnibus/cli/changelog.rb +25 -25
  14. data/lib/omnibus/compressor.rb +2 -2
  15. data/lib/omnibus/compressors/base.rb +2 -2
  16. data/lib/omnibus/compressors/dmg.rb +8 -6
  17. data/lib/omnibus/compressors/tgz.rb +2 -2
  18. data/lib/omnibus/config.rb +13 -3
  19. data/lib/omnibus/core_extensions/open_uri.rb +1 -1
  20. data/lib/omnibus/digestable.rb +2 -2
  21. data/lib/omnibus/download_helpers.rb +6 -2
  22. data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
  23. data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
  24. data/lib/omnibus/fetchers/net_fetcher.rb +3 -4
  25. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  26. data/lib/omnibus/file_syncer.rb +1 -1
  27. data/lib/omnibus/generator.rb +2 -2
  28. data/lib/omnibus/generator_files/README.md.erb +20 -16
  29. data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
  30. data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
  31. data/lib/omnibus/git_cache.rb +2 -2
  32. data/lib/omnibus/health_check.rb +3 -1
  33. data/lib/omnibus/licensing.rb +5 -6
  34. data/lib/omnibus/logger.rb +3 -2
  35. data/lib/omnibus/manifest.rb +2 -2
  36. data/lib/omnibus/metadata.rb +2 -2
  37. data/lib/omnibus/ohai.rb +1 -1
  38. data/lib/omnibus/package.rb +1 -1
  39. data/lib/omnibus/packager.rb +6 -14
  40. data/lib/omnibus/packagers/appx.rb +1 -2
  41. data/lib/omnibus/packagers/base.rb +2 -1
  42. data/lib/omnibus/packagers/bff.rb +6 -8
  43. data/lib/omnibus/packagers/deb.rb +7 -10
  44. data/lib/omnibus/packagers/ips.rb +3 -6
  45. data/lib/omnibus/packagers/makeself.rb +1 -2
  46. data/lib/omnibus/packagers/msi.rb +13 -12
  47. data/lib/omnibus/packagers/pkg.rb +125 -9
  48. data/lib/omnibus/packagers/rpm.rb +11 -12
  49. data/lib/omnibus/packagers/solaris.rb +5 -5
  50. data/lib/omnibus/packagers/windows_base.rb +7 -6
  51. data/lib/omnibus/project.rb +3 -2
  52. data/lib/omnibus/publisher.rb +2 -2
  53. data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
  54. data/lib/omnibus/publishers/s3_publisher.rb +6 -4
  55. data/lib/omnibus/s3_cache.rb +4 -2
  56. data/lib/omnibus/s3_helpers.rb +7 -7
  57. data/lib/omnibus/software.rb +68 -43
  58. data/lib/omnibus/sugarable.rb +5 -14
  59. data/lib/omnibus/templating.rb +2 -2
  60. data/lib/omnibus/thread_pool.rb +0 -2
  61. data/lib/omnibus/util.rb +4 -3
  62. data/lib/omnibus/version.rb +1 -1
  63. data/lib/omnibus/whitelist.rb +24 -1
  64. data/omnibus.gemspec +8 -9
  65. data/resources/ips/doc-transform.erb +1 -0
  66. data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
  67. data/resources/msi/source.wxs.erb +2 -10
  68. data/resources/rpm/signing.erb +7 -10
  69. data/spec/functional/builder_spec.rb +2 -1
  70. data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
  71. data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
  72. data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
  73. data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
  74. data/spec/functional/licensing_spec.rb +5 -5
  75. data/spec/support/examples.rb +3 -4
  76. data/spec/support/path_helpers.rb +2 -2
  77. data/spec/unit/builder_spec.rb +9 -9
  78. data/spec/unit/changelogprinter_spec.rb +8 -6
  79. data/spec/unit/compressor_spec.rb +4 -4
  80. data/spec/unit/compressors/dmg_spec.rb +5 -2
  81. data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
  82. data/spec/unit/health_check_spec.rb +2 -6
  83. data/spec/unit/library_spec.rb +2 -1
  84. data/spec/unit/manifest_diff_spec.rb +2 -2
  85. data/spec/unit/manifest_spec.rb +1 -1
  86. data/spec/unit/metadata_spec.rb +14 -17
  87. data/spec/unit/omnibus_spec.rb +1 -1
  88. data/spec/unit/packager_spec.rb +6 -13
  89. data/spec/unit/packagers/bff_spec.rb +2 -2
  90. data/spec/unit/packagers/ips_spec.rb +1 -0
  91. data/spec/unit/packagers/msi_spec.rb +2 -2
  92. data/spec/unit/packagers/pkg_spec.rb +354 -0
  93. data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
  94. data/spec/unit/packagers/rpm_spec.rb +5 -5
  95. data/spec/unit/packagers/solaris_spec.rb +7 -7
  96. data/spec/unit/project_spec.rb +7 -7
  97. data/spec/unit/publisher_spec.rb +1 -2
  98. data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
  99. data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
  100. data/spec/unit/s3_cacher_spec.rb +19 -6
  101. data/spec/unit/s3_helpers_spec.rb +22 -3
  102. data/spec/unit/software_spec.rb +59 -120
  103. data/spec/unit/util_spec.rb +1 -2
  104. metadata +21 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4a888a9f24e116ea9364773eebf3c9711652623d1000822c0c8f04287cce310
4
- data.tar.gz: bdea1d386922a7c85654c318fba2746667fe63025d55f491e95d520efab04ee5
3
+ metadata.gz: 2d82119c178b28f06df2bcd81c54b97ffbbe8b16b072021e3c86297e7ba76b9c
4
+ data.tar.gz: 0fd1477fe37432ec09256c115243b1a06eaa62911b741ba8a2dec730b9b8e42b
5
5
  SHA512:
6
- metadata.gz: b18ba881c3f75e78829b1b112e7a8679d4be330daf7b707a8ac39058d25c65dc55c9d009159edd8a70500c35617e49c4ea3a1713865f213a139dc35fe14c8da9
7
- data.tar.gz: 6f3f9ac8e6ef23fb3a10a093a9ca30367b115f9296bfaee37c9af2d3740a37a5d650cc2e4c464bebcaf32bd2db49eacd57dd1df9c303c57449247dc598725877
6
+ metadata.gz: 534731ae9d91c9b9108cb63e6bacf731817ae8e01a80d22615e93787e50ba148c4e7919934879c2b7bdf1bda51586cbe488648dc3c6c31b9d3684f489602fd02
7
+ data.tar.gz: 37bbc008548ed0ab0a1d20f958a81a19de17c47da4176ca263587cf11bfb6bffc31c50691d76ea9304e2c22223becfa1afa79de6682e32f8fe9f07d63e8ddd6e
data/Gemfile CHANGED
@@ -13,7 +13,3 @@ group :debug do
13
13
  gem "pry-byebug"
14
14
  gem "pry-stack_explorer"
15
15
  end
16
-
17
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5")
18
- gem "ohai", "<15"
19
- end
data/README.md CHANGED
@@ -25,8 +25,7 @@ This project is managed by the CHEF Release Engineering team. For more informati
25
25
 
26
26
  Omnibus is designed to run with a minimal set of prerequisites. You will need the following:
27
27
 
28
- - Ruby 2.4+
29
- - Bundler
28
+ - Ruby 2.6+
30
29
 
31
30
  ## Get Started
32
31
 
@@ -46,10 +45,11 @@ $ omnibus new $MY_PROJECT_NAME
46
45
 
47
46
  This will generate a complete project skeleton in the directory `omnibus-$MY_PROJECT_NAME`
48
47
 
48
+ By default this will make a directory called `omnibus-$MY_PROJECT_NAME` assuming you're keeping your omnibus config separate from the repo. However, keeping it *in* your repo is a common practice, so feel to rename this directory to `omnibus` and place it in the top level of your projects source repo.
49
+
49
50
  ```bash
50
51
  $ cd omnibus-$MY_PROJECT_NAME
51
52
  $ bundle install --binstubs
52
- $ bin/omnibus build $MY_PROJECT_NAME
53
53
  ```
54
54
 
55
55
  More details can be found in the generated project's README file.
@@ -84,11 +84,19 @@ use_git_caching false
84
84
  # Enable S3 asset caching
85
85
  # ------------------------------
86
86
  use_s3_caching true
87
+ s3_bucket ENV['S3_BUCKET']
88
+
89
+ # There are three ways to authenticate to the S3 bucket
90
+
91
+ # 1. set `s3_access_key` and `s3_secret_key`
87
92
  s3_access_key ENV['S3_ACCESS_KEY']
88
93
  s3_secret_key ENV['S3_SECRET_KEY']
89
- # You can use the Shared Credentials files in place of the s3_access_key and s3_secret_key.
94
+
95
+ # 2. set `s3_profile` to use an AWS profile in the Shared Credentials files
90
96
  #s3_profile ENV['S3_PROFILE']
91
- s3_bucket ENV['S3_BUCKET']
97
+
98
+ # 3. set `s3_iam_role_arn` to use an AWS IAM role
99
+ #s3_iam_role_arn ENV['S3_IAM_ROLE_ARN']
92
100
  ```
93
101
 
94
102
  For more information, please see the [`Config` documentation](http://www.rubydoc.info/github/chef/omnibus/Omnibus/Config).
@@ -135,7 +143,7 @@ DSL Method | Description
135
143
  `package` | Invoke a packager-specific DSL
136
144
  `compress` | Invoke a compressor-specific DSL
137
145
 
138
- By default a timestamp is appended to the build_version. You can turn this behavior off by setting `append_timestamp` to `false` in your configuration file or using `--override append_timestamp:false` at the command line.
146
+ By default a timestamp is appended to the build_version. You can turn this behavior off by setting `append_timestamp` to `false` in your `omnibus.rb` or using `--override append_timestamp:false` at the command line.
139
147
 
140
148
  For more information, please see the [`Project` documentation](http://www.rubydoc.info/github/chef/omnibus/Omnibus/Project).
141
149
 
@@ -253,12 +261,46 @@ For all of these paths, **order matters**, so it is possible to depend on local
253
261
  $PWD/config/software/foo.rb
254
262
  /path/to/software/config/software/foo.rb
255
263
  /other/path/to/software/config/software/foo.rb
256
- /Users/sethvargo/.gems/.../my-comany-omnibus-software/config/software/foo.rb
264
+ /Users/sethvargo/.gems/.../my-company-omnibus-software/config/software/foo.rb
257
265
  /Users/sethvargo/.gems/.../omnibus-software/config/software/foo.rb
258
266
  ```
259
267
 
260
268
  The first instance of `foo.rb` that is encountered will be used. Please note that **local** (vendored) softare definitions take precedence!
261
269
 
270
+ ## Building
271
+
272
+ Once you've created your package and software definitions you can build with:
273
+
274
+ ```shell
275
+ ./bin/omnibus build $MY_PACKAGE_NAME
276
+ ```
277
+
278
+ However there are several caveats to be aware of:
279
+
280
+ 1. You will almost certainly want to uncomment the `base_dir` in `omnibus.rb`,
281
+ or at the very least change `cache_dir` and `build_dir` as otherwise it'll try
282
+ to use `/var/cache/omnibus` and `/opt/$MY_PROJECT_NAME`, requiring root.
283
+ 1. The default configuration created for you references a lot of things
284
+ that are in the default config that come from the `omnibus-software` gem.
285
+ So you want to use those you'll need to either uncomment it in the `Gemfile`,
286
+ or fork it, and then reference your own
287
+ 1. If this is a ruby project and you want binstubs in `/opt/$project/bin`, you
288
+ will either need to use [appbundler](https://github.com/chef/appbundler), or
289
+ you will need to have a post install step to create those binstubs.
290
+ - Side note, appbundler requires that you include your Gemfile and gemspec
291
+ in your gem.
292
+ - Also, needs to be in your Gemfile for you to use it, as it also must
293
+ be in the resulting gem.
294
+ 1. If you specify an override of the version of the `ruby`, you will also need
295
+ to override `rubygems` and `bundler` to match the versions in that version of
296
+ `ruby` or you'll get failures around bundler version mismatches.
297
+
298
+ The build command above will of course build on your local host thus being
299
+ specific to the OS and base system you are on. But the skeleten setup by
300
+ `omnibus new` already setup kitchen for you so that it's easy to build for
301
+ a variety of OSes, See the `README.md` in your generated omnibus directory
302
+ for details.
303
+
262
304
  ## Version Manifest
263
305
 
264
306
  Git-based software definitions may specify branches as their default_version. In this case, the exact git revision to use will be determined at build-time unless a project override (see below) or external version manifest is used. To generate a version manifest use the `omnibus manifest` command:
@@ -273,7 +315,7 @@ This will output a JSON-formatted manifest containing the resolved version of ev
273
315
 
274
316
  Sometimes a platform has libraries that need to be whitelisted so the healthcheck can pass. The whitelist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms.
275
317
 
276
- To add your own whitelisted library, simply add the a regex to your software definition in your omnibus project as follows:
318
+ To add your own whitelisted library, simply add a regex to your software definition in your omnibus project as follows:
277
319
 
278
320
  ```
279
321
  whitelist_file /libpcrecpp\.so\..+/
@@ -289,11 +331,11 @@ STATUS: _EXPERIMENTAL_
289
331
 
290
332
  `omnibus changelog generate` will generate a changelog for an omnibus project. This command currently assumes:
291
333
 
292
- - version-manifest.json is checked into the project root
293
- - the project is a git repository
294
- - each version is tagged with a SemVer compliant annotated tag
334
+ - A version-manifest.json file is checked into the project root
335
+ - The project is a git repository
336
+ - Each version is tagged with a SemVer compliant annotated tag
295
337
  - Any git-based sources are checked out at ../COMPONENT_NAME
296
- - Any commit message line prepended with ChangeLog-Entry: should be added to the changelog.
338
+ - Any commit message line prepended with ChangeLog-Entry: should be added to the changelog
297
339
 
298
340
  These assumptions _will_ change as we determine what works best for a number of our projects.
299
341
 
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
3
  require "rspec/core/rake_task"
4
- [:unit, :functional].each do |type|
4
+ %i{unit functional}.each do |type|
5
5
  RSpec::Core::RakeTask.new(type) do |t|
6
6
  t.pattern = "spec/#{type}/**/*_spec.rb"
7
7
  t.rspec_opts = [].tap do |a|
@@ -4,7 +4,7 @@
4
4
  # https://twitter.com/mitchellh/status/283014103189053442
5
5
  Signal.trap("INT") { exit 1 }
6
6
 
7
- $:.push File.expand_path("../../lib", __FILE__)
7
+ $:.push File.expand_path("../lib", __dir__)
8
8
  $stdout.sync = true
9
9
 
10
10
  require "omnibus/cli"
@@ -17,7 +17,7 @@
17
17
  require "omnibus/core_extensions"
18
18
 
19
19
  require "cleanroom"
20
- require "pathname"
20
+ require "pathname" unless defined?(Pathname)
21
21
 
22
22
  require "omnibus/digestable"
23
23
  require "omnibus/exceptions"
@@ -208,7 +208,7 @@ module Omnibus
208
208
  # @return [Pathname]
209
209
  #
210
210
  def source_root
211
- @source_root ||= Pathname.new(File.expand_path("../..", __FILE__))
211
+ @source_root ||= Pathname.new(File.expand_path("..", __dir__))
212
212
  end
213
213
 
214
214
  #
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "time"
17
+ require "time" unless defined?(Time.zone_offset)
18
18
 
19
19
  module Omnibus
20
20
  # Provides methods for generating Omnibus project build version
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "time"
17
+ require "time" unless defined?(Time.zone_offset)
18
18
 
19
19
  module Omnibus
20
20
  class BuildVersionDSL
@@ -134,13 +134,12 @@ module Omnibus
134
134
  def has_timestamp?(version)
135
135
  _ver, build_info = version.split("+")
136
136
  return false if build_info.nil?
137
+
137
138
  build_info.split(".").any? do |part|
138
- begin
139
- Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
140
- true
141
- rescue ArgumentError
142
- false
143
- end
139
+ Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
140
+ true
141
+ rescue ArgumentError
142
+ false
144
143
  end
145
144
  end
146
145
 
@@ -14,10 +14,10 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "fileutils"
18
- require "mixlib/shellout"
19
- require "ostruct"
20
- require "pathname"
17
+ require "fileutils" unless defined?(FileUtils)
18
+ require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
19
+ require "ostruct" unless defined?(OpenStruct)
20
+ require "pathname" unless defined?(Pathname)
21
21
  require "omnibus/whitelist"
22
22
 
23
23
  module Omnibus
@@ -235,7 +235,8 @@ module Omnibus
235
235
  clean_patch_path = patch_path
236
236
  if windows?
237
237
  clean_patch_path = Pathname.new(patch_path).relative_path_from(
238
- Pathname.new(software.project_dir)).to_s
238
+ Pathname.new(software.project_dir)
239
+ ).to_s
239
240
  end
240
241
 
241
242
  if target
@@ -385,6 +386,7 @@ module Omnibus
385
386
  if app_software.nil?
386
387
  raise "could not find software definition for #{software_name}, add a dependency to it, or pass a lockdir argument to appbundle command."
387
388
  end
389
+
388
390
  app_software.project_dir
389
391
  end
390
392
 
@@ -500,8 +502,7 @@ module Omnibus
500
502
  render_template(source_path,
501
503
  destination: dest,
502
504
  mode: mode,
503
- variables: vars
504
- )
505
+ variables: vars)
505
506
  end
506
507
  end
507
508
  expose :erb
@@ -596,7 +597,7 @@ module Omnibus
596
597
  #
597
598
  def strip(path)
598
599
  regexp_ends = ".*(" + IGNORED_ENDINGS.map { |e| e.gsub(/\./, '\.') }.join("|") + ")$"
599
- regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(/\//, '\/') + ".*" }.join("|")
600
+ regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(%r{/}, '\/') + ".*" }.join("|")
600
601
  regexp = regexp_ends + "|" + regexp_patterns
601
602
 
602
603
  # Do not actually care if strip runs on non-strippable file, as its a no-op. Hence the `|| true` appended.
@@ -727,7 +728,7 @@ module Omnibus
727
728
  # config.guess.to. Default: "."
728
729
  # install [Array<Symbol>] parts of config.guess to copy.
729
730
  # Default: [:config_guess, :config_sub]
730
- def update_config_guess(target: ".", install: [:config_guess, :config_sub])
731
+ def update_config_guess(target: ".", install: %i{config_guess config_sub})
731
732
  build_commands << BuildCommand.new("update_config_guess `target: #{target} install: #{install.inspect}'") do
732
733
  config_guess_dir = "#{install_dir}/embedded/lib/config_guess"
733
734
  %w{config.guess config.sub}.each do |c|
@@ -8,9 +8,9 @@ module Omnibus
8
8
  end
9
9
 
10
10
  def print(new_version)
11
- puts "## #{new_version} (#{Time.now.strftime('%Y-%m-%d')})"
11
+ puts "## #{new_version} (#{Time.now.strftime("%Y-%m-%d")})"
12
12
  print_changelog
13
- if !diff.empty?
13
+ unless diff.empty?
14
14
  print_components
15
15
  puts ""
16
16
  end
@@ -23,7 +23,7 @@ module Omnibus
23
23
 
24
24
  def print_changelog(cl = changelog, indent = 0)
25
25
  cl.changelog_entries.each do |entry|
26
- puts "#{' ' * indent}* #{entry.sub("\n", "\n #{' ' * indent}")}\n"
26
+ puts "#{" " * indent}* #{entry.sub("\n", "\n #{" " * indent}")}\n"
27
27
  end
28
28
  end
29
29
 
@@ -36,6 +36,7 @@ module Omnibus
36
36
 
37
37
  def print_new_components
38
38
  return if diff.added.empty?
39
+
39
40
  puts "New Components"
40
41
  diff.added.each do |entry|
41
42
  puts "* #{entry[:name]} (#{entry[:new_version]})"
@@ -45,10 +46,11 @@ module Omnibus
45
46
 
46
47
  def print_updated_components
47
48
  return if diff.updated.empty?
49
+
48
50
  puts "Updated Components"
49
51
  diff.updated.each do |entry|
50
52
  puts sprintf("* %s (%.8s -> %.8s)",
51
- entry[:name], entry[:old_version], entry[:new_version])
53
+ entry[:name], entry[:old_version], entry[:new_version])
52
54
  repo_path = ::File.join(source_path, entry[:name].to_s)
53
55
  if entry[:source_type] == :git && ::File.directory?("#{repo_path}/.git")
54
56
  cl = ChangeLog.new(entry[:old_version], entry[:new_version], GitRepository.new("#{repo_path}"))
@@ -60,6 +62,7 @@ module Omnibus
60
62
 
61
63
  def print_removed_components
62
64
  return if diff.removed.empty?
65
+
63
66
  puts "Removed Components"
64
67
  diff.removed.each do |entry|
65
68
  puts "* #{entry[:name]} (#{entry[:old_version]})"
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "thor"
17
+ require "thor" unless defined?(Thor)
18
18
 
19
19
  module Omnibus
20
20
  class Cleaner < Thor::Group
@@ -48,16 +48,19 @@ module Omnibus
48
48
 
49
49
  def clean_package_dir
50
50
  return unless purge?
51
+
51
52
  FileSyncer.glob("#{Config.package_dir}/**/*").each(&method(:remove_file))
52
53
  end
53
54
 
54
55
  def clean_cache_dir
55
56
  return unless purge?
57
+
56
58
  FileSyncer.glob("#{Config.cache_dir}/**/*").each(&method(:remove_file))
57
59
  end
58
60
 
59
61
  def clean_install_dir
60
62
  return unless purge?
63
+
61
64
  remove_file(@project.install_dir)
62
65
  end
63
66
 
@@ -14,9 +14,9 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "thor"
17
+ require "thor" unless defined?(Thor)
18
18
  require "omnibus"
19
- require "ffi_yajl"
19
+ require "ffi_yajl" unless defined?(FFI_Yajl)
20
20
 
21
21
  module Omnibus
22
22
  class CLI < Command::Base
@@ -18,7 +18,7 @@ require "omnibus/changelog"
18
18
  require "omnibus/changelog_printer"
19
19
  require "omnibus/manifest_diff"
20
20
  require "omnibus/semantic_version"
21
- require "ffi_yajl"
21
+ require "ffi_yajl" unless defined?(FFI_Yajl)
22
22
 
23
23
  module Omnibus
24
24
  class Command::ChangeLog < Command::Base
@@ -30,42 +30,42 @@ module Omnibus
30
30
  # $ omnibus changelog generate
31
31
  #
32
32
  method_option :source_path,
33
- desc: "Path to local checkout of git dependencies",
34
- type: :string,
35
- default: "../"
33
+ desc: "Path to local checkout of git dependencies",
34
+ type: :string,
35
+ default: "../"
36
36
 
37
37
  method_option :starting_manifest,
38
- desc: "Path to version-manifest from the last version (we attempt to pull it from the git history if not given)",
39
- type: :string
38
+ desc: "Path to version-manifest from the last version (we attempt to pull it from the git history if not given)",
39
+ type: :string
40
40
 
41
41
  method_option :ending_manifest,
42
- desc: "Path to the version-manifest from the current version",
43
- type: :string,
44
- default: "version-manifest.json"
42
+ desc: "Path to the version-manifest from the current version",
43
+ type: :string,
44
+ default: "version-manifest.json"
45
45
 
46
46
  method_option :skip_components,
47
- desc: "Don't include component changes in the changelog",
48
- type: :boolean,
49
- default: false
47
+ desc: "Don't include component changes in the changelog",
48
+ type: :boolean,
49
+ default: false
50
50
 
51
51
  method_option :major,
52
- desc: "Bump the major version",
53
- type: :boolean,
54
- default: false
52
+ desc: "Bump the major version",
53
+ type: :boolean,
54
+ default: false
55
55
 
56
56
  method_option :minor,
57
- desc: "Bump the minor version",
58
- type: :boolean,
59
- default: true
57
+ desc: "Bump the minor version",
58
+ type: :boolean,
59
+ default: true
60
60
 
61
61
  method_option :patch,
62
- desc: "Bump the patch version",
63
- type: :boolean,
64
- default: false
62
+ desc: "Bump the patch version",
63
+ type: :boolean,
64
+ default: false
65
65
 
66
66
  method_option :version,
67
- desc: "Explicit version for this changelog",
68
- type: :string
67
+ desc: "Explicit version for this changelog",
68
+ type: :string
69
69
 
70
70
  desc "generate [START] [END]", "Generate a changelog for a new release"
71
71
  def generate(start_ref = nil, end_ref = nil)
@@ -78,8 +78,8 @@ module Omnibus
78
78
  end
79
79
 
80
80
  Omnibus::ChangeLogPrinter.new(ChangeLog.new(starting_revision, ending_revision),
81
- diff,
82
- @options[:source_path]).print(new_version)
81
+ diff,
82
+ @options[:source_path]).print(new_version)
83
83
  end
84
84
 
85
85
  private