main 4.7.3 → 4.7.4

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.
data/lib/main.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Main
2
2
  # top level constants
3
3
  #
4
- Main::VERSION = '4.7.3' unless
4
+ Main::VERSION = '4.7.4' unless
5
5
  defined? Main::VERSION
6
6
  def self.version() Main::VERSION end
7
7
 
@@ -304,9 +304,18 @@ 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 = args.last.is_a?(Hash) ? args.last : {}
307
+ config =
308
+ case args.last
309
+ when Hash
310
+ args.last
311
+ when String
312
+ YAML.parse(Util.unindent(args.last))
313
+ else
314
+ {}
315
+ end
308
316
  lines = config.to_yaml.split(/\n/)
309
317
  dash = lines.shift
318
+ FileUtils.mkdir_p(File.dirname(config_path))
310
319
  open(config_path, 'w') do |fd|
311
320
  fd.puts '### you may need to edit this config!'
312
321
  fd.puts
@@ -319,6 +328,7 @@ module Main
319
328
  end
320
329
  @config
321
330
  end
331
+ alias_method('edit_config_file!', 'config')
322
332
 
323
333
  def config_path(*config_path)
324
334
  @config_path = File.join(dotdir, 'config.yml') unless defined?(@config_path)
data/main.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "main"
6
- spec.version = "4.7.3"
6
+ spec.version = "4.7.4"
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: 37
4
+ hash: 43
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 7
9
- - 3
10
- version: 4.7.3
9
+ - 4
10
+ version: 4.7.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ara T. Howard
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-17 00:00:00 -06:00
19
- default_executable:
18
+ date: 2011-09-18 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: fattr
@@ -123,10 +122,11 @@ files:
123
122
  - samples/h.rb
124
123
  - samples/j.rb
125
124
  - test/main_test.rb
126
- has_rdoc: true
127
125
  homepage: https://github.com/ahoward/main
128
126
  licenses: []
129
127
 
128
+ metadata: {}
129
+
130
130
  post_install_message:
131
131
  rdoc_options: []
132
132
 
@@ -153,9 +153,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  requirements: []
154
154
 
155
155
  rubyforge_project: codeforpeople
156
- rubygems_version: 1.4.2
156
+ rubygems_version: 1.8.10
157
157
  signing_key:
158
- specification_version: 3
158
+ specification_version: 4
159
159
  summary: main
160
160
  test_files: []
161
161