omnibus 3.2.2 → 4.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (302) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +140 -10
  3. data/CHANGELOG.md +181 -8
  4. data/README.md +63 -35
  5. data/Rakefile +1 -1
  6. data/docs/omnibus-build-cache.md b/data/docs/Build → Cache.md +0 -0
  7. data/docs/Building on Debian.md +59 -0
  8. data/docs/Building on OSX.md +61 -35
  9. data/docs/Building on RHEL.md +74 -0
  10. data/docs/Building on Windows.md +40 -81
  11. data/features/commands/build.feature +1 -2
  12. data/features/commands/clean.feature +1 -1
  13. data/lib/omnibus.rb +111 -204
  14. data/lib/omnibus/build_version.rb +3 -20
  15. data/lib/omnibus/build_version_dsl.rb +2 -3
  16. data/lib/omnibus/builder.rb +103 -211
  17. data/lib/omnibus/cleaner.rb +5 -7
  18. data/lib/omnibus/cli.rb +1 -4
  19. data/lib/omnibus/cli/base.rb +9 -16
  20. data/lib/omnibus/compressor.rb +60 -0
  21. data/{spec/data/complicated/config/software/version-manifest.rb → lib/omnibus/compressors/base.rb} +17 -12
  22. data/lib/omnibus/compressors/dmg.rb +312 -0
  23. data/lib/omnibus/{null_builder.rb → compressors/null.rb} +10 -4
  24. data/lib/omnibus/compressors/tgz.rb +141 -0
  25. data/lib/omnibus/config.rb +89 -83
  26. data/lib/omnibus/core_extensions.rb +1 -0
  27. data/lib/omnibus/core_extensions/open_uri.rb +58 -0
  28. data/lib/omnibus/digestable.rb +9 -3
  29. data/lib/omnibus/exceptions.rb +116 -175
  30. data/lib/omnibus/fetcher.rb +97 -138
  31. data/lib/omnibus/fetchers/git_fetcher.rb +130 -165
  32. data/lib/omnibus/fetchers/net_fetcher.rb +205 -164
  33. data/lib/omnibus/fetchers/{s3_cache_fetcher.rb → null_fetcher.rb} +27 -17
  34. data/lib/omnibus/fetchers/path_fetcher.rb +74 -32
  35. data/lib/omnibus/file_syncer.rb +149 -0
  36. data/lib/omnibus/generator.rb +103 -32
  37. data/lib/omnibus/generator_files/.kitchen.yml.erb +5 -1
  38. data/lib/omnibus/generator_files/Gemfile.erb +13 -7
  39. data/lib/omnibus/generator_files/config/projects/project.rb.erb +28 -0
  40. data/lib/omnibus/generator_files/config/software/zlib.rb.erb +55 -0
  41. data/lib/omnibus/generator_files/omnibus.rb.erb +5 -7
  42. data/lib/omnibus/git_cache.rb +11 -13
  43. data/lib/omnibus/logger.rb +76 -22
  44. data/lib/omnibus/logging.rb +1 -1
  45. data/lib/omnibus/metadata.rb +264 -0
  46. data/lib/omnibus/ohai.rb +0 -51
  47. data/lib/omnibus/package.rb +4 -228
  48. data/lib/omnibus/packager.rb +71 -0
  49. data/lib/omnibus/packagers/base.rb +118 -176
  50. data/lib/omnibus/packagers/bff.rb +136 -0
  51. data/lib/omnibus/packagers/deb.rb +389 -0
  52. data/lib/omnibus/packagers/makeself.rb +114 -0
  53. data/lib/omnibus/packagers/msi.rb +346 -0
  54. data/lib/omnibus/packagers/pkg.rb +278 -0
  55. data/lib/omnibus/packagers/rpm.rb +438 -0
  56. data/lib/omnibus/packagers/solaris.rb +110 -0
  57. data/lib/omnibus/project.rb +263 -666
  58. data/lib/omnibus/publisher.rb +3 -3
  59. data/lib/omnibus/s3_cache.rb +21 -30
  60. data/lib/omnibus/software.rb +132 -271
  61. data/lib/omnibus/templating.rb +66 -0
  62. data/lib/omnibus/thread_pool.rb +109 -0
  63. data/lib/omnibus/util.rb +137 -15
  64. data/lib/omnibus/version.rb +1 -1
  65. data/omnibus.gemspec +2 -2
  66. data/resources/bff/gen.template.erb +22 -0
  67. data/resources/bff/postinstall.sh +0 -0
  68. data/resources/bff/unpostinstall.sh +0 -0
  69. data/resources/deb/conffiles.erb +3 -0
  70. data/resources/deb/control.erb +25 -0
  71. data/resources/deb/md5sums.erb +3 -0
  72. data/{lib/omnibus/generator_files/mac_dmg → resources/dmg}/background.png +0 -0
  73. data/resources/dmg/create_dmg.osascript.erb +17 -0
  74. data/{lib/omnibus/generator_files/mac_dmg → resources/dmg}/icon.png +0 -0
  75. data/{bin → resources/makeself}/makeself-header.sh +0 -0
  76. data/{bin → resources/makeself}/makeself.sh +0 -0
  77. data/{lib/omnibus/generator_files/package_scripts/makeselfinst.erb → resources/makeself/post_extract.sh.erb} +4 -4
  78. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/LICENSE.rtf +0 -0
  79. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/banner_background.bmp +0 -0
  80. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/dialog_background.bmp +0 -0
  81. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project.ico +0 -0
  82. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project_16x16.ico +0 -0
  83. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project_32x32.ico +0 -0
  84. data/{spec/fixtures/sample/files/windows_msi/Resources/localization-en-us.wxl → resources/msi/localization-en-us.wxl.erb} +3 -4
  85. data/resources/msi/parameters.wxi.erb +9 -0
  86. data/{lib/omnibus/generator_files/windows_msi → resources/msi}/source.wxs.erb +14 -15
  87. data/{lib/omnibus/generator_files/mac_pkg → resources/pkg}/background.png +0 -0
  88. data/resources/pkg/distribution.xml.erb +21 -0
  89. data/resources/pkg/license.html.erb +3 -0
  90. data/resources/pkg/welcome.html.erb +7 -0
  91. data/resources/rpm/rpmmacros.erb +3 -0
  92. data/resources/rpm/signing.erb +40 -0
  93. data/resources/rpm/spec.erb +70 -0
  94. data/spec/functional/builder_spec.rb +90 -111
  95. data/spec/functional/fetchers/git_fetcher_spec.rb +130 -0
  96. data/spec/functional/fetchers/net_fetcher_spec.rb +110 -0
  97. data/spec/functional/fetchers/path_fetcher_spec.rb +97 -0
  98. data/spec/functional/file_syncer_spec.rb +206 -0
  99. data/spec/functional/templating_spec.rb +73 -0
  100. data/spec/spec_helper.rb +31 -94
  101. data/spec/support/env_helpers.rb +20 -0
  102. data/spec/support/examples.rb +56 -0
  103. data/spec/support/file_helpers.rb +46 -0
  104. data/spec/support/git_helpers.rb +107 -0
  105. data/spec/support/logging_helpers.rb +33 -0
  106. data/spec/support/matchers.rb +36 -0
  107. data/spec/support/ohai_helpers.rb +22 -0
  108. data/spec/support/path_helpers.rb +19 -0
  109. data/spec/support/shell_helpers.rb +14 -0
  110. data/spec/unit/build_version_dsl_spec.rb +0 -17
  111. data/spec/unit/build_version_spec.rb +1 -19
  112. data/spec/unit/builder_spec.rb +158 -46
  113. data/spec/unit/compressor_spec.rb +45 -0
  114. data/spec/unit/compressors/base_spec.rb +26 -0
  115. data/spec/unit/compressors/dmg_spec.rb +291 -0
  116. data/spec/unit/compressors/null_spec.rb +23 -0
  117. data/spec/unit/compressors/tgz_spec.rb +67 -0
  118. data/spec/unit/config_spec.rb +27 -34
  119. data/spec/unit/digestable_spec.rb +4 -4
  120. data/spec/unit/fetchers/git_fetcher_spec.rb +110 -39
  121. data/spec/unit/fetchers/net_fetcher_spec.rb +182 -72
  122. data/spec/unit/fetchers/path_fetcher_spec.rb +111 -0
  123. data/spec/unit/generator_spec.rb +137 -0
  124. data/spec/unit/git_cache_spec.rb +24 -34
  125. data/spec/unit/library_spec.rb +21 -82
  126. data/spec/unit/metadata_spec.rb +207 -0
  127. data/spec/unit/ohai_spec.rb +0 -7
  128. data/spec/unit/omnibus_spec.rb +41 -36
  129. data/spec/unit/package_spec.rb +1 -216
  130. data/spec/unit/packagers/base_spec.rb +76 -190
  131. data/spec/unit/packagers/bff_spec.rb +160 -0
  132. data/spec/unit/packagers/deb_spec.rb +324 -0
  133. data/spec/unit/packagers/makeself_spec.rb +80 -0
  134. data/spec/unit/packagers/msi_spec.rb +267 -0
  135. data/spec/unit/packagers/pkg_spec.rb +219 -0
  136. data/spec/unit/packagers/rpm_spec.rb +328 -0
  137. data/spec/unit/project_spec.rb +217 -80
  138. data/spec/unit/publisher_spec.rb +6 -2
  139. data/spec/unit/publishers/artifactory_publisher_spec.rb +1 -1
  140. data/spec/unit/publishers/s3_publisher_spec.rb +1 -1
  141. data/spec/unit/s3_cacher_spec.rb +22 -5
  142. data/spec/unit/software_spec.rb +89 -232
  143. data/spec/unit/util_spec.rb +188 -0
  144. metadata +159 -402
  145. data/features/commands/_deprecated.feature +0 -84
  146. data/lib/omnibus/cleanroom.rb +0 -141
  147. data/lib/omnibus/cli/deprecated.rb +0 -132
  148. data/lib/omnibus/generator_files/mac_pkg/license.html.erb +0 -1
  149. data/lib/omnibus/generator_files/mac_pkg/welcome.html.erb +0 -9
  150. data/lib/omnibus/generator_files/project.rb.erb +0 -20
  151. data/lib/omnibus/generator_files/software/c-example.rb.erb +0 -42
  152. data/lib/omnibus/generator_files/software/erlang-example.rb.erb +0 -38
  153. data/lib/omnibus/generator_files/software/ruby-example.rb.erb +0 -24
  154. data/lib/omnibus/generator_files/windows_msi/localization-en-us.wxl.erb +0 -20
  155. data/lib/omnibus/generator_files/windows_msi/parameters.wxi.erb +0 -9
  156. data/lib/omnibus/packagers/mac_dmg.rb +0 -235
  157. data/lib/omnibus/packagers/mac_pkg.rb +0 -176
  158. data/lib/omnibus/packagers/windows_msi.rb +0 -109
  159. data/spec/data/complicated/config/patches/bzip2/makefile_take_env_vars.patch +0 -15
  160. data/spec/data/complicated/config/patches/couchdb/patch_for_couchjs_stack.patch +0 -19
  161. data/spec/data/complicated/config/patches/gd/gd-2.0.33-configure-libpng.patch +0 -100
  162. data/spec/data/complicated/config/patches/keepalived/keepalived-1.2.9_opscode_centos_5.patch +0 -15
  163. data/spec/data/complicated/config/patches/libedit/freebsd-vi-fix.patch +0 -24
  164. data/spec/data/complicated/config/patches/libiconv/libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch +0 -29
  165. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-makefile-dest-fix.patch +0 -35
  166. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-malloc-fix.patch +0 -13
  167. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch +0 -1035
  168. data/spec/data/complicated/config/patches/logrotate/logrotate_basedir_override.patch +0 -12
  169. data/spec/data/complicated/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch +0 -11
  170. data/spec/data/complicated/config/patches/ncurses/ncurses-clang.patch +0 -42
  171. data/spec/data/complicated/config/patches/ncurses/patch-aa +0 -23
  172. data/spec/data/complicated/config/patches/ncurses/patch-ab +0 -44
  173. data/spec/data/complicated/config/patches/ncurses/patch-ac +0 -40
  174. data/spec/data/complicated/config/patches/ncurses/patch-ad +0 -12
  175. data/spec/data/complicated/config/patches/ncurses/patch-aix-configure +0 -23
  176. data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesf.h +0 -22
  177. data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesm.h +0 -22
  178. data/spec/data/complicated/config/patches/nrpe/fix_for_runit.patch +0 -64
  179. data/spec/data/complicated/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch +0 -101
  180. data/spec/data/complicated/config/patches/postgresql/postgresql-9.1.2-configure-ncurses-fix.patch +0 -12
  181. data/spec/data/complicated/config/patches/ruby/patch-configure +0 -103
  182. data/spec/data/complicated/config/patches/ruby/ruby-aix-configure.patch +0 -10
  183. data/spec/data/complicated/config/patches/ruby/ruby-openssl-1.0.1c.patch +0 -42
  184. data/spec/data/complicated/config/patches/ruby/ruby_aix_1_9_3_448_ssl_EAGAIN.patch +0 -57
  185. data/spec/data/complicated/config/patches/ruby/rvm-cflags.patch +0 -27
  186. data/spec/data/complicated/config/projects/angrychef.rb +0 -32
  187. data/spec/data/complicated/config/projects/chef-windows.rb +0 -32
  188. data/spec/data/complicated/config/projects/chef.rb +0 -32
  189. data/spec/data/complicated/config/projects/chefdk-windows.rb +0 -41
  190. data/spec/data/complicated/config/projects/chefdk.rb +0 -44
  191. data/spec/data/complicated/config/software/appbundler.rb +0 -25
  192. data/spec/data/complicated/config/software/autoconf.rb +0 -35
  193. data/spec/data/complicated/config/software/automake.rb +0 -39
  194. data/spec/data/complicated/config/software/berkshelf.rb +0 -44
  195. data/spec/data/complicated/config/software/bundler.rb +0 -25
  196. data/spec/data/complicated/config/software/bzip2.rb +0 -46
  197. data/spec/data/complicated/config/software/cacerts.rb +0 -44
  198. data/spec/data/complicated/config/software/chef-client-msi.rb +0 -87
  199. data/spec/data/complicated/config/software/chef-gem.rb +0 -26
  200. data/spec/data/complicated/config/software/chef-vault.rb +0 -43
  201. data/spec/data/complicated/config/software/chef-windows.rb +0 -158
  202. data/spec/data/complicated/config/software/chef.rb +0 -170
  203. data/spec/data/complicated/config/software/chefdk.rb +0 -103
  204. data/spec/data/complicated/config/software/couchdb.rb +0 -53
  205. data/spec/data/complicated/config/software/curl.rb +0 -48
  206. data/spec/data/complicated/config/software/erlang.rb +0 -65
  207. data/spec/data/complicated/config/software/expat.rb +0 -21
  208. data/spec/data/complicated/config/software/fcgi.rb +0 -56
  209. data/spec/data/complicated/config/software/fcgiwrap.rb +0 -41
  210. data/spec/data/complicated/config/software/gd.rb +0 -56
  211. data/spec/data/complicated/config/software/gdbm.rb +0 -40
  212. data/spec/data/complicated/config/software/gecode.rb +0 -48
  213. data/spec/data/complicated/config/software/git.rb +0 -40
  214. data/spec/data/complicated/config/software/help2man.rb +0 -30
  215. data/spec/data/complicated/config/software/icu.rb +0 -40
  216. data/spec/data/complicated/config/software/jre.rb +0 -48
  217. data/spec/data/complicated/config/software/keepalived.rb +0 -43
  218. data/spec/data/complicated/config/software/libarchive.rb +0 -50
  219. data/spec/data/complicated/config/software/libedit.rb +0 -69
  220. data/spec/data/complicated/config/software/libffi.rb +0 -71
  221. data/spec/data/complicated/config/software/libgcc.rb +0 -39
  222. data/spec/data/complicated/config/software/libiconv.rb +0 -55
  223. data/spec/data/complicated/config/software/libjpeg.rb +0 -39
  224. data/spec/data/complicated/config/software/libpng.rb +0 -38
  225. data/spec/data/complicated/config/software/libtool.rb +0 -52
  226. data/spec/data/complicated/config/software/libwrap.rb +0 -50
  227. data/spec/data/complicated/config/software/libxml2.rb +0 -51
  228. data/spec/data/complicated/config/software/libxslt.rb +0 -52
  229. data/spec/data/complicated/config/software/libyaml-windows.rb +0 -43
  230. data/spec/data/complicated/config/software/libyaml.rb +0 -62
  231. data/spec/data/complicated/config/software/logrotate.rb +0 -41
  232. data/spec/data/complicated/config/software/makedepend.rb +0 -73
  233. data/spec/data/complicated/config/software/mysql2.rb +0 -42
  234. data/spec/data/complicated/config/software/nagios-plugins.rb +0 -53
  235. data/spec/data/complicated/config/software/nagios.rb +0 -66
  236. data/spec/data/complicated/config/software/ncurses.rb +0 -149
  237. data/spec/data/complicated/config/software/nginx.rb +0 -40
  238. data/spec/data/complicated/config/software/nodejs.rb +0 -44
  239. data/spec/data/complicated/config/software/nokogiri.rb +0 -55
  240. data/spec/data/complicated/config/software/nrpe.rb +0 -61
  241. data/spec/data/complicated/config/software/ohai.rb +0 -64
  242. data/spec/data/complicated/config/software/omnibus-ctl.rb +0 -34
  243. data/spec/data/complicated/config/software/openresty.rb +0 -67
  244. data/spec/data/complicated/config/software/openssl.rb +0 -158
  245. data/spec/data/complicated/config/software/pcre.rb +0 -42
  246. data/spec/data/complicated/config/software/perl-extutils-embed.rb +0 -15
  247. data/spec/data/complicated/config/software/perl-extutils-makemaker.rb +0 -15
  248. data/spec/data/complicated/config/software/perl.rb +0 -48
  249. data/spec/data/complicated/config/software/perl_pg_driver.rb +0 -12
  250. data/spec/data/complicated/config/software/php.rb +0 -41
  251. data/spec/data/complicated/config/software/pip.rb +0 -30
  252. data/spec/data/complicated/config/software/pkg-config.rb +0 -66
  253. data/spec/data/complicated/config/software/popt.rb +0 -47
  254. data/spec/data/complicated/config/software/postgresql.rb +0 -51
  255. data/spec/data/complicated/config/software/preparation.rb +0 -30
  256. data/spec/data/complicated/config/software/pygments.rb +0 -25
  257. data/spec/data/complicated/config/software/python.rb +0 -49
  258. data/spec/data/complicated/config/software/rabbitmq.rb +0 -36
  259. data/spec/data/complicated/config/software/rebar.rb +0 -36
  260. data/spec/data/complicated/config/software/redis.rb +0 -33
  261. data/spec/data/complicated/config/software/rsync.rb +0 -48
  262. data/spec/data/complicated/config/software/ruby-windows-devkit.rb +0 -30
  263. data/spec/data/complicated/config/software/ruby-windows.rb +0 -30
  264. data/spec/data/complicated/config/software/ruby.rb +0 -162
  265. data/spec/data/complicated/config/software/rubygems-customization.rb +0 -57
  266. data/spec/data/complicated/config/software/rubygems.rb +0 -37
  267. data/spec/data/complicated/config/software/runit.rb +0 -118
  268. data/spec/data/complicated/config/software/server-jre.rb +0 -46
  269. data/spec/data/complicated/config/software/setuptools.rb +0 -30
  270. data/spec/data/complicated/config/software/spawn-fcgi.rb +0 -40
  271. data/spec/data/complicated/config/software/sphinx.rb +0 -26
  272. data/spec/data/complicated/config/software/spidermonkey.rb +0 -60
  273. data/spec/data/complicated/config/software/sqitch.rb +0 -24
  274. data/spec/data/complicated/config/software/test-kitchen.rb +0 -39
  275. data/spec/data/complicated/config/software/unicorn.rb +0 -27
  276. data/spec/data/complicated/config/software/util-macros.rb +0 -46
  277. data/spec/data/complicated/config/software/xproto.rb +0 -46
  278. data/spec/data/complicated/config/software/yajl.rb +0 -30
  279. data/spec/data/complicated/config/software/zlib.rb +0 -67
  280. data/spec/data/overrides/bad_line.overrides +0 -3
  281. data/spec/data/overrides/good.overrides +0 -5
  282. data/spec/data/overrides/with_dupes.overrides +0 -4
  283. data/spec/data/projects/chefdk.rb +0 -41
  284. data/spec/data/projects/sample.rb +0 -13
  285. data/spec/data/software/erchef.rb +0 -42
  286. data/spec/data/software/zlib.rb +0 -67
  287. data/spec/fixtures/sample/files/mac_dmg/Resources/background.png +0 -0
  288. data/spec/fixtures/sample/files/mac_dmg/Resources/icon.png +0 -0
  289. data/spec/fixtures/sample/files/mac_pkg/Resources/background.png +0 -0
  290. data/spec/fixtures/sample/files/mac_pkg/Resources/license.html +0 -1
  291. data/spec/fixtures/sample/files/mac_pkg/Resources/welcome.html +0 -9
  292. data/spec/fixtures/sample/files/windows_msi/Resources/assets/LICENSE.rtf +0 -8
  293. data/spec/fixtures/sample/files/windows_msi/Resources/assets/banner_background.bmp +0 -0
  294. data/spec/fixtures/sample/files/windows_msi/Resources/assets/dialog_background.bmp +0 -0
  295. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project.ico +0 -0
  296. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_16x16.ico +0 -0
  297. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_32x32.ico +0 -0
  298. data/spec/fixtures/sample/files/windows_msi/Resources/parameters.wxi.erb +0 -9
  299. data/spec/fixtures/sample/files/windows_msi/Resources/source.wxs +0 -74
  300. data/spec/integration/packagers/mac_spec.rb +0 -58
  301. data/spec/integration/packagers/windows_spec.rb +0 -70
  302. data/spec/unit/packagers/mac_pkg_spec.rb +0 -151
@@ -0,0 +1,3 @@
1
+ <% md5sums.each do |path, checksum| -%>
2
+ <%= checksum %> <%= path %>
3
+ <% end -%>
@@ -0,0 +1,17 @@
1
+ tell application "Finder"
2
+ tell disk "<%= volume_name %>"
3
+ open
4
+ set current view of container window to icon view
5
+ set toolbar visible of container window to false
6
+ set statusbar visible of container window to false
7
+ set the bounds of container window to {<%= window_bounds %>}
8
+ set theViewOptions to the icon view options of container window
9
+ set arrangement of theViewOptions to not arranged
10
+ set icon size of theViewOptions to 72
11
+ set background picture of theViewOptions to file ".support:background.png"
12
+ delay 5
13
+ set position of item "<%= pkg_name %>" of container window to {<%= pkg_position %>}
14
+ update without registering applications
15
+ delay 5
16
+ end tell
17
+ end tell
File without changes
@@ -1,12 +1,12 @@
1
1
  #!/bin/bash
2
2
  #
3
- # Install a full <%= config[:name] %>
3
+ # Installs <%= friendly_name %>
4
4
  #
5
5
 
6
6
  PROGNAME=`basename $0`
7
7
  INSTALLER_DIR=`dirname $0`
8
- DEST_DIR=<%= config[:install_dir] %>
9
- CONFIG_DIR=/etc/<%= config[:name] %>
8
+ DEST_DIR=<%= install_dir %>
9
+ CONFIG_DIR=/etc/<%= name %>
10
10
  USAGE="usage: $0"
11
11
 
12
12
  error_exit()
@@ -22,6 +22,6 @@ cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR"
22
22
  rm -f $DEST_DIR/$PROGNAME
23
23
 
24
24
  # You may want to symlink your packages bin files into /usr/bin
25
- # ln -sf $DEST_DIR/bin/<%= config[:name] %> /usr/bin || error_exit "Cannot link <%= config[:name] %> to /usr/bin"
25
+ # ln -sf $DEST_DIR/bin/<%= name %> /usr/bin || error_exit "Cannot link <%= name %> to /usr/bin"
26
26
 
27
27
  exit 0
@@ -1,9 +1,8 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
3
- <!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl -->
4
3
  <String Id="LANG">1033</String>
5
- <String Id="ProductName">Sample</String>
6
- <String Id="ManufacturerName">Chef</String>
4
+ <String Id="ProductName"><%= friendly_name %></String>
5
+ <String Id="ManufacturerName"><%= maintainer %></String>
7
6
  <String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String>
8
7
 
9
8
  <String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String>
@@ -16,5 +15,5 @@
16
15
 
17
16
  <String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String>
18
17
 
19
- <String Id="FeatureMainName">Sample</String>
18
+ <String Id="FeatureMainName"><%= friendly_name %></String>
20
19
  </WixLocalization>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Include>
3
+ <?define VersionNumber="<%= version %>" ?>
4
+ <?define DisplayVersionNumber="<%= display_version %>" ?>
5
+ <?define UpgradeCode="<%= upgrade_code %>" ?>
6
+ <% parameters.each do |key, value| -%>
7
+ <?define <%= key %>="<%= value %>" ?>
8
+ <% end -%>
9
+ </Include>
@@ -15,15 +15,14 @@
15
15
  Define the minimum supported installer version (2.0).
16
16
  The install should be done for the whole machine not just the current user
17
17
  -->
18
- <Package InstallerVersion="200" InstallPrivileges="elevated"
19
- Compressed="yes" InstallScope="perMachine" />
18
+ <Package InstallerVersion="200" InstallPrivileges="elevated" Compressed="yes" InstallScope="perMachine" />
20
19
 
21
20
  <Media Id="1" Cabinet="Project.cab" EmbedCab="yes" CompressionLevel="high" />
22
21
 
23
22
  <!-- Major upgrade -->
24
23
  <Upgrade Id="$(var.UpgradeCode)">
25
24
  <UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" />
26
- <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.VersionNumber)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
25
+ <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.VersionNumber)" IncludeMaximum="yes" Property="OLDERVERSIONBEINGUPGRADED" />
27
26
  </Upgrade>
28
27
 
29
28
  <InstallExecuteSequence>
@@ -31,27 +30,28 @@
31
30
  </InstallExecuteSequence>
32
31
 
33
32
  <Directory Id="TARGETDIR" Name="SourceDir">
34
- <Directory Id="WindowsVolume">
35
- <!-- Service needs chef directory to be present. -->
36
- <Directory Id="INSTALLLOCATION" Name="opt">
37
- <Directory Id="PROJECTLOCATION" Name="<%= config[:name] %>">
38
- </Directory>
39
- </Directory>
33
+ <Directory Id="WINDOWSVOLUME">
34
+ <% hierarchy.each.with_index do |(name, id), index| -%>
35
+ <%= ' '*index %><Directory Id="<%= id %>" Name="<%= name %>">
36
+ <% end -%>
37
+ <% hierarchy.keys.each.with_index do |_, index| -%>
38
+ <%= ' '*(hierarchy.size - index-1) %></Directory>
39
+ <% end -%>
40
40
  </Directory>
41
41
  </Directory>
42
42
 
43
+ <SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]" />
44
+
43
45
  <!-- Set the components defined in our fragment files that will be used for our feature -->
44
- <Feature Id="ProjectFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="INSTALLLOCATION">
46
+ <Feature Id="ProjectFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="<%= wix_install_dir %>">
45
47
  <ComponentGroupRef Id="ProjectDir" />
46
48
  </Feature>
47
49
 
48
- <!--
49
- UI Stuff
50
- -->
50
+ <!-- UI Stuff -->
51
51
  <Icon Id="project.ico" SourceFile="Resources\assets\project_16x16.ico"/>
52
52
  <Property Id="ARPPRODUCTICON" Value="project.ico" />
53
53
  <Property Id="ARPHELPLINK" Value="http://www.getchef.com/" />
54
- <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
54
+ <Property Id="WIXUI_INSTALLDIR" Value="<%= wix_install_dir %>" />
55
55
 
56
56
  <UIRef Id="ProjectUI_InstallDir"/>
57
57
  <UI Id="ProjectUI_InstallDir">
@@ -69,6 +69,5 @@
69
69
  <WixVariable Id="WixUIInfoIco" Value="Resources\assets\project_32x32.ico" />
70
70
  <WixVariable Id="WixUINewIco" Value="Resources\assets\project_16x16.ico" />
71
71
  <WixVariable Id="WixUIUpIco" Value="Resources\assets\project_16x16.ico" />
72
-
73
72
  </Product>
74
73
  </Wix>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <installer-gui-script minSpecVersion="1">
3
+ <title><%= friendly_name %></title>
4
+ <background file="background.png" alignment="bottomleft" mime-type="image/png"/>
5
+ <welcome file="welcome.html" mime-type="text/html"/>
6
+ <license file="license.html" mime-type="text/html"/>
7
+
8
+ <!-- Generated by productbuild - - synthesize -->
9
+ <pkg-ref id="<%= identifier %>"/>
10
+ <options customize="never" require-scripts="false"/>
11
+ <choices-outline>
12
+ <line choice="default">
13
+ <line choice="<%= identifier %>"/>
14
+ </line>
15
+ </choices-outline>
16
+ <choice id="default"/>
17
+ <choice id="<%= identifier %>" visible="false">
18
+ <pkg-ref id="<%= identifier %>"/>
19
+ </choice>
20
+ <pkg-ref id="<%= identifier %>" version="<%= version %>" onConclusion="none"><%= component_pkg %></pkg-ref>
21
+ </installer-gui-script>
@@ -0,0 +1,3 @@
1
+ All Rights Reserved
2
+
3
+ This is a generic Omnibus license file for <%= friendly_name %>. If you are building Mac OS X packages, you should generate a custom license file and description to suit your needs.
@@ -0,0 +1,7 @@
1
+ This will install <%= friendly_name %> on your Mac.
2
+
3
+ --------------------------------------------------
4
+
5
+ This is a generic Omnibus welcome message. If you are building Mac OS X packages, you should generate a custom welcome file to suit your needs.
6
+
7
+ If you are not the creator of <%= friendly_name %>, the presence of this message is likely a bug and should be reported to the creator.
@@ -0,0 +1,3 @@
1
+ %_signature gpg
2
+ %_gpg_path <%= gpg_path %>
3
+ %_gpg_name <%= gpg_name %>
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ unless (rpm_cmd = ARGV[0])
4
+ STDERR.puts 'Usage: sign-rpm RPM_COMMAND'
5
+ exit 1
6
+ end
7
+
8
+ password = '<%= passphrase %>'
9
+
10
+ require 'pty'
11
+
12
+ puts rpm_cmd
13
+ PTY.spawn(rpm_cmd) do |r, w, pid|
14
+ prompt = r.read(19)
15
+
16
+ # match the expected prompt exactly, since that's the only way we know if
17
+ # something went wrong.
18
+ unless prompt == 'Enter pass phrase: '
19
+ STDERR.puts "unexpected output from `#{rpm_cmd}`: '#{prompt}'"
20
+ Process.kill(:KILL, pid)
21
+ exit 1
22
+ end
23
+
24
+ STDOUT.puts prompt
25
+ w.write("#{password}\n")
26
+
27
+ # Keep printing output unti the command exits
28
+ loop do
29
+ begin
30
+ line = r.gets
31
+ puts line
32
+ if line =~ /failed/
33
+ STDERR.puts 'RPM signing failure'
34
+ exit 1
35
+ end
36
+ rescue Errno::EIO
37
+ break
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,70 @@
1
+ # Disable any shell actions, replace them with simply 'true'
2
+ %define __spec_prep_post true
3
+ %define __spec_prep_pre true
4
+ %define __spec_build_post true
5
+ %define __spec_build_pre true
6
+ %define __spec_install_post true
7
+ %define __spec_install_pre true
8
+ %define __spec_clean_post true
9
+ %define __spec_clean_pre true
10
+
11
+ # Use md5
12
+ %define _binary_filedigest_algorithm 1
13
+
14
+ # Use gzip payload compression
15
+ %define _binary_payload w9.gzdio
16
+
17
+ # Metadata
18
+ Name: <%= name %>
19
+ Version: <%= version %>
20
+ Release: <%= iteration %>
21
+ Summary: <%= description.split("\n").first.empty? ? "_" : description.split("\n").first %>
22
+ BuildArch: <%= architecture %>
23
+ AutoReqProv: no
24
+ BuildRoot: %buildroot
25
+ Prefix: /
26
+ Group: <%= category %>
27
+ License: <%= license %>
28
+ Vendor: <%= vendor %>
29
+ URL: <%= homepage %>
30
+ Packager: <%= maintainer %>
31
+ <% dependencies.each do |name| -%>
32
+ Requires: <%= name %>
33
+ <% end -%>
34
+ <% conflicts.each do |name| -%>
35
+ Conflicts: <%= name %>
36
+ <% end -%>
37
+ <% conflicts.each do |name| -%>
38
+ Obsoletes: <%= name %>
39
+ <%- end -%>
40
+ <% # RPM rejects descriptions with blank lines (even between content) -%>
41
+ %description
42
+ <%= description.gsub(/^\s*$/, " .") %>
43
+
44
+ %prep
45
+ # noop
46
+
47
+ %build
48
+ # noop
49
+
50
+ %install
51
+ # noop
52
+
53
+ %clean
54
+ # noop
55
+
56
+ <% scripts.each do |name, contents| -%>
57
+ %<%= name %>
58
+ <%= contents %>
59
+ <% end -%>
60
+
61
+ %files
62
+ %defattr(-,<%= user %>,<%= group %>,-)
63
+ <% # Output config files and then regular files -%>
64
+ <% config_files.each do |file| -%>
65
+ %config(noreplace) <%= file %>
66
+ <% end -%>
67
+ <% # List all files -%>
68
+ <% files.each do |file| -%>
69
+ <%= file %>
70
+ <% end -%>
@@ -2,14 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module Omnibus
4
4
  describe Builder do
5
- let(:software) do
6
- double(Software,
7
- name: 'chefdk',
8
- install_dir: File.join(tmp_path, 'chefdk'),
9
- project_dir: File.join(tmp_path, 'chefdk', 'cache'),
10
- overridden?: false,
11
- )
12
- end
5
+ include_examples 'a software'
13
6
 
14
7
  #
15
8
  # Fakes the embedded bin path to whatever exists in bundler. This is useful
@@ -17,28 +10,12 @@ module Omnibus
17
10
  # a real Ruby just for functional tests.
18
11
  #
19
12
  def fake_embedded_bin(name)
20
- bin = File.join(software.install_dir, 'embedded', 'bin')
21
-
22
- FileUtils.mkdir_p(bin)
23
- FileUtils.ln_s(Bundler.which(name), File.join(bin, name))
13
+ create_directory(bin_dir)
14
+ create_link(Bundler.which(name), File.join(bin_dir, name))
24
15
  end
25
16
 
26
17
  subject { described_class.new(software) }
27
18
 
28
- before do
29
- Config.project_root(tmp_path)
30
- Config.build_retries(0)
31
- Config.use_git_caching(false)
32
- Config.software_gems(nil)
33
-
34
- # Make the directories
35
- FileUtils.mkdir_p(software.install_dir)
36
- FileUtils.mkdir_p(software.project_dir)
37
- FileUtils.mkdir_p(File.join(tmp_path, 'config', 'software'))
38
- FileUtils.mkdir_p(File.join(tmp_path, 'config', 'patches'))
39
- FileUtils.mkdir_p(File.join(tmp_path, 'config', 'templates'))
40
- end
41
-
42
19
  describe '#command' do
43
20
  it 'executes the command' do
44
21
  path = File.join(software.install_dir, 'file.txt')
@@ -49,10 +26,15 @@ module Omnibus
49
26
  end
50
27
  end
51
28
 
29
+ describe '#make' do
30
+ it 'is waiting for a good samaritan to write tests' do
31
+ skip
32
+ end
33
+ end
34
+
52
35
  describe '#patch' do
53
36
  it 'applies the patch' do
54
- configure = File.join(tmp_path, 'chefdk', 'cache', 'configure')
55
- FileUtils.mkdir_p(File.dirname(configure))
37
+ configure = File.join(project_dir, 'configure')
56
38
  File.open(configure, 'w') do |f|
57
39
  f.write <<-EOH.gsub(/^ {12}/, '')
58
40
  THING="-e foo"
@@ -60,8 +42,7 @@ module Omnibus
60
42
  EOH
61
43
  end
62
44
 
63
- patch = File.join(tmp_path, 'config', 'patches', 'chefdk', 'apply.patch')
64
- FileUtils.mkdir_p(File.dirname(patch))
45
+ patch = File.join(patches_dir, 'apply.patch')
65
46
  File.open(patch, 'w') do |f|
66
47
  f.write <<-EOH.gsub(/^ {12}/, '')
67
48
  --- a/configure
@@ -80,8 +61,7 @@ module Omnibus
80
61
 
81
62
  describe '#ruby' do
82
63
  it 'executes the command as the embdedded ruby' do
83
- ruby = File.join(tmp_path, 'chefdk', 'scripts', 'setup.rb')
84
- FileUtils.mkdir_p(File.dirname(ruby))
64
+ ruby = File.join(scripts_dir, 'setup.rb')
85
65
  File.open(ruby, 'w') do |f|
86
66
  f.write <<-EOH.gsub(/^ {12}/, '')
87
67
  File.write("#{software.install_dir}/test.txt", 'This is content!')
@@ -94,7 +74,7 @@ module Omnibus
94
74
  subject.build
95
75
 
96
76
  path = "#{software.install_dir}/test.txt"
97
- expect(File.exist?(path)).to be_truthy
77
+ expect(path).to be_a_file
98
78
  expect(File.read(path)).to eq('This is content!')
99
79
  end
100
80
  end
@@ -118,7 +98,7 @@ module Omnibus
118
98
  fake_embedded_bin('gem')
119
99
 
120
100
  subject.gem("build #{gemspec}")
121
- subject.gem("install #{tmp_path}/chefdk/cache/example-1.0.0.gem")
101
+ subject.gem("install #{project_dir}/example-1.0.0.gem")
122
102
  output = capture_logging { subject.build }
123
103
 
124
104
  expect(output).to include('gem build')
@@ -186,14 +166,13 @@ module Omnibus
186
166
  output = capture_logging { subject.build }
187
167
 
188
168
  expect(output).to include('A complex operation')
189
- expect(File.exist?("#{software.project_dir}/bacon")).to be_truthy
169
+ expect("#{software.project_dir}/bacon").to be_a_file
190
170
  end
191
171
  end
192
172
 
193
173
  describe '#erb' do
194
174
  it 'renders the erb' do
195
- erb = File.join(tmp_path, 'config', 'templates', 'chefdk', 'example.erb')
196
- FileUtils.mkdir_p(File.dirname(erb))
175
+ erb = File.join(templates_dir, 'example.erb')
197
176
  File.open(erb, 'w') do |f|
198
177
  f.write <<-EOH.gsub(/^ {12}/, '')
199
178
  <%= a %>
@@ -210,7 +189,7 @@ module Omnibus
210
189
  )
211
190
  subject.build
212
191
 
213
- expect(File.exist?(destination)).to be_truthy
192
+ expect(destination).to be_a_file
214
193
  expect(File.read(destination)).to eq("foo\nbar\n")
215
194
  end
216
195
  end
@@ -218,24 +197,24 @@ module Omnibus
218
197
  describe '#mkdir' do
219
198
  it 'creates the directory' do
220
199
  path = File.join(tmp_path, 'scratch')
221
- FileUtils.rm_rf(path)
200
+ remove_directory(path)
222
201
 
223
202
  subject.mkdir(path)
224
203
  subject.build
225
204
 
226
- expect(File.directory?(path)).to be_truthy
205
+ expect(path).to be_a_directory
227
206
  end
228
207
  end
229
208
 
230
209
  describe '#touch' do
231
210
  it 'creates the file' do
232
211
  path = File.join(tmp_path, 'file')
233
- FileUtils.rm_rf(path)
212
+ remove_file(path)
234
213
 
235
214
  subject.touch(path)
236
215
  subject.build
237
216
 
238
- expect(File.file?(path)).to be_truthy
217
+ expect(path).to be_a_file
239
218
  end
240
219
 
241
220
  it 'creates the containing directory' do
@@ -245,29 +224,29 @@ module Omnibus
245
224
  subject.touch(path)
246
225
  subject.build
247
226
 
248
- expect(File.file?(path)).to be_truthy
227
+ expect(path).to be_a_file
249
228
  end
250
229
  end
251
230
 
252
231
  describe '#delete' do
253
232
  it 'deletes the directory' do
254
233
  path = File.join(tmp_path, 'scratch')
255
- FileUtils.mkdir_p(path)
234
+ create_directory(path)
256
235
 
257
236
  subject.delete(path)
258
237
  subject.build
259
238
 
260
- expect(File.exist?(path)).to be_falsey
239
+ expect(path).to_not be_a_directory
261
240
  end
262
241
 
263
242
  it 'deletes the file' do
264
243
  path = File.join(tmp_path, 'file')
265
- FileUtils.touch(path)
244
+ create_file(path)
266
245
 
267
246
  subject.delete(path)
268
247
  subject.build
269
248
 
270
- expect(File.exist?(path)).to be_falsey
249
+ expect(path).to_not be_a_file
271
250
  end
272
251
 
273
252
  it 'accepts a glob pattern' do
@@ -279,8 +258,8 @@ module Omnibus
279
258
  subject.delete("#{tmp_path}/**/file_*")
280
259
  subject.build
281
260
 
282
- expect(File.exist?(path_a)).to be_falsey
283
- expect(File.exist?(path_b)).to be_falsey
261
+ expect(path_a).to_not be_a_file
262
+ expect(path_b).to_not be_a_file
284
263
  end
285
264
  end
286
265
 
@@ -288,12 +267,12 @@ module Omnibus
288
267
  it 'copies the file' do
289
268
  path_a = File.join(tmp_path, 'file1')
290
269
  path_b = File.join(tmp_path, 'file2')
291
- FileUtils.touch(path_a)
270
+ create_file(path_a)
292
271
 
293
272
  subject.copy(path_a, path_b)
294
273
  subject.build
295
274
 
296
- expect(File.file?(path_b)).to be_truthy
275
+ expect(path_b).to be_a_file
297
276
  expect(File.read(path_b)).to eq(File.read(path_a))
298
277
  end
299
278
 
@@ -311,9 +290,9 @@ module Omnibus
311
290
  subject.copy(directory, destination)
312
291
  subject.build
313
292
 
314
- expect(File.exist?(destination)).to be_truthy
315
- expect(File.exist?("#{destination}/file_a")).to be_truthy
316
- expect(File.exist?("#{destination}/file_b")).to be_truthy
293
+ expect(destination).to be_a_directory
294
+ expect("#{destination}/file_a").to be_a_file
295
+ expect("#{destination}/file_b").to be_a_file
317
296
  end
318
297
 
319
298
  it 'accepts a glob pattern' do
@@ -331,9 +310,9 @@ module Omnibus
331
310
  subject.copy("#{directory}/*", destination)
332
311
  subject.build
333
312
 
334
- expect(File.exist?(destination)).to be_truthy
335
- expect(File.exist?("#{destination}/file_a")).to be_truthy
336
- expect(File.exist?("#{destination}/file_b")).to be_truthy
313
+ expect(destination).to be_a_directory
314
+ expect("#{destination}/file_a").to be_a_file
315
+ expect("#{destination}/file_b").to be_a_file
337
316
  end
338
317
  end
339
318
 
@@ -341,13 +320,13 @@ module Omnibus
341
320
  it 'moves the file' do
342
321
  path_a = File.join(tmp_path, 'file1')
343
322
  path_b = File.join(tmp_path, 'file2')
344
- FileUtils.touch(path_a)
323
+ create_file(path_a)
345
324
 
346
325
  subject.move(path_a, path_b)
347
326
  subject.build
348
327
 
349
- expect(File.file?(path_b)).to be_truthy
350
- expect(File.file?(path_a)).to be_falsey
328
+ expect(path_b).to be_a_file
329
+ expect(path_a).to_not be_a_file
351
330
  end
352
331
 
353
332
  it 'moves the directory and entries' do
@@ -364,11 +343,11 @@ module Omnibus
364
343
  subject.move(directory, destination)
365
344
  subject.build
366
345
 
367
- expect(File.exist?(destination)).to be_truthy
368
- expect(File.exist?("#{destination}/file_a")).to be_truthy
369
- expect(File.exist?("#{destination}/file_b")).to be_truthy
346
+ expect(destination).to be_a_directory
347
+ expect("#{destination}/file_a").to be_a_file
348
+ expect("#{destination}/file_b").to be_a_file
370
349
 
371
- expect(File.exist?(directory)).to be_falsey
350
+ expect(directory).to_not be_a_directory
372
351
  end
373
352
 
374
353
  it 'accepts a glob pattern' do
@@ -386,11 +365,11 @@ module Omnibus
386
365
  subject.move("#{directory}/*", destination)
387
366
  subject.build
388
367
 
389
- expect(File.exist?(destination)).to be_truthy
390
- expect(File.exist?("#{destination}/file_a")).to be_truthy
391
- expect(File.exist?("#{destination}/file_b")).to be_truthy
368
+ expect(destination).to be_a_directory
369
+ expect("#{destination}/file_a").to be_a_file
370
+ expect("#{destination}/file_b").to be_a_file
392
371
 
393
- expect(File.exist?(directory)).to be_truthy
372
+ expect(directory).to be_a_directory
394
373
  end
395
374
  end
396
375
 
@@ -398,12 +377,12 @@ module Omnibus
398
377
  it 'links the file' do
399
378
  path_a = File.join(tmp_path, 'file1')
400
379
  path_b = File.join(tmp_path, 'file2')
401
- FileUtils.touch(path_a)
380
+ create_file(path_a)
402
381
 
403
382
  subject.link(path_a, path_b)
404
383
  subject.build
405
384
 
406
- expect(File.symlink?(path_b)).to be_truthy
385
+ expect(path_b).to be_a_symlink
407
386
  end
408
387
 
409
388
  it 'links the directory' do
@@ -414,7 +393,7 @@ module Omnibus
414
393
  subject.link(directory, destination)
415
394
  subject.build
416
395
 
417
- expect(File.symlink?(destination)).to be_truthy
396
+ expect(destination).to be_a_symlink
418
397
  end
419
398
 
420
399
  it 'accepts a glob pattern' do
@@ -432,8 +411,8 @@ module Omnibus
432
411
  subject.link("#{directory}/*", destination)
433
412
  subject.build
434
413
 
435
- expect(File.symlink?("#{destination}/file_a")).to be_truthy
436
- expect(File.symlink?("#{destination}/file_b")).to be_truthy
414
+ expect("#{destination}/file_a").to be_a_symlink
415
+ expect("#{destination}/file_b").to be_a_symlink
437
416
  end
438
417
  end
439
418
 
@@ -464,13 +443,13 @@ module Omnibus
464
443
  subject.sync(source, destination)
465
444
  subject.build
466
445
 
467
- expect(File.file?("#{destination}/file_a")).to be_truthy
468
- expect(File.file?("#{destination}/file_b")).to be_truthy
469
- expect(File.file?("#{destination}/file_c")).to be_truthy
470
- expect(File.file?("#{destination}/folder/file_d")).to be_truthy
471
- expect(File.file?("#{destination}/folder/file_e")).to be_truthy
472
- expect(File.file?("#{destination}/.dot_folder/file_f")).to be_truthy
473
- expect(File.file?("#{destination}/.file_g")).to be_truthy
446
+ expect("#{destination}/file_a").to be_a_file
447
+ expect("#{destination}/file_b").to be_a_file
448
+ expect("#{destination}/file_c").to be_a_file
449
+ expect("#{destination}/folder/file_d").to be_a_file
450
+ expect("#{destination}/folder/file_e").to be_a_file
451
+ expect("#{destination}/.dot_folder/file_f").to be_a_file
452
+ expect("#{destination}/.file_g").to be_a_file
474
453
  end
475
454
  end
476
455
 
@@ -486,18 +465,18 @@ module Omnibus
486
465
  subject.sync(source, destination)
487
466
  subject.build
488
467
 
489
- expect(File.file?("#{destination}/file_a")).to be_truthy
490
- expect(File.file?("#{destination}/file_b")).to be_truthy
491
- expect(File.file?("#{destination}/file_c")).to be_truthy
492
- expect(File.file?("#{destination}/folder/file_d")).to be_truthy
493
- expect(File.file?("#{destination}/folder/file_e")).to be_truthy
494
- expect(File.file?("#{destination}/.dot_folder/file_f")).to be_truthy
495
- expect(File.file?("#{destination}/.file_g")).to be_truthy
496
-
497
- expect(File.exist?("#{destination}/existing_folder")).to be_falsey
498
- expect(File.exist?("#{destination}/.existing_folder")).to be_falsey
499
- expect(File.exist?("#{destination}/existing_file")).to be_falsey
500
- expect(File.exist?("#{destination}/.existing_file")).to be_falsey
468
+ expect("#{destination}/file_a").to be_a_file
469
+ expect("#{destination}/file_b").to be_a_file
470
+ expect("#{destination}/file_c").to be_a_file
471
+ expect("#{destination}/folder/file_d").to be_a_file
472
+ expect("#{destination}/folder/file_e").to be_a_file
473
+ expect("#{destination}/.dot_folder/file_f").to be_a_file
474
+ expect("#{destination}/.file_g").to be_a_file
475
+
476
+ expect("#{destination}/existing_folder").to_not be_a_directory
477
+ expect("#{destination}/.existing_folder").to_not be_a_directory
478
+ expect("#{destination}/existing_file").to_not be_a_file
479
+ expect("#{destination}/.existing_file").to_not be_a_file
501
480
  end
502
481
  end
503
482
 
@@ -506,14 +485,14 @@ module Omnibus
506
485
  subject.sync(source, destination, exclude: '.dot_folder')
507
486
  subject.build
508
487
 
509
- expect(File.file?("#{destination}/file_a")).to be_truthy
510
- expect(File.file?("#{destination}/file_b")).to be_truthy
511
- expect(File.file?("#{destination}/file_c")).to be_truthy
512
- expect(File.file?("#{destination}/folder/file_d")).to be_truthy
513
- expect(File.file?("#{destination}/folder/file_e")).to be_truthy
514
- expect(File.exist?("#{destination}/.dot_folder")).to be_falsey
515
- expect(File.file?("#{destination}/.dot_folder/file_f")).to be_falsey
516
- expect(File.file?("#{destination}/.file_g")).to be_truthy
488
+ expect("#{destination}/file_a").to be_a_file
489
+ expect("#{destination}/file_b").to be_a_file
490
+ expect("#{destination}/file_c").to be_a_file
491
+ expect("#{destination}/folder/file_d").to be_a_file
492
+ expect("#{destination}/folder/file_e").to be_a_file
493
+ expect("#{destination}/.dot_folder").to_not be_a_directory
494
+ expect("#{destination}/.dot_folder/file_f").to_not be_a_file
495
+ expect("#{destination}/.file_g").to be_a_file
517
496
  end
518
497
 
519
498
  it 'removes existing files and folders in destination' do
@@ -525,17 +504,17 @@ module Omnibus
525
504
  subject.sync(source, destination, exclude: '.dot_folder')
526
505
  subject.build
527
506
 
528
- expect(File.file?("#{destination}/file_a")).to be_truthy
529
- expect(File.file?("#{destination}/file_b")).to be_truthy
530
- expect(File.file?("#{destination}/file_c")).to be_truthy
531
- expect(File.file?("#{destination}/folder/file_d")).to be_truthy
532
- expect(File.file?("#{destination}/folder/file_e")).to be_truthy
533
- expect(File.exist?("#{destination}/.dot_folder")).to be_falsey
534
- expect(File.file?("#{destination}/.dot_folder/file_f")).to be_falsey
535
- expect(File.file?("#{destination}/.file_g")).to be_truthy
536
-
537
- expect(File.exist?("#{destination}/existing_folder")).to be_falsey
538
- expect(File.exist?("#{destination}/existing_file")).to be_falsey
507
+ expect("#{destination}/file_a").to be_a_file
508
+ expect("#{destination}/file_b").to be_a_file
509
+ expect("#{destination}/file_c").to be_a_file
510
+ expect("#{destination}/folder/file_d").to be_a_file
511
+ expect("#{destination}/folder/file_e").to be_a_file
512
+ expect("#{destination}/.dot_folder").to_not be_a_directory
513
+ expect("#{destination}/.dot_folder/file_f").to_not be_a_file
514
+ expect("#{destination}/.file_g").to be_a_file
515
+
516
+ expect("#{destination}/existing_folder").to_not be_a_directory
517
+ expect("#{destination}/existing_file").to_not be_a_file
539
518
  end
540
519
  end
541
520
  end