activity-logger 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fb54d81677b731631afc50608648f02514e3982
4
- data.tar.gz: 865e2600203b73b6dc91a473c77e426bc4a63f44
3
+ metadata.gz: ced4bead49fa1dbceb6eeffd66bc028fcba498fd
4
+ data.tar.gz: 6d525f54e508bef9a963cbde60f7c8a6568804ac
5
5
  SHA512:
6
- metadata.gz: 89fc176a3897f7535d775680fca6d0131eeb8ab60a80db122746db860935ee5b4e2506303260fc97d7d7dc4b16a5d0b0c04c4f99c8f0d26f1a618c9c17b66514
7
- data.tar.gz: 1b6c42571a0534f6bfd7801c8620ee0bae8a69a18742afc524d528e08597d47e8fc777a9a1f96efcc34b11d575263ce89b4038e21e15fdbd2c1be61c1693968c
6
+ metadata.gz: 221583b8eb00d7ae5ec20891a140af7f9604cdeaf0f49c05e832fff791dd7bd0fbb9db5a1a775b6f6467482d9a6a54167011e81a4ab334fbf02262aec8145f5c
7
+ data.tar.gz: 753a1776441a42161d9d87998c7cdde731864639c55b8793a4ccb6def1217c6ff90eb85726aac21989342f42ca7aa651ff95011102af350e6731889c28370a03
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,12 +5,22 @@
5
5
  require 'dynarex-daily'
6
6
  require 'simple-config'
7
7
 
8
+
9
+ module Library
10
+
11
+ def fetch_file(filename)
12
+
13
+ lib = File.dirname(__FILE__)
14
+ File.read File.join(lib,'..','stylesheet',filename)
15
+
16
+ end
17
+ end
18
+
8
19
  class ActivityLogger
9
20
 
10
- attr_writer :xml_instruction
11
21
 
12
22
  def initialize(dir: nil, options: {}, config: nil)
13
-
23
+
14
24
  @options = options
15
25
  @publish_html = false
16
26
 
@@ -28,9 +38,8 @@ class ActivityLogger
28
38
 
29
39
  def create(desc='', time=Time.now)
30
40
 
31
- ddaily = DynarexDaily.new(nil, @options)
41
+ ddaily = DynarexDaily.new(nil, options: @options)
32
42
 
33
- ddaily.xml_instruction = @xml_instruction
34
43
  ddaily.create(time: time.to_s, desc: desc)
35
44
  ddaily.save
36
45
 
@@ -44,12 +53,14 @@ class ActivityLogger
44
53
  # Returns true if the time from the last entry exceeds 45 minutes.
45
54
  #
46
55
  def expired?()
56
+
47
57
  records = DynarexDaily.new.to_h
48
58
  if records and !records.empty? then
49
59
  (Time.now - Time.parse(records.last[:time])) / 60 >= 45
50
60
  else
51
61
  true
52
62
  end
63
+
53
64
  end
54
65
 
55
66
  private
@@ -67,8 +78,8 @@ class ActivityLogger
67
78
 
68
79
  else
69
80
 
70
- lib = File.exists?('notices.xsl') ? '.' : File.dirname(__FILE__)
71
- File.read(File.join(lib,'notices.xsl'))
81
+ fetch_file('notices.xsl')
82
+
72
83
  end
73
84
 
74
85
  xslt = Nokogiri::XSLT(xslt_buffer)
@@ -106,9 +117,8 @@ class ActivityLogger
106
117
  # save the related CSS file locally if the file doesn't already exist
107
118
 
108
119
  if not File.exists? 'notices.css' then
109
- FileUtils.cp File.join(File.dirname(__FILE__), 'notices.css'),\
110
- 'notices.css'
120
+ File.write 'notices.css', fetch_file('notices.css')
111
121
  end
112
122
  end
113
123
 
114
- end
124
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activity-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  rOfBKWCXu0KP485R2A3y2ObqyYihhDjXF9hQVVvQ+nXiOv/HBLL1nFLCKE7iBKWk
32
32
  zy/1qi4eXuuy7Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-05-20 00:00:00.000000000 Z
34
+ date: 2015-05-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex-daily
@@ -80,8 +80,6 @@ extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
82
  - lib/activity-logger.rb
83
- - lib/notices.css
84
- - lib/notices.xsl
85
83
  homepage: https://github.com/jrobertson/activity-logger
86
84
  licenses:
87
85
  - MIT
metadata.gz.sig CHANGED
Binary file
data/lib/notices.css DELETED
@@ -1,173 +0,0 @@
1
- body { background-color: #c48f33;}
2
-
3
-
4
- header{
5
- background-color: rgba(200,200,200,0.1);
6
- border-top: 1px solid rgba(100,150,100,0.4);
7
- border-bottom: 1px solid rgba(100,150,100,0.4);
8
- overflow: hidden
9
- margin: 0.3em; padding: 0.3em 0.1em;
10
- }
11
-
12
- header>nav:first-child>ul{
13
- background-color: transparent;
14
- list-style-type: none;
15
- margin: 0.2em; padding: 0.3em;
16
- }
17
- header>nav:first-child>ul>li {
18
- background-color: transparent;
19
- color: #392;
20
- display: inline;
21
- font-family: Verdana, Arial;
22
- font-size: 1em;
23
- }
24
-
25
- header>nav:first-child>ul>li~li:before {
26
- background-color: transparent; color: rgba(100,150,100,0.6);
27
- content: "> ";
28
- }
29
- header>nav>ul>li>a {background-color: tansparent; color: #494;}
30
- header>nav>ul>li>a:hover {background-color: transparent; color: #272;}
31
- header>nav>ul>li>a:focus {background-color: #161; color: #fff;}
32
- header>nav>ul>li>a:active {background-color: rgba(200,200,200,0.4); color: #5a5;}
33
-
34
- div {
35
- background-color: #AFC332;
36
- background-color: transparent;
37
- background-color: rgba(255,255,255,0.2);
38
- float: left;
39
- min-height: 200px;
40
- margin: 2em; 0.3em;
41
- }
42
-
43
- div ul {
44
-
45
-
46
- background-color: #ee2;
47
- background-color: transparent;
48
- color: rgba(100,100,100,0.9);
49
- list-style-type: none;
50
- margin: 0.2em; padding: 0.5em;
51
- }
52
-
53
- div ul li{
54
-
55
- background-color: #443;
56
- background-color: rgba(255,255,255,0.2);
57
- margin: 0.5em;
58
- padding: 1em;
59
- overflow: hidden;
60
- }
61
-
62
- div ul li time, div ul li span {
63
-
64
- background-color: transparent;
65
- }
66
-
67
- div ul li time {
68
-
69
- background-color: transparent;
70
- background-color: rgba(255,255,255,0.2);
71
- float: right;
72
- margin: 0.3em; padding: 0.2em; 0.6em;
73
- margin-top: 2em;
74
-
75
-
76
- }
77
-
78
- div ul li span {
79
-
80
- background-color: transparent;
81
- font-size: 1.4em;
82
- float: left;
83
- margin: 0.3em; padding: 0.6em;
84
- }
85
-
86
-
87
-
88
- aside {
89
-
90
- background-color: transparent;
91
- background-color: rgba(255,255,255,0.2);
92
- float: left;
93
- margin: 3em;
94
-
95
- }
96
-
97
- aside ul {
98
- background-color: transparent;
99
- list-style-type: none;
100
- margin: 0.4em 0.7em;
101
- padding: 0.6em 0.9em;
102
- color: #c48f33;
103
- }
104
-
105
- aside ul li {
106
- background-color: transparent;
107
-
108
-
109
- font-family: helvetica, arial;
110
- font-size: 1.6em;
111
- font-weight: 900;
112
-
113
- margin: 0.4em;
114
- padding: 0.9em;
115
- text-align: center;
116
- }
117
-
118
- aside ul li a{
119
- background-color: transparent;
120
- color: rgba(100,100,100,0.4);
121
- text-decoration: none;
122
- }
123
-
124
- aside ul li a:hover {
125
- background-color: rgba(100, 100, 100, 0.5);
126
- color: #eee;
127
- text-decoration: none;
128
- }
129
-
130
-
131
- footer{
132
- background-color: rgba(255,255,255,0.2);
133
- clear: both;
134
- }
135
-
136
- footer>dl#info{
137
- background-color: transparent;
138
-
139
- margin: 1.9em 0 0 0; padding: 2em;
140
- width: 33em;
141
- overflow: hidden;
142
- }
143
-
144
- footer>dl#info{
145
- background-color: transparent;
146
- margin: 4.1em 0 0.1em 0;
147
- }
148
- footer>dl#info dt{
149
- background-color: transparent;
150
- float: left;
151
- font:15px arial,sans-serif;
152
- padding: 0.2em 0;
153
- margin: 0.1em 0 0.1em 0;
154
- text-align: left;
155
- width: 4.8em;
156
- }
157
- footer>dl#info dd{
158
- background-color: transparent;
159
- float: left;
160
- margin: 0.1em 0; padding: 0.2em 0.2em;
161
- width: 27em;
162
- }
163
- footer>dl#info ul{
164
- background-color: transparent;
165
- list-style-type: none;
166
- margin: 0 0em; padding: 0 0em;
167
- }
168
- dl#info ul li {
169
- background-color: transparent;
170
- float: left;
171
- padding: 0em 0.5em 0 0;
172
- margin: 0em;
173
- }
data/lib/notices.xsl DELETED
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
- <xsl:output method="html" encoding="utf-8" indent="yes" />
4
-
5
- <xsl:template match="*">
6
- <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
7
- <html>
8
- <head>
9
- <title><xsl:value-of select='summary/title'/></title>
10
- <link rel='stylesheet' type='text/css' href='{summary/css_url}' media='screen, projection, tv, print'/>
11
- </head>
12
- <body>
13
-
14
- <header>
15
- <nav>
16
- <ul>
17
- <li>
18
- <a href="/">home</a>
19
- </li>
20
- <li>
21
- <a href="/notices">notices</a>
22
- </li>
23
- </ul>
24
- </nav>
25
- </header>
26
-
27
- <div>
28
- <ul>
29
- <xsl:for-each select="records/entry">
30
- <li>
31
- <xsl:copy-of select='desc/span'/>
32
- <time><xsl:value-of select='time'/></time>
33
- </li>
34
- </xsl:for-each>
35
- </ul>
36
- </div>
37
-
38
- <aside>
39
- <ul>
40
- <li><xsl:value-of select='summary/date'/></li>
41
- <li>
42
- <a href="{summary/edit_url}" rel="nofollow">edit</a>
43
- </li>
44
- </ul>
45
- </aside>
46
-
47
- <footer>
48
- <dl id="info">
49
- <dt>Source:</dt><dd><a href="index.txt">index.txt</a></dd>
50
- <dt>XML:</dt><dd><a href="formatted.xml">formatted.xml</a></dd>
51
- <dt>Published:</dt><dd><xsl:value-of select="summary/published"/></dd>
52
- </dl>
53
- </footer>
54
-
55
- </body>
56
- </html>
57
- </xsl:template>
58
- </xsl:stylesheet>