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 +1 -1
- data/lib/main/program/class_methods.rb +11 -1
- data/main.gemspec +1 -1
- metadata +8 -8
data/lib/main.rb
CHANGED
|
@@ -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 =
|
|
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
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:
|
|
4
|
+
hash: 43
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 4
|
|
8
8
|
- 7
|
|
9
|
-
-
|
|
10
|
-
version: 4.7.
|
|
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-
|
|
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.
|
|
156
|
+
rubygems_version: 1.8.10
|
|
157
157
|
signing_key:
|
|
158
|
-
specification_version:
|
|
158
|
+
specification_version: 4
|
|
159
159
|
summary: main
|
|
160
160
|
test_files: []
|
|
161
161
|
|