Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove backward compatibility #560

Merged
merged 2 commits into from
Apr 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/review/book/page_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ def initialize(list_lines, list_columns, text_lines, text_columns, page_per_kbyt
A5 = PageMetric.new(46, 80, 30, 74, 1)
B5 = PageMetric.new(46, 80, 30, 74, 2)

# backward compatible
def PageMetric.a5
ReVIEW::Book::PageMetric::A5
end

# backward compatible
def PageMetric.b5
ReVIEW::Book::PageMetric::B5
end

attr_reader :list
attr_reader :text
attr_reader :page_per_kbyte
Expand Down
2 changes: 1 addition & 1 deletion lib/review/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.values
"reject_file" => 'REJECT',
"predef_file" => 'PREDEF',
"postdef_file" => 'POSTDEF',
"page_metric" => ReVIEW::Book::PageMetric.a5,
"page_metric" => ReVIEW::Book::PageMetric::A5,
"ext" => '.re',
"image_dir" => 'images',
"image_types" => %w( .ai .psd .eps .pdf .tif .tiff .png .bmp .jpg .jpeg .gif .svg ),
Expand Down
4 changes: 2 additions & 2 deletions lib/review/htmlbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def builder_init_file

def result
layout_file = File.join(@book.basedir, "layouts", "layout.html.erb")
unless File.exist?(layout_file) # backward compatibility
layout_file = File.join(@book.basedir, "layouts", "layout.erb")
if !File.exist?(layout_file) && File.exist?(File.join(@book.basedir, "layouts", "layout.erb"))
raise ReVIEW::ConfigError, "layout.erb is obsoleted. Please use layout.html.erb."
end
if File.exist?(layout_file)
if ENV["REVIEW_SAFE_MODE"].to_i & 4 > 0
Expand Down
4 changes: 2 additions & 2 deletions lib/review/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def self.setup(locale="ja", ymlfile = "locale.yml")
lfile = File.expand_path(ymlfile, Dir.pwd)

# backward compatibility
if !File.exist?(lfile) && (ymlfile == "locale.yml")
lfile = File.expand_path("locale.yaml", Dir.pwd)
if !File.exist?(lfile) && (ymlfile == "locale.yml") && File.exist?(File.expand_path("locale.yaml", Dir.pwd))
raise ReVIEW::ConfigError, "locale.yaml is obsoleted. Please use locale.yml."
end
end

Expand Down
5 changes: 3 additions & 2 deletions test/test_i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def test_load_locale_yaml
Dir.chdir(dir) do
file = File.join(dir, "locale.yaml")
File.open(file, "w"){|f| f.write("locale: ja\nfoo: \"bar\"\n")}
I18n.setup
assert_equal "bar", I18n.t("foo")
assert_raise ReVIEW::ConfigError do
I18n.setup
end
end
end
end
Expand Down