-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from mojavelinux/issue-185
resolves #185 autofit font size in listing & literal blocks
- Loading branch information
Showing
7 changed files
with
126 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require_relative 'core_ext/array' | ||
require_relative 'core_ext/numeric' | ||
#require_relative 'core_ext/ostruct' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
class Array | ||
def to_h | ||
Hash[to_a] | ||
end unless respond_to? :to_h | ||
end if RUBY_VERSION < '2.1.0' | ||
if RUBY_VERSION < '2.1.0' | ||
def to_h | ||
Hash[to_a] | ||
end unless respond_to? :to_h | ||
end | ||
|
||
def delete_all *entries | ||
entries.map {|entry| delete entry }.compact | ||
end unless respond_to? :delete_all | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Numeric | ||
def with_precision precision | ||
precision = precision.to_i | ||
if precision > 0 | ||
factor = 10 ** precision | ||
(self * factor).truncate / factor.to_f | ||
else | ||
self.truncate | ||
end | ||
end unless respond_to? :with_precision | ||
end |