manifestly 3.0.0 → 3.1.0

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: 9a122c2c2aad6e6043dfb5e16f1d51362eceaf94
4
- data.tar.gz: 06b7b5cbb590eedf3c5229edf2c16a0b66b3d775
3
+ metadata.gz: a2aed560e442a4e6fdfe2f3543f9f51ad3a1bfb5
4
+ data.tar.gz: 48ed77e6d0e1272595e976374371f2ac8ddd6978
5
5
  SHA512:
6
- metadata.gz: eadfeb8b0b646242ac93ef0ec955db3326f4546edef87f56669f6e9303bfbbd109a8e8db73a0cb087056e290ea0e9e31f6d29e3492100537db64ab4fc17bc3b1
7
- data.tar.gz: 02cc0ec9bf7d0c29fbcd21155330cb4e2dabf543ba7559f66300d158337e47558814f7d41dc7735db867edd72302d12246391e632cd7c63df54d42d1f25ba495
6
+ metadata.gz: ef9afdcfbcc3c9ae088bd6fb52d3e23feda51390a7949abff0ec17b81845347771bffbc651d146a3514afb9a29a0e2c467a77508388cc73c9fdce6ec95b3790a
7
+ data.tar.gz: aed77cfd8d92a3f13cf1fc51e86fc45cfb0a045b229246c86a2d946a38c7004f302c3d77a1c22d30e26da67fa3d3d980c72e8b1a1062a527534606ae41ee28f5
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  *.manifest
12
12
  .manifestly
13
13
  *.*~
14
+ .byebug_history
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ # 3.1.0
4
+
5
+ * Adds an option `--full-shas` to use the full-length SHAs in manifests (defaults to false)
6
+
7
+ # 3.0.0
8
+
9
+ * Prepends the directory of the repository at the start of the manifest line
10
+ * Puts tags in a comment at the end of the manifest line
11
+ * Uses the first 10 characters of SHAs in manifests
@@ -95,6 +95,11 @@ module Manifestly
95
95
  banner: '',
96
96
  required: false,
97
97
  default: ''
98
+ method_option :full_shas,
99
+ desc: "Use full instead of shortened SHAs",
100
+ type: :boolean,
101
+ default: false,
102
+ required: false
98
103
  long_desc <<-DESC
99
104
  Creates a manifest.
100
105
 
@@ -508,7 +513,7 @@ module Manifestly
508
513
 
509
514
  filename = default_filename if filename.blank?
510
515
 
511
- manifest.write(filename)
516
+ manifest.write(filename, options.slice("full_shas"))
512
517
  end
513
518
 
514
519
  def present_commit_menu(manifest_item, options={})
@@ -53,11 +53,11 @@ module Manifestly
53
53
  end
54
54
  end
55
55
 
56
- def write(filename)
56
+ def write(filename, options={})
57
57
  File.open(filename, 'w') do |file|
58
58
  @items.sort_by!(&:repository_name)
59
59
  @items.each do |item|
60
- file.write(item.to_file_string + "\n")
60
+ file.write(item.to_file_string(options) + "\n")
61
61
  end
62
62
  end
63
63
  end
@@ -41,12 +41,15 @@ module Manifestly
41
41
  end.map(&:name)
42
42
  end
43
43
 
44
- def to_file_string
44
+ def to_file_string(options={})
45
+ options[:full_shas] ||= false
46
+
45
47
  dir = @repository.deepest_working_dir
46
48
  repo = @repository.github_name_or_path
47
49
  tags = commit_tags
50
+ sha = options[:full_shas] ? commit.sha : commit.sha[0..9]
48
51
 
49
- "[#{dir}]#{repo.nil? ? '' : ' ' + repo}@#{commit.sha[0..9]}#{' # ' + tags.join(",") if tags.any?}"
52
+ "[#{dir}]#{repo.nil? ? '' : ' ' + repo}@#{sha}#{' # ' + tags.join(",") if tags.any?}"
50
53
  end
51
54
 
52
55
  def self.from_file_string(string, repositories)
@@ -11,6 +11,11 @@ class Hash
11
11
  def except(*keys)
12
12
  dup.except!(*keys)
13
13
  end
14
+
15
+ def slice(*keys)
16
+ keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
17
+ keys.each_with_object(self.class.new) { |k, hash| hash[k] = self[k] if has_key?(k) }
18
+ end
14
19
  end
15
20
 
16
21
  class String
@@ -1,3 +1,3 @@
1
1
  module Manifestly
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifestly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -155,6 +155,7 @@ files:
155
155
  - Rakefile
156
156
  - bin/console
157
157
  - bin/setup
158
+ - changelog.md
158
159
  - exe/manifestly
159
160
  - lib/manifestly.rb
160
161
  - lib/manifestly/cli.rb
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  version: '0'
189
190
  requirements: []
190
191
  rubyforge_project:
191
- rubygems_version: 2.4.8
192
+ rubygems_version: 2.4.5.1
192
193
  signing_key:
193
194
  specification_version: 4
194
195
  summary: Manage multi-site deploy manifests