ts_json_api 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ts_json_api/logging/file.rb +12 -1
- data/lib/ts_json_api/version.rb +1 -1
- metadata +1 -1
|
@@ -2,6 +2,8 @@ module TsJsonApi
|
|
|
2
2
|
module Logging
|
|
3
3
|
class File
|
|
4
4
|
|
|
5
|
+
extend ActiveModel::Naming
|
|
6
|
+
|
|
5
7
|
attr_reader :path, :options
|
|
6
8
|
|
|
7
9
|
def initialize(options={})
|
|
@@ -44,10 +46,19 @@ module TsJsonApi
|
|
|
44
46
|
json
|
|
45
47
|
end
|
|
46
48
|
|
|
49
|
+
def basename
|
|
50
|
+
::File.basename(@path)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Support for dom_id in views
|
|
54
|
+
def to_key
|
|
55
|
+
[basename.parameterize]
|
|
56
|
+
end
|
|
57
|
+
|
|
47
58
|
private
|
|
48
59
|
|
|
49
60
|
def content_string(str)
|
|
50
|
-
{ time: Time.now, url: options[:url], content: str }.to_json
|
|
61
|
+
{ time: Time.now.to_i, url: options[:url], content: str }.to_json
|
|
51
62
|
end
|
|
52
63
|
|
|
53
64
|
def create_dir_if_not_exists
|
data/lib/ts_json_api/version.rb
CHANGED