lib/onebox/mixins/git_blob_onebox.rb in onebox-2.2.12 vs lib/onebox/mixins/git_blob_onebox.rb in onebox-2.2.13
- old
+ new
@@ -31,10 +31,14 @@
# self.options = Onebox.options["GithubBlobOnebox"] # self.class.name.split("::").last.to_s
# self.options = Onebox.options[self.class.name.split("::").last.to_s] #We can use this a more generic approach. extract the engine class name automatically
self.options = DEFAULTS
+ @selected_lines_array = nil
+ @selected_one_liner = 0
+ @model_file = nil
+
# Define constant after merging options set in Onebox.options
# We can define constant automatically.
options.each_pair do |constant_name, value|
constant_name_u = constant_name.to_s.upcase
if constant_name_u == constant_name.to_s
@@ -45,12 +49,10 @@
end
end
end
private
- @selected_lines_array = nil
- @selected_one_liner = 0
def calc_range(m, contents_lines_size)
truncated = false
from = /\d+/.match(m[:from]) #get numeric should only match a positive interger
to = /\d+/.match(m[:to]) #get numeric should only match a positive interger
@@ -148,10 +150,10 @@
}
{ output: output_builder.join(), array: hash_builder }
end
def raw
- return @raw if @raw
+ return @raw if defined?(@raw)
m = @url.match(self.raw_regexp)
if m
from = /\d+/.match(m[:from]) #get numeric should only match a positive interger