polyrex-calendar 0.6.6 → 0.7.0

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
- SHA1:
3
- metadata.gz: 45905224996a8df8a7684903afbba10ccb174c7d
4
- data.tar.gz: cc35291fc79466c9d8a577809814e2239b2e7e1c
2
+ SHA256:
3
+ metadata.gz: eb2795297af9c4bc240d1b67681aca4bc63f093a73dcf363fab4be22ba7dea42
4
+ data.tar.gz: c6c9f62974d4a115d46c9089ea3919bcfaeef6cedb770e0e1f963118de0dbf00
5
5
  SHA512:
6
- metadata.gz: c303c2b5c08e140cbe08a5060c42f601728a481cd5c1cb2726dd6d1b13430ae65ab670034cc5aa6d8745dd7d6e1823c8fc56dc483b8312717ea33174cd29127c
7
- data.tar.gz: 32f3acfe3ee418c702eae5f0510a33450756dd4da1d92b1569daa7b83386c02cf168bddd4e4f51c648509811801ae38b5f57c8e607626158419f2d53f43d2f99
6
+ metadata.gz: 8dcbff3df45ba1c73cf968f3aeb5b135388d66a0162333f26e1e7e9e07d6c24c213d56ebc4a2e6fafdb8602b45cb23c60e870fda5c4788bf0b11332f00d1ffb9
7
+ data.tar.gz: 187e2cb775e4aca8bbb8c85cdbb1a08ae78f5fbac903f397566b8e0a81a225c3c12742b1fd978895c08a3b353ae43afaf68c4aa68000041f81f568d7092bd3b0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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: Date.today.year.to_s)
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
@@ -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>
@@ -0,0 +1,5 @@
1
+ #wrap>header:first-child {
2
+ background-color: #e00;
3
+ display: none;
4
+ }
5
+
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.6.6
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
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE3MDUwODAwMDIxN1oXDTE4MDUwODAwMDIxN1owSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRz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76CvrGf9QjhpCs
29
+ JOyurhhZIeKezdsHn8I/c8xvjuLi3tgo7IdjNNVQcGpK6/Z6v+dSkrHmUAvHGrBX
30
+ nr75LO8gGT2QSWXm0nJgnS1q+LmNFhxwYpDq4er7pcvpYMWyy2TTnHGqZFimHHp2
31
+ r+wiGqd2iaL4izTzPm1fQn+L1W7HGNu11fpCshwPdN9UBOd3yzDT4cHWmw1TlVe9
32
+ jJZ3H58y+l97O0nKh9HsrCQ6SR8c8Y5AIOHTV4fowUBXVXADVJYbhjEVG6GbBZ2G
33
+ nQaP6XmSypKxWL572LGiEe7g0B+1rkQ/54PkLrfJQLX5u674Qv33a8yINelJKoeg
34
+ ZxAGsXAa6KQuWfwo+0VaLpChIblhcnzttQ/5vdOy2BRr2kWNdbVJOeXILrsdUN6E
35
+ KtdAYRIhRwOoB4Ijy2zM4+si3LD99g10IDoZR2RqBigJ84+EQoi4twLZ/40poJiT
36
+ A9o6KflBpVon/BqwfEjCi7Ie
33
37
  -----END CERTIFICATE-----
34
- date: 2017-05-08 00:00:00.000000000 Z
38
+ date: 2018-12-28 00:00:00.000000000 Z
35
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.2'
46
+ version: '0.3'
43
47
  - - ">="
44
48
  - !ruby/object:Gem::Version
45
- version: 0.2.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.2'
56
+ version: '0.3'
53
57
  - - ">="
54
58
  - !ruby/object:Gem::Version
55
- version: 0.2.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.8
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
- un����H��Ʊ���Y�3�!#���W�r��Z]+��>�N'�ߏ�M_+�\n&����.�� �+wޕ�Nc C�ɒ=PP2�2��&�^\��鶁�<�� >�a4����Cfa�U���Q���y)%ゅĖ�B�2vdE^�g�RA9c�6FV�፳�i6�.l�����S3�_Zjz����c}����� 6*n�Kۻ��m�[�v̀�����A^<a�o���. ������_Ė���݇��Aѳq�(ږT�NW�5ά
1
+ ��՝�����h�w�c�2�zo�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$�6 HN�XV�������C>C��G��+锉������+B�ۻA²�F�I����g��r�.����,� v�BC�/��k�<��CJ�w%/�n���������&������ �\N4��@��+�
@@ -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>