setup_script_generator 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 7b641747f34456dd34dc4b20a778afaac326a434768343287cab7feef3c89bee
4
- data.tar.gz: '0893528542d93ea1d8dd8b8905e16ef0bc5e9de41097ed9e42a6c93232c8f33c'
3
+ metadata.gz: a5d703195a149c493aa00489accde35403f43b065329538f7f684704967e9919
4
+ data.tar.gz: f1537ed8738aefdb030949dbebd709d819f8123d91536e69f40ff3bb0f9f1611
5
5
  SHA512:
6
- metadata.gz: e926f73fa6112f27a9670df108b60475bad4cc95494d81684ea80819d9296fb18d6d033dd1c878b3a0a4f59032fe2ea8c4705c8a01a39119a2f0d2395d8543c4
7
- data.tar.gz: 0e554f39ce7ffa60271700978a7ccd69065e66194aec4766d991f2acfa8d6696ea202490913fdb02d9e10bcf4588390963683dcfeda037e36bb87c5b5a608526
6
+ metadata.gz: 62604ff23a577ade8e56c1dd283023625438bb48badadd8d4cbb440aff0a7fddd1378e1f910ab0fab9058a05c97a4e41d273284e60bb9c018347b7e7d5ce76a5
7
+ data.tar.gz: 0a86ff442db9a9db3b74edd5b05ddfb4b9e3f7991d877cf3af5fb3da31cbbe779d945c2d98a231f63f3b9e164ead7185970126aeb5dbccaac61f23ec365502a8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- setup_script_generator (0.2.0)
4
+ setup_script_generator (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -63,7 +63,7 @@ module SetupScriptGenerator
63
63
 
64
64
  def option_parser
65
65
  @_option_parser ||= OptionParser.new do |parser|
66
- parser.banner = "#{$0} [OPTIONS] OUTPUT_FILE"
66
+ parser.banner = "#{$0} OUTPUT_FILE [OPTIONS]"
67
67
 
68
68
  parser.on(
69
69
  "-p",
@@ -75,12 +75,22 @@ module SetupScriptGenerator
75
75
  provision_names << provision_name
76
76
  end
77
77
 
78
- parser.on("-n", "--dry-run", "Outputs the generated script instead of writing to the file.") do
78
+ parser.on(
79
+ "-n",
80
+ "--dry-run",
81
+ "Outputs the generated script instead of writing to the file."
82
+ ) do
79
83
  @dry_run = true
80
84
  end
81
85
 
82
- parser.on("-l", "--list-provisions", "Lists the available provisions.") do
83
- stdout.puts "Here are the provisions you can specify with --provision NAME:"
86
+ parser.on(
87
+ "-l",
88
+ "--list-provisions",
89
+ "Lists the available provisions."
90
+ ) do
91
+ stdout.puts(
92
+ "Here are the provisions you can specify with --provision NAME:"
93
+ )
84
94
 
85
95
  valid_provision_names.sort.each do |provision_name|
86
96
  stdout.puts "* #{provision_name}"
@@ -89,6 +99,16 @@ module SetupScriptGenerator
89
99
  exit
90
100
  end
91
101
 
102
+ parser.on(
103
+ "-v",
104
+ "--version",
105
+ "Lists the version of setup_script_generator associated with this " +
106
+ "executable."
107
+ ) do
108
+ puts "generate-setup version #{SetupScriptGenerator::VERSION}"
109
+ exit
110
+ end
111
+
92
112
  parser.on("-h", "--help", "You're looking at it!") do
93
113
  puts parser
94
114
  exit
@@ -1,10 +1,12 @@
1
1
  ### PROJECT SETUP ##############################################################
2
2
 
3
3
  # Feel free to add whatever functions or variables you want to add in this
4
- # section.
4
+ # section. You may also delete this section altogether if your project doesn't
5
+ # need a custom setup.
5
6
 
6
7
  provision-project() {
7
8
  # This function gets called automatically below.
8
9
  # Feel free to remove these comments.
9
10
  # If your project needs custom setup, then place that here.
11
+ true
10
12
  }
@@ -6,11 +6,13 @@
6
6
  # To regenerate this section, install the gem and run:
7
7
  #
8
8
  <% if provisions.any? -%>
9
- # generate-setup \
10
- <%= provisions.map { |p| "# -p #{p}" }.join(" \\\n") -%>
11
- <% else -%>
9
+ # generate-setup <%= provisions.map { |p| "-p #{p.name}" }.join(" ") -%>
10
+ <% else %>
12
11
  # generate-setup
13
- <% end -%>
12
+ <% end %>
13
+ #
14
+
15
+ # --- SETUP --------------------------------------------------------------------
14
16
 
15
17
  something_already_printed=0
16
18
 
@@ -162,19 +164,6 @@ install-development-libraries() {
162
164
  install rpm=zlib-devel
163
165
  }
164
166
 
165
- <% provisions.each do |provision| -%>
166
- <%= provision.code -%>
167
-
168
- <% end -%>
169
- <% if provisions.any? -%>
170
- run-provisions() {
171
- <% provisions.each do |provision| -%>
172
- provision-<%= provision.name %>
173
- <% end -%>
174
- provision-project
175
- }
176
-
177
- <% end -%>
178
167
  setup() {
179
168
  cd "$(dirname "$(dirname "$0")")"
180
169
  check-for-package-manager
@@ -187,4 +176,24 @@ setup() {
187
176
  success "Done!"
188
177
  }
189
178
 
179
+ <% provisions.each do |provision| -%>
180
+ # --- <%= provision.name.upcase %> <%= '-' * (73 - provision.name.length) %>
181
+
182
+ <%= provision.code -%>
183
+
184
+ <% end -%>
185
+ <% if provisions.any? -%>
186
+ run-provisions() {
187
+ <% provisions.each do |provision| -%>
188
+ provision-<%= provision.name %>
189
+ <% end -%>
190
+
191
+ if type provision-project &>/dev/null; then
192
+ provision-project
193
+ fi
194
+ }
195
+ <% end -%>
196
+
197
+ # --- FIN ----------------------------------------------------------------------
198
+
190
199
  setup
@@ -1,3 +1,3 @@
1
1
  module SetupScriptGenerator
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setup_script_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-17 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler