lib/onebox/mixins/git_blob_onebox.rb in onebox-1.9.20 vs lib/onebox/mixins/git_blob_onebox.rb in onebox-1.9.21
- old
+ new
@@ -23,13 +23,13 @@
MAX_LINES: 20,
MAX_CHARS: 5000
}
module InstanceMethods
- def initialize(link, cache = nil, timeout = nil)
- super link, cache , timeout
- #merge engine options from global Onebox.options interface
+ def initialize(link, timeout = nil)
+ super link, timeout
+ # merge engine options from global Onebox.options interface
# 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
@@ -172,12 +172,12 @@
contents_lines = contents.lines #get contents lines
contents_lines_size = contents_lines.size #get number of lines
cr = calc_range(m, contents_lines_size) #calculate the range of lines for output
selected_one_liner = cr[:selected_one_liner] #if url is a one-liner calc_range will return it
- from = cr[:from]
- to = cr[:to]
- @truncated = cr[:truncated]
+ from = cr[:from]
+ to = cr[:to]
+ @truncated = cr[:truncated]
range_provided = cr[:range_provided]
@cr_results = cr
if range_provided #if a range provided (single line or more)
if SHOW_LINE_NUMBER