howzit 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/howzit/config.rb +23 -2
- data/lib/howzit/console_logger.rb +1 -1
- data/lib/howzit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a199c0d74513fee2be1dcd71390927d7776cecf50bd6b075504f9ed82fc548b0
|
4
|
+
data.tar.gz: d3668793cf618dc1d785cab3a7c87b93c3f5cc4edc546ab20b0c10de8986f7a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc109a75df7f9757c3870092b3d3550dba228d4ddc9ff0d58befc5cb1174676808f4a29c8e0805b3e5150bf2c425b8f1d5ccebef226b6fffc96085562094f07
|
7
|
+
data.tar.gz: 394947ec4f9a437af899a4806e2daa60a1ffbd040785ff249dffe258030e88426a594a0b1afbea413839a72173daaf4cfbda4ef8643049296627c7928677fd68
|
data/CHANGELOG.md
CHANGED
data/lib/howzit/config.rb
CHANGED
@@ -22,14 +22,27 @@ module Howzit
|
|
22
22
|
wrap: 0
|
23
23
|
}.deep_freeze
|
24
24
|
|
25
|
+
##
|
26
|
+
## Initialize a config object
|
27
|
+
##
|
25
28
|
def initialize
|
26
29
|
load_options
|
27
30
|
end
|
28
31
|
|
32
|
+
##
|
33
|
+
## Write a config to a file
|
34
|
+
##
|
35
|
+
## @param config The configuration
|
36
|
+
##
|
29
37
|
def write_config(config)
|
30
38
|
File.open(config_file, 'w') { |f| f.puts config.to_yaml }
|
31
39
|
end
|
32
40
|
|
41
|
+
##
|
42
|
+
## Test if a file should be ignored based on YAML file
|
43
|
+
##
|
44
|
+
## @param filename The filename to test
|
45
|
+
##
|
33
46
|
def should_ignore(filename)
|
34
47
|
return false unless File.exist?(ignore_file)
|
35
48
|
|
@@ -47,10 +60,18 @@ module Howzit
|
|
47
60
|
ignore
|
48
61
|
end
|
49
62
|
|
63
|
+
##
|
64
|
+
## Find the template folder
|
65
|
+
##
|
66
|
+
## @return [String] path to template folder
|
67
|
+
##
|
50
68
|
def template_folder
|
51
69
|
File.join(config_dir, 'templates')
|
52
70
|
end
|
53
71
|
|
72
|
+
##
|
73
|
+
## Initiate the editor for the config
|
74
|
+
##
|
54
75
|
def editor
|
55
76
|
edit_config(DEFAULTS)
|
56
77
|
end
|
@@ -91,12 +112,12 @@ module Howzit
|
|
91
112
|
|
92
113
|
def create_config(d)
|
93
114
|
unless File.directory?(config_dir)
|
94
|
-
Howzit.
|
115
|
+
Howzit::ConsoleLogger.new(1).info "Creating config directory at #{config_dir}"
|
95
116
|
FileUtils.mkdir_p(config_dir)
|
96
117
|
end
|
97
118
|
|
98
119
|
unless File.exist?(config_file)
|
99
|
-
Howzit.
|
120
|
+
Howzit::ConsoleLogger.new(1).info "Writing fresh config file to #{config_file}"
|
100
121
|
write_config(d)
|
101
122
|
end
|
102
123
|
config_file
|
data/lib/howzit/version.rb
CHANGED