rebuild 0.3.0.pre8 → 0.3.0

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
  SHA1:
3
- metadata.gz: acaa50c28935f9edfea18ddf9c71fd54ec1f446a
4
- data.tar.gz: 3beb72df2be72480448b5cc8d689eeb6d3862cfb
3
+ metadata.gz: c8f85bfc4d94c953df138c1bf6bf7dc9c3ddb19a
4
+ data.tar.gz: c3e378e68c19d3e183e84856158954e0e7056171
5
5
  SHA512:
6
- metadata.gz: adb4bef343175f419d108fccb2605d12aee7f71e6a637ee9b8bc39cf87338394ac2fef1c5b0ef1c41a548a55427cf49813c6b0f579e14d08b1b8901d2f4e30ab
7
- data.tar.gz: cd182c45bc03e98e86158f388d70fd36938580fa113fe3eec060c5c47c5189fe3dd4df475d2f052a7ab6910a19c5cbab14af8292cc6448db4584e7fdce1606fd
6
+ metadata.gz: 92d46bd2fcf3e1cb348f9a3a14cad991ff6ff4f3c12d73c9543679358bb8efdee195a49fc94a0aa8cd42b854b361918eaf3f9e56f3f826c725ecebe34deb8258
7
+ data.tar.gz: dcb2ec3b2fc45a17522593a82f7bdd8501d04a0178a3ab65af6c930e63f751e0e51ff9071bef797e41ef82e1389d3b6f56bf69239a9419e6a282120ab98cd5bb
@@ -4,7 +4,8 @@ require 'optparse'
4
4
  module Rebuild
5
5
  class CLI
6
6
  DEFAULT_OPTIONS = {
7
- update: false,
7
+ update: false,
8
+ version: false,
8
9
  }
9
10
 
10
11
  class << self
@@ -12,11 +13,13 @@ module Rebuild
12
13
  options = DEFAULT_OPTIONS
13
14
 
14
15
  opt = OptionParser.new
16
+ opt.on('-v', '--version') { |v| options[:version] = true }
15
17
  opt.on('-f', '--force-update') { |v| options[:update] = true }
16
18
  opt.on('-d', '--directory=VAL') { |v| options[:directory] = v }
17
19
  opt.on('-s', '--scriptdir=VAL') { |v| options[:scriptdir] = v }
18
20
 
19
21
  args = opt.parse!(ARGV)
22
+ return print_version if options[:version]
20
23
  return show_usage if args.empty? && CommandLineTools.installed?
21
24
 
22
25
  CommandLineTools.install unless CommandLineTools.installed?
@@ -70,6 +73,7 @@ module Rebuild
70
73
  rebuild brew start homebrew installation and press ENTER for you
71
74
 
72
75
  Options:
76
+ -v, [--version] Print version
73
77
  -f, [--force-update] By default, git pull is not executed
74
78
  -d, [--directory=/path/to/clone] Default: /tmp/USER/PROJECT
75
79
  -s, [--scriptdir=/script/placed/dir] Default: '' (root)
@@ -77,6 +81,10 @@ module Rebuild
77
81
  EOS
78
82
  end
79
83
 
84
+ def print_version
85
+ puts "Rebuild version #{VERSION}"
86
+ end
87
+
80
88
  def unindent(text)
81
89
  indent = text.split("\n").select {|line| !line.strip.empty? }.map {|line| line.index(/[^\s]/) }.compact.min || 0
82
90
  text.gsub(/^[[:blank:]]{#{indent}}/, '')
@@ -1,3 +1,3 @@
1
1
  module Rebuild
2
- VERSION = '0.3.0.pre8'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rebuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
@@ -99,9 +99,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">"
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.3.1
104
+ version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 2.2.2