polyrex-calendar 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 021333d20ed22cf97b2d3a6a6b5b99a89f3bad1a
4
- data.tar.gz: c319c0462433bff77d5c442a0a85dc29cddc0f0a
3
+ metadata.gz: c1bd0817f0fbc853d16da717b545c705c75ea02d
4
+ data.tar.gz: 46674a89c7f16df0a64fbf2b74ff1184eb5ca1a0
5
5
  SHA512:
6
- metadata.gz: e39a9f8e19fccfcb87e6f9517625808c25be94e2f68b36f0156f69b2508333ec5c366bc881f4e836f7fe377c030cea87d469d9000937fff5a2e1a0f27645b36a
7
- data.tar.gz: 9c0074b6867fda73e149746dd27ec4f39a7ccaa687e3155928e989a3a21b45a1e535f900ae4583c57225faff4424302b78e5608451ac5b1f65c5a92605bb0350
6
+ metadata.gz: a25982a832f6e925270a0b5ed95d40ef7689fb5b419c2538f78d5a82fcaca9a12667c5d630c1ef6de68b549224a3df0607d647a5ba411e316dbb75c9ea00c63b
7
+ data.tar.gz: 5c906c9fcf4cdedbbc174e0961180753d5fae8bf72f60b8d035c6d1c53e062e8d5969deeef54e8be589f6802908b1a7502d6f0bab73ad6da600f2a43a7ddf83e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,6 +5,16 @@
5
5
  require 'polyrex_calendarbase'
6
6
 
7
7
 
8
+ module LIBRARY
9
+
10
+ def fetch_file(filename)
11
+
12
+ lib = File.dirname(__FILE__)
13
+ File.read filename
14
+
15
+ end
16
+ end
17
+
8
18
  class PolyrexObjects
9
19
 
10
20
  class Month
@@ -12,6 +12,25 @@ class PolyrexObjects
12
12
  def wk(n)
13
13
  self.records[n-1]
14
14
  end
15
+
16
+ def to_webpage()
17
+
18
+ month_xsl = fetch_file self.xslt
19
+ month_layout_css = fetch_file self.css_layout
20
+ month_css = fetch_file self.css_style
21
+
22
+ # add a css selector for the current day
23
+ date = Time.now.strftime("%Y-%b-%d")
24
+ e = self.element("records/week/records/day/summary[sdate='#{date}']")
25
+ e.attributes[:class] = 'selected' if e
26
+
27
+ File.write 'self.xml', self.to_xml(pretty: true)
28
+ File.write 'month.xsl', month_xsl
29
+
30
+ html = generate_webpage self.to_xml, month_xsl
31
+ {self.title.downcase[0..2] + '_calendar.html' => html,
32
+ self.css_layout => month_layout_css, self.css_style => month_css}
33
+ end
15
34
  end
16
35
 
17
36
  class Week
@@ -140,7 +159,7 @@ class PolyrexCalendar < PolyrexCalendarBase
140
159
  when 0 then a
141
160
 
142
161
  # add a few placeholders before the 1st day
143
- else Array.new(6 - wday) + a
162
+ else Array.new(8 - wday) + a
144
163
  end
145
164
 
146
165
  r
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  V2LbfuIuDVCUDR9ON1ozFySFLuTnZSmO6lR4UsFjHKwbtnnbapfQVvEJ1PLW/F13
32
32
  1r3+lzIVNJhpdQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-01-17 00:00:00.000000000 Z
34
+ date: 2015-01-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex_calendarbase
metadata.gz.sig CHANGED
Binary file