octocatalog-diff 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a6057ffec45d60dbe793f5b81170c1d00b7d1af
4
- data.tar.gz: 158d57d91c2d57d3f796732b814f85394346f553
3
+ metadata.gz: bd8f7061eaf89165ab41fe52f67b2a6a16a355e9
4
+ data.tar.gz: 82ced3eb61baa30e35c979fbe748f00ed13c015f
5
5
  SHA512:
6
- metadata.gz: 2ea4c161583582db60e6e89349ff4c2e2153080fc27a01b2b7a5f01af3ef920d52b69a1515c7f4c51329036c7949aea5ad7d97221e6a987a765240f4b5cc05e8
7
- data.tar.gz: fbccb8d52fe1346f880584d95405b744e119528686846c7dfcd36d0e7087273c27c5703d90ad5a985b7fd1e6ef558e9b2b34c677d4508f52ecb791314166cb1b
6
+ metadata.gz: 3d93c41ab87ba8a41dd701d53efa2074eab6f3bfd3b7327db2150db0d0c42eb7179ed336d4300d16956010b73dc1446acea0b9d0bc516b32e2025b6631718e5b
7
+ data.tar.gz: c951dc4cdf13de9ff9204e845bcf87f9f07d13a0cb50eb9844c30322846c90685fca4a3a16bc805bab1932bb40f86f33ddd0b31505c1606144e623424b1a7f0d
data/.version CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
data/doc/CHANGELOG.md CHANGED
@@ -8,6 +8,13 @@
8
8
  </tr>
9
9
  </thead><tbody>
10
10
  <tr valign=top>
11
+ <td>1.0.3</td>
12
+ <td>2017-03-15</td>
13
+ <td>
14
+ <li><a href="https://github.com/github/octocatalog-diff/pull/86">#86</a>: Ability to use `--environment` without `--preserve-environments`</li>
15
+ </td>
16
+ </tr>
17
+ <tr valign=top>
11
18
  <td>1.0.2</td>
12
19
  <td>2017-03-08</td>
13
20
  <td>
@@ -84,11 +84,14 @@ module OctocatalogDiff
84
84
  install_directory_symlink(logger, File.join(@options[:basedir], x), x)
85
85
  end
86
86
  else
87
- if @options[:environment]
88
- logger.warn '--environment is ignored unless --preserve-environments is used' unless logger.nil?
89
- end
90
- if @options[:create_symlinks]
87
+ if @options[:create_symlinks] && @options[:environment]
88
+ unless logger.nil?
89
+ logger.warn '--create-symlinks with --environment ignored unless --preserve-environments is used'
90
+ end
91
+ elsif @options[:create_symlinks]
91
92
  logger.warn '--create-symlinks is ignored unless --preserve-environments is used' unless logger.nil?
93
+ elsif @options[:environment]
94
+ return install_directory_symlink(logger, @options[:basedir], "environments/#{@options[:environment]}")
92
95
  end
93
96
  install_directory_symlink(logger, @options[:basedir])
94
97
  end
@@ -178,6 +181,7 @@ module OctocatalogDiff
178
181
  def install_directory_symlink(logger, dir, target = 'environments/production')
179
182
  raise ArgumentError, "Called install_directory_symlink with #{dir.class} argument" unless dir.is_a?(String)
180
183
  raise Errno::ENOENT, "Specified directory #{dir} doesn't exist" unless File.directory?(dir)
184
+
181
185
  symlink_target = File.join(@tempdir, target)
182
186
 
183
187
  if target =~ %r{/}
@@ -330,7 +334,7 @@ module OctocatalogDiff
330
334
  end
331
335
 
332
336
  def environment
333
- @options[:preserve_environments] ? @options.fetch(:environment, 'production') : 'production'
337
+ @options.fetch(:environment, 'production')
334
338
  end
335
339
  end
336
340
  end
@@ -78,7 +78,7 @@ module OctocatalogDiff
78
78
  # Add environment - only make this variable if preserve_environments is used.
79
79
  # If preserve_environments is not used, the hard-coded 'production' here matches
80
80
  # up with the symlink created under the temporary directory structure.
81
- environ = @options[:preserve_environments] ? @options.fetch(:environment, 'production') : 'production'
81
+ environ = @options.fetch(:environment, 'production')
82
82
  cmdline << "--environment=#{Shellwords.escape(environ)}"
83
83
 
84
84
  # For people who aren't running hiera, a hiera-config will not be generated when @options[:hiera_config]
@@ -80,7 +80,7 @@ module OctocatalogDiff
80
80
 
81
81
  # Environment used to compile catalog
82
82
  def environment
83
- @opts[:preserve_environments] ? @opts.fetch(:environment, 'production') : 'production'
83
+ @opts.fetch(:environment, 'production')
84
84
  end
85
85
 
86
86
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octocatalog-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-08 00:00:00.000000000 Z
12
+ date: 2017-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diffy