Skip to content

Commit

Permalink
save Integer (insted of Fixnum) option value in views/tdiary.rconf
Browse files Browse the repository at this point in the history
  • Loading branch information
tdtds committed Jan 20, 2017
1 parent f8c0330 commit 3c1f949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/HOWTO-make-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ end
- security: セキュリティ関連
- etc: その他

@modeが'saveconf'の時のみ、@cgi経由で渡された設定を保存します。保存先は@conf[]にオプション用のキーワードを指定して代入します。これは従来tdiary.confにて、@optionsとして指定したものと同じです。なお、conf\_procで保存できるオプションは、文字列(String)、整数(Fixnum)、真偽値(TrueClass/FalseClass)、nil(NilClass)で表現されるオブジェクトだけです。
@modeが'saveconf'の時のみ、@cgi経由で渡された設定を保存します。保存先は@conf[]にオプション用のキーワードを指定して代入します。これは従来tdiary.confにて、@optionsとして指定したものと同じです。なお、conf\_procで保存できるオプションは、文字列(String)、整数(Integer/Fixnum)、真偽値(TrueClass/FalseClass)、nil(NilClass)で表現されるオブジェクトだけです。

conf\_procを使って設定を保存すると、その後はtdiary.confによる@optionsは効かなくなるので注意が必要です。

Expand Down
2 changes: 1 addition & 1 deletion views/tdiary.rconf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ options2 = {
<% @options2.keys.sort.each do |k|
if @options2[k].class.to_s == "String" then
v = @options2[k].force_encoding('ASCII-8BIT').dump
elsif @options2[k].class.to_s =~ /^(Fixnum|FalseClass|TrueClass|NilClass)$/
elsif @options2[k].class.to_s =~ /^(Integer|Fixnum|FalseClass|TrueClass|NilClass)$/
v = @options2[k].inspect
else
next
Expand Down

0 comments on commit 3c1f949

Please sign in to comment.