omnibus 6.1.4 → 7.0.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) 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 +3 -4
  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 +3 -3
  37. data/lib/omnibus/ohai.rb +1 -1
  38. data/lib/omnibus/package.rb +1 -1
  39. data/lib/omnibus/packager.rb +1 -0
  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 -32
  58. data/lib/omnibus/templating.rb +2 -2
  59. data/lib/omnibus/thread_pool.rb +0 -2
  60. data/lib/omnibus/util.rb +4 -3
  61. data/lib/omnibus/version.rb +1 -1
  62. data/lib/omnibus/whitelist.rb +27 -1
  63. data/omnibus.gemspec +8 -9
  64. data/resources/ips/doc-transform.erb +1 -0
  65. data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
  66. data/resources/rpm/signing.erb +7 -10
  67. data/spec/functional/builder_spec.rb +2 -1
  68. data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
  69. data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
  70. data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
  71. data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
  72. data/spec/functional/licensing_spec.rb +5 -5
  73. data/spec/support/examples.rb +3 -4
  74. data/spec/support/path_helpers.rb +2 -2
  75. data/spec/unit/builder_spec.rb +9 -9
  76. data/spec/unit/changelogprinter_spec.rb +8 -6
  77. data/spec/unit/compressor_spec.rb +3 -3
  78. data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
  79. data/spec/unit/health_check_spec.rb +2 -6
  80. data/spec/unit/library_spec.rb +2 -1
  81. data/spec/unit/manifest_diff_spec.rb +2 -2
  82. data/spec/unit/manifest_spec.rb +1 -1
  83. data/spec/unit/metadata_spec.rb +9 -11
  84. data/spec/unit/omnibus_spec.rb +1 -1
  85. data/spec/unit/packagers/bff_spec.rb +2 -2
  86. data/spec/unit/packagers/ips_spec.rb +1 -0
  87. data/spec/unit/packagers/msi_spec.rb +2 -2
  88. data/spec/unit/packagers/pkg_spec.rb +354 -0
  89. data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
  90. data/spec/unit/packagers/solaris_spec.rb +7 -7
  91. data/spec/unit/project_spec.rb +2 -2
  92. data/spec/unit/publisher_spec.rb +1 -2
  93. data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
  94. data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
  95. data/spec/unit/s3_cacher_spec.rb +19 -6
  96. data/spec/unit/s3_helpers_spec.rb +22 -3
  97. data/spec/unit/software_spec.rb +72 -42
  98. data/spec/unit/util_spec.rb +1 -2
  99. metadata +18 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5094211ab9d21742c4b0df1f711cd73b8f7ac9c275886fa4411a7ac8683fb287
4
- data.tar.gz: 370b50282eb2a4d9ab9cfae046dce0856957e3ee672f7138df19f4e52e59b0f4
3
+ metadata.gz: c40c81af2fa93ca8c9e87d9e49a37cef3ea8145355700490d0ad5ce1a71cd169
4
+ data.tar.gz: c31ffa9da067d89db43aaff9963408ed4f56150abeb295f4e0733787f001df13
5
5
  SHA512:
6
- metadata.gz: 763997a408440c9194de3596088d6936d9c86a4ffdc67506058d82518580d4dcd25d314885fa592472dbc3796ff958ddbae957e9708456e8c0c138422ac726f7
7
- data.tar.gz: ad013568c56d30105bdac1715fff11632e24ef91542ab8658e5f6fd0d710b5fc6ddd734210cf8e0e8927d579bd2441cdc55fcc6c387ec921acb8914b87ce192a
6
+ metadata.gz: 8d309f0c4d0cb1e0ecc57dcd5aac4c21e5be7b4b71781e5a0c134a723721963e248c673b969398c5b6dd733cc0eabf18bcbb965d122f3b4f5b788634f98d522a
7
+ data.tar.gz: 5db4091ae7e877d04705089c14e8401816ca1ac8828c99e160b8161109892956c2f348dbf9cbca95f03414cd051e3240d58402867592892b2b20fcef464f20ab
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