hotdog 1.20190725.0 → 1.20191028.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/lib/hotdog/application.rb +21 -13
- data/lib/hotdog/commands.rb +6 -1
- data/lib/hotdog/expression/semantics.rb +1 -1
- data/lib/hotdog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc7f01237e5e718c19c91da270e2797c93f9a856a7523b606f191308db2e5dd6
|
4
|
+
data.tar.gz: f090618091d02d4a9b5b584b7abf7f0fbc2d3f2b6db022904cf4abd4af95c4c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8defb7bfc76397da0ec2f1fb508f8f55d2fec772a0ca58d66aff8b7abf15fdedde2851c0ac545a7a910ebb98eab36aec273ce187b366090b772103c671590865
|
7
|
+
data.tar.gz: b65b3a4e73f35768605ff26f9af42b17a095f8343a351261c0fce7df017a76bbad862c4ed7e829c43985d02fd762e3551219275161a5ae0cfce50df6a477e7a8
|
data/.travis.yml
CHANGED
data/lib/hotdog/application.rb
CHANGED
@@ -49,7 +49,7 @@ module Hotdog
|
|
49
49
|
confdir: find_confdir(File.expand_path(".")),
|
50
50
|
debug: false,
|
51
51
|
expiry: 3600,
|
52
|
-
|
52
|
+
use_fallback: false,
|
53
53
|
force: false,
|
54
54
|
format: "text",
|
55
55
|
headers: false,
|
@@ -80,16 +80,21 @@ module Hotdog
|
|
80
80
|
attr_reader :source_provider
|
81
81
|
|
82
82
|
def main(argv=[])
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
83
|
+
[
|
84
|
+
File.join(options[:confdir], "config.yaml"),
|
85
|
+
File.join(options[:confdir], "config.yml"),
|
86
|
+
].each do |config|
|
87
|
+
if File.file?(config)
|
88
|
+
begin
|
89
|
+
loaded = YAML.load(ERB.new(File.read(config)).result)
|
90
|
+
rescue => error
|
91
|
+
STDERR.puts("hotdog: failed to load configuration file at #{config.inspect}: #{error}")
|
92
|
+
exit(1)
|
93
|
+
end
|
94
|
+
if Hash === loaded
|
95
|
+
@options = @options.merge(Hash[loaded.map { |key, value| [Symbol === key ? key : key.to_s.to_sym, value] }])
|
96
|
+
end
|
97
|
+
break
|
93
98
|
end
|
94
99
|
end
|
95
100
|
args = @optparse.order(argv)
|
@@ -217,8 +222,11 @@ module Hotdog
|
|
217
222
|
@optparse.on("-d", "--[no-]debug", "Enable debug mode") do |v|
|
218
223
|
options[:debug] = v
|
219
224
|
end
|
220
|
-
@optparse.on("--fixed-string", "
|
221
|
-
options[:
|
225
|
+
@optparse.on("--[no-]fixed-string", "Never fallback to alternative expression in case of result is empty. Inversed meaning as '--use-fallback'") do |v|
|
226
|
+
options[:use_fallback] = !v
|
227
|
+
end
|
228
|
+
@optparse.on("--[no-]use-fallback", "Fallback to alternative expressions in case of result is empty. Inversed meaning as '--fixed-string'") do |v|
|
229
|
+
options[:use_fallback] = v
|
222
230
|
end
|
223
231
|
@optparse.on("-f", "--[no-]force", "Enable force mode") do |v|
|
224
232
|
options[:force] = v
|
data/lib/hotdog/commands.rb
CHANGED
@@ -28,8 +28,13 @@ module Hotdog
|
|
28
28
|
execute_db(@db, q, args)
|
29
29
|
end
|
30
30
|
|
31
|
+
def fallback?()
|
32
|
+
@options[:use_fallback]
|
33
|
+
end
|
34
|
+
|
31
35
|
def fixed_string?()
|
32
|
-
|
36
|
+
# deprecated - superseded by `fallback?`
|
37
|
+
not @options[:use_fallback]
|
33
38
|
end
|
34
39
|
|
35
40
|
def reload(options={})
|
@@ -694,7 +694,7 @@ module Hotdog
|
|
694
694
|
if options[:did_fallback]
|
695
695
|
[]
|
696
696
|
else
|
697
|
-
if
|
697
|
+
if environment.use_fallback? and @options[:fallback]
|
698
698
|
# avoid optimizing @options[:fallback] to prevent infinite recursion
|
699
699
|
@options[:fallback].evaluate(environment, options.merge(did_fallback: true))
|
700
700
|
else
|
data/lib/hotdog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20191028.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamashita Yuu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|