polyrex-calendar 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/polyrex-calendar.rb +25 -47
- data/stylesheet/kplanner.xsl +2 -1
- data/stylesheet/monthday_print.css +5 -0
- data.tar.gz.sig +0 -0
- metadata +32 -28
- metadata.gz.sig +4 -1
- data/stylesheet/calendar.xsl~ +0 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eb2795297af9c4bc240d1b67681aca4bc63f093a73dcf363fab4be22ba7dea42
|
4
|
+
data.tar.gz: c6c9f62974d4a115d46c9089ea3919bcfaeef6cedb770e0e1f963118de0dbf00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dcbff3df45ba1c73cf968f3aeb5b135388d66a0162333f26e1e7e9e07d6c24c213d56ebc4a2e6fafdb8602b45cb23c60e870fda5c4788bf0b11332f00d1ffb9
|
7
|
+
data.tar.gz: 187e2cb775e4aca8bbb8c85cdbb1a08ae78f5fbac903f397566b8e0a81a225c3c12742b1fd978895c08a3b353ae43afaf68c4aa68000041f81f568d7092bd3b0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-calendar.rb
CHANGED
@@ -6,35 +6,6 @@ require 'polyrex_calendarbase'
|
|
6
6
|
require 'weeklyplanner_template'
|
7
7
|
|
8
8
|
|
9
|
-
module LIBRARY2
|
10
|
-
|
11
|
-
def fetch_filepath(filename)
|
12
|
-
|
13
|
-
lib = File.dirname(__FILE__)
|
14
|
-
File.join(lib,'..','stylesheet',filename)
|
15
|
-
end
|
16
|
-
|
17
|
-
def fetch_file(filename)
|
18
|
-
|
19
|
-
filepath = fetch_filepath filename
|
20
|
-
read filepath
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
def generate_webpage(xml, xsl)
|
25
|
-
|
26
|
-
# transform the xml to html
|
27
|
-
doc = Nokogiri::XML(xml)
|
28
|
-
xslt = Nokogiri::XSLT(xsl)
|
29
|
-
xslt.transform(doc).to_s
|
30
|
-
end
|
31
|
-
|
32
|
-
def read(s)
|
33
|
-
RXFHelper.read(s).first
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
|
38
9
|
class PolyrexObjects
|
39
10
|
|
40
11
|
class Month
|
@@ -74,23 +45,8 @@ class PolyrexObjects
|
|
74
45
|
|
75
46
|
def to_webpage()
|
76
47
|
|
77
|
-
#week_xsl = fetch_file 'week_calendar.xsl'
|
78
|
-
#week_layout_css = fetch_file 'week_layout.css'
|
79
|
-
#week_css = fetch_file 'week.css'
|
80
|
-
|
81
|
-
#File.write 'self.xml', self.to_xml(pretty: true)
|
82
|
-
#File.write 'week.xsl', week_xsl
|
83
|
-
#html = Rexslt.new(week_xsl, self.to_xml).to_xml
|
84
|
-
#html = xsltproc 'week_calendar.xsl', self.to_xml
|
85
|
-
|
86
|
-
# add a css selector for the current day
|
87
|
-
#highlight_today()
|
88
|
-
|
89
|
-
|
90
|
-
#html = generate_webpage self.to_xml, week_xsl
|
91
|
-
#{'week' + self.no + '_planner.html' => html, 'week_layout.css' => week_layout_css, \
|
92
|
-
#'week.css' => week_css}
|
93
48
|
WeeklyplannerTemplate.new(self.to_xml, template: 'default').to_h
|
49
|
+
|
94
50
|
end
|
95
51
|
end
|
96
52
|
|
@@ -98,9 +54,19 @@ class PolyrexObjects
|
|
98
54
|
end
|
99
55
|
|
100
56
|
class PolyrexCalendar < PolyrexCalendarBase
|
57
|
+
|
101
58
|
|
102
|
-
def initialize(calendar_file=nil, year:
|
59
|
+
def initialize(calendar_file=nil, year: nil, debug: false)
|
60
|
+
|
61
|
+
@debug = debug
|
62
|
+
|
63
|
+
year = if year.nil? then
|
64
|
+
(Date.today.month > 6 ? Date.today.year + 1 : Date.today.year).to_s
|
65
|
+
else
|
66
|
+
year
|
67
|
+
end
|
103
68
|
|
69
|
+
puts ('year: ' + year.inspect).debug if @debug
|
104
70
|
super(calendar_file, year: year)
|
105
71
|
|
106
72
|
@xsl = fetch_file 'calendar.xsl'
|
@@ -212,6 +178,18 @@ class PolyrexCalendar < PolyrexCalendarBase
|
|
212
178
|
end
|
213
179
|
|
214
180
|
end
|
181
|
+
|
182
|
+
def save(planner_name, xslt: nil)
|
183
|
+
|
184
|
+
planner = self.kitchen_planner
|
185
|
+
return unless planner
|
186
|
+
|
187
|
+
planner.xslt = xslt if xslt
|
188
|
+
h = planner.to_webpage
|
189
|
+
h.each_pair {|filename, value| FileX.write filename, value }
|
190
|
+
"saved %s" % File.join(Dir.pwd, h.keys.first.to_s)
|
191
|
+
|
192
|
+
end
|
215
193
|
|
216
194
|
def this_week()
|
217
195
|
|
@@ -293,4 +271,4 @@ class PolyrexCalendar < PolyrexCalendarBase
|
|
293
271
|
'th' : %w{ th st nd rd th th th th th th }[val % 10]
|
294
272
|
end
|
295
273
|
|
296
|
-
end
|
274
|
+
end
|
data/stylesheet/kplanner.xsl
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
<title><xsl:value-of select="summary/title"/><xsl:text> </xsl:text><xsl:value-of select="summary/year"/> kitchen planner | generated by Polyrex-Calendar</title>
|
11
11
|
<link rel="stylesheet" href="monthday_layout.css" media="screen, projection, tv, print"/>
|
12
12
|
<link rel="stylesheet" href="monthday.css" media="screen, projection, tv, print"/>
|
13
|
+
<link rel="stylesheet" href="monthday_print.css" media="print"/>
|
13
14
|
</head>
|
14
15
|
|
15
16
|
<body>
|
@@ -73,4 +74,4 @@
|
|
73
74
|
</xsl:template>
|
74
75
|
|
75
76
|
|
76
|
-
</xsl:stylesheet>
|
77
|
+
</xsl:stylesheet>
|
data.tar.gz.sig
CHANGED
Binary file
|
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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgxMjI4MTQ0NzE4WhcN
|
15
|
+
MTkxMjI4MTQ0NzE4WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC3wR+x
|
17
|
+
I1TY1a+hebpV91wFowySg5sGhyHpXWH21+MEaRKNxI73By671vfgbMEqFUvcUaYp
|
18
|
+
zVpW5l4L30BFITDUKjt1nQa1H+h3QXq3OJZyKrOuJ3Hej9V1W0f7jh7PCe/FjJjQ
|
19
|
+
7EGbeha9VKIsJEdRuGbfwRCLkCg8a6z7OXdXZ8X4hMXZYDxtxHd1F8BHkAs4niuh
|
20
|
+
IWI/lTEfKWYPep20YtZ2GlxjqFemjNlqaHSIWxlJlymdE9WbaN2RfMfLp6qZT4qc
|
21
|
+
9dRHLnkt2tEdFSNszURLFmClpVZB2A5VgwUsq6Et2ZGE2CfcXC0fjyXwTq543hs1
|
22
|
+
10YA3WGUg7try97osItETpOPTTzQwybdMfl2KVVYk+zFMdSQDxFa83Mx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39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: polyrex_calendarbase
|
@@ -39,20 +43,20 @@ dependencies:
|
|
39
43
|
requirements:
|
40
44
|
- - "~>"
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
46
|
+
version: '0.3'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
49
|
+
version: 0.3.0
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
49
53
|
requirements:
|
50
54
|
- - "~>"
|
51
55
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
56
|
+
version: '0.3'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
59
|
+
version: 0.3.0
|
56
60
|
- !ruby/object:Gem::Dependency
|
57
61
|
name: weeklyplanner_template
|
58
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +85,6 @@ extra_rdoc_files: []
|
|
81
85
|
files:
|
82
86
|
- lib/polyrex-calendar.rb
|
83
87
|
- stylesheet/calendar.xsl
|
84
|
-
- stylesheet/calendar.xsl~
|
85
88
|
- stylesheet/kplanner.xsl
|
86
89
|
- stylesheet/kplanner_month.xsl
|
87
90
|
- stylesheet/layout.css
|
@@ -91,6 +94,7 @@ files:
|
|
91
94
|
- stylesheet/month_layout.css
|
92
95
|
- stylesheet/monthday.css
|
93
96
|
- stylesheet/monthday_layout.css
|
97
|
+
- stylesheet/monthday_print.css
|
94
98
|
- stylesheet/week.css
|
95
99
|
- stylesheet/week_calendar.xsl
|
96
100
|
- stylesheet/week_layout.css
|
@@ -115,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
119
|
version: '0'
|
116
120
|
requirements: []
|
117
121
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.6
|
122
|
+
rubygems_version: 2.7.6
|
119
123
|
signing_key:
|
120
124
|
specification_version: 4
|
121
125
|
summary: Generates an HTML calendar from a Polyrex document
|
metadata.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
��՝�����h�w�c�2�z�o�B � N�a������8;�-
|
2
|
+
���2�l�`�&�Ǧ^~�@V��&�{�n~�}og�=�Ũ�9g>�y����܌�k4E/��F���%�Z�cF�Ov��
|
3
|
+
�����*s-ͣ;<�iG���V÷��ʀYU���7`�g\(�[<-����X�)�<VK�h;w�a��2�:��n
|
4
|
+
���q$�6HN�XV�������C>C��G��+锉������+B�ۻA²�F�I����g��r�.����,� v�BC�/��k�<��CJ�w%/�n���������&�������\N4��@��+�
|
data/stylesheet/calendar.xsl~
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
-
<xsl:output method="xml" indent="yes" />
|
4
|
-
|
5
|
-
<xsl:template match="calendar">
|
6
|
-
|
7
|
-
<html lang="en">
|
8
|
-
|
9
|
-
<head>
|
10
|
-
<title><xsl:value-of select="summary/year"/> Calendar | generated by Polyrex-Calendar</title>
|
11
|
-
<link rel="stylesheet" href="xlayout.css"/>
|
12
|
-
</head>
|
13
|
-
|
14
|
-
<body>
|
15
|
-
<div id="wrap">
|
16
|
-
<h1><xsl:value-of select="summary/year"/></h1>
|
17
|
-
<xsl:apply-templates select="records"/>
|
18
|
-
</div>
|
19
|
-
</body>
|
20
|
-
</html>
|
21
|
-
|
22
|
-
</xsl:template>
|
23
|
-
|
24
|
-
<xsl:template match="records/month">
|
25
|
-
<div class="table">
|
26
|
-
<table border="1">
|
27
|
-
<xsl:apply-templates select="summary"/>
|
28
|
-
<tr><th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th></tr>
|
29
|
-
<xsl:apply-templates select="records"/>
|
30
|
-
</table>
|
31
|
-
</div>
|
32
|
-
</xsl:template>
|
33
|
-
|
34
|
-
<xsl:template match="month/summary">
|
35
|
-
<caption><xsl:value-of select="name"/></caption>
|
36
|
-
</xsl:template>
|
37
|
-
|
38
|
-
<xsl:template match="records/week">
|
39
|
-
<xsl:apply-templates select="summary"/>
|
40
|
-
<xsl:element name="tr">
|
41
|
-
<xsl:apply-templates select="records"/>
|
42
|
-
</xsl:element>
|
43
|
-
</xsl:template>
|
44
|
-
|
45
|
-
<xsl:template match="week/summary">
|
46
|
-
|
47
|
-
</xsl:template>
|
48
|
-
|
49
|
-
<xsl:template match="records/day">
|
50
|
-
<xsl:apply-templates select="summary"/>
|
51
|
-
<xsl:apply-templates select="records"/>
|
52
|
-
</xsl:template>
|
53
|
-
|
54
|
-
<xsl:template match="day/summary">
|
55
|
-
<td><xsl:value-of select="xday"/></td>
|
56
|
-
</xsl:template>
|
57
|
-
|
58
|
-
</xsl:stylesheet>
|