main 4.7.4 → 4.7.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Main
2
2
  # top level constants
3
3
  #
4
- Main::VERSION = '4.7.4' unless
4
+ Main::VERSION = '4.7.5' unless
5
5
  defined? Main::VERSION
6
6
  def self.version() Main::VERSION end
7
7
 
@@ -304,20 +304,21 @@ module Main
304
304
  if test(?s, config_path)
305
305
  @config = Map.for(YAML.load(IO.read(config_path)))
306
306
  else
307
- config =
308
- case args.last
307
+ config = args.last
308
+ lines =
309
+ case config
309
310
  when Hash
310
- args.last
311
+ config.to_yaml.split(/\n/)
311
312
  when String
312
- YAML.parse(Util.unindent(args.last))
313
+ Util.unindent(config)
313
314
  else
314
- {}
315
+ []
315
316
  end
316
- lines = config.to_yaml.split(/\n/)
317
- dash = lines.shift
317
+ dash = lines.shift if lines.first.to_s =~ /^---/
318
318
  FileUtils.mkdir_p(File.dirname(config_path))
319
319
  open(config_path, 'w') do |fd|
320
- fd.puts '### you may need to edit this config!'
320
+ fd.puts '## you may need to edit this config!'
321
+ fd.puts '#'
321
322
  fd.puts
322
323
  fd.puts lines
323
324
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "main"
6
- spec.version = "4.7.4"
6
+ spec.version = "4.7.5"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "main"
9
9
  spec.description = "description: main kicks the ass"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: main
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 7
9
- - 4
10
- version: 4.7.4
9
+ - 5
10
+ version: 4.7.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ara T. Howard