coaster 1.3.29 → 1.3.31

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cee8914e3be8e12b37a81c3217b8d9725737dd505908db7055727cd6d88ef7e8
4
- data.tar.gz: 67c6aaec914f4a2ff93b932c575f86d77753b76032ea8e3f369e47500b1c9de1
3
+ metadata.gz: 43abb6513668deddc9df011fbff2c6e5e91b3d719802eea04e5747c861386b70
4
+ data.tar.gz: f71da9808d5ede1b3d9b82b730aadbe42e167aac3a5e1a25594e86eb03ec5e79
5
5
  SHA512:
6
- metadata.gz: 38d61efdc28e80bb944cc546da9c139a4aa454c65fe6c61166258e911135125d9c9c92ee6493c71f54cd9055e828590d07344deaa672b7d072054823d4232aa5
7
- data.tar.gz: 2b2cf7c5738c15875820905b080e35c240b209b0e4a1cc4f454f2f69e46b1e088d55fd96afdb1583d642a1cb5e2ae6dea94cf6bcbc84f2c9a5e69f98cb7c8be2
6
+ metadata.gz: 0ff272eab32afa8c497cfa819dcc0478f2f89d2023993d19282185e9a0a338093c187333b963bf7e2b62be0059d33b0ae73056a22de57ea48a1090b8f6863cb9
7
+ data.tar.gz: 70eac0b6df3309029af7780dbb39544e0c0e72cf98e656734d3f884dc3bb457c988948ac5731a5432958998bc899f5f943123acac378818d4957d88f5bea5703
data/bin/coaster ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'coaster'
4
+ require 'coaster/git'
5
+
6
+ command = ARGV.shift
7
+ if command == 'git'
8
+ repo = Git::Repository.new(Dir.pwd)
9
+ subcommand = ARGV.shift
10
+ repo.send(subcommand, *ARGV)
11
+ else
12
+ puts "Unknown command: #{command}"
13
+ end
@@ -3,6 +3,14 @@ module Coaster
3
3
  class Repository
4
4
  class << self
5
5
  def option_parser(options)
6
+ case options
7
+ when Hash then hash_option_parser(options)
8
+ when Array, Set then options.map{|o| option_parser(o)}.join(' ')
9
+ else options
10
+ end
11
+ end
12
+
13
+ def hash_option_parser(options)
6
14
  opts = []
7
15
 
8
16
  # multiple options can be passed by set
@@ -18,7 +26,7 @@ module Coaster
18
26
  v = case v
19
27
  when Hash then v.map{|vk,vv| "#{vk}=#{vv}"}.join(',')
20
28
  when Array then v.join(',')
21
- else v
29
+ else v || ''
22
30
  end
23
31
  v = v.strip
24
32
  if k.start_with?('--')
@@ -32,7 +40,7 @@ module Coaster
32
40
  end
33
41
 
34
42
  def run_cmd(path, command)
35
- puts "Run command: #{command}"
43
+ puts "#{path}: #{command}"
36
44
  stdout, stderr, status = Open3.capture3(command, chdir: path)
37
45
  if status.success?
38
46
  puts " ↳ success: #{stdout}"
@@ -60,7 +68,7 @@ module Coaster
60
68
  self.class.run_cmd(path, command)
61
69
  end
62
70
 
63
- def run_git_cmd(command, **options)
71
+ def run_git_cmd(command, *options)
64
72
  cmd = "git #{self.class.option_parser(options)} #{command}"
65
73
  run_cmd(cmd)
66
74
  end
@@ -111,8 +119,8 @@ module Coaster
111
119
 
112
120
  def merge(pointer)
113
121
  pointers = pointers(pointer).join(',')
114
- puts "#{path} merged deploy, #{pointers}"
115
- run_git_cmd("merge #{pointer} --commit -m \"merged deploy, #{pointers}\"")
122
+ puts "#{path} merged deploy: #{pointers}"
123
+ run_git_cmd("merge #{pointer} --commit -m \"merged deploy: #{pointers}\"")
116
124
  end
117
125
 
118
126
  def submodule_sha(path, pointer: nil)
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.3.29'
2
+ VERSION = '1.3.31'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.29
4
+ version: 1.3.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung
@@ -180,13 +180,15 @@ dependencies:
180
180
  version: '0'
181
181
  description: Ruby Core Extensions
182
182
  email: buzz@frograms.com
183
- executables: []
183
+ executables:
184
+ - coaster
184
185
  extensions: []
185
186
  extra_rdoc_files: []
186
187
  files:
187
188
  - LICENSE
188
189
  - README.md
189
190
  - Rakefile
191
+ - bin/coaster
190
192
  - lib/coaster.rb
191
193
  - lib/coaster/core_ext.rb
192
194
  - lib/coaster/core_ext/array.rb
@@ -219,7 +221,9 @@ files:
219
221
  homepage: http://github.com/frograms/coaster
220
222
  licenses:
221
223
  - MIT
222
- metadata: {}
224
+ metadata:
225
+ source_code_uri: https://github.com/frograms/coaster
226
+ bug_tracker_uri: https://github.com/frograms/coaster/issues
223
227
  post_install_message:
224
228
  rdoc_options: []
225
229
  require_paths: