mill 0.4 → 0.5

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
  SHA256:
3
- metadata.gz: 8e3aed9168873926d70b2093052d7d1fa4960ad86a159b0817ce83e9ef601dbc
4
- data.tar.gz: 67b59a9d3676201b8baceb60b718d434abb814ce33faaf25f70d8fcff60aadbd
3
+ metadata.gz: 775c10cb0e9c41d28f6b6728e03c56b6d314812a1ee1ab3e2c389015e525aef8
4
+ data.tar.gz: 1eda35d28e711440f79a6955a30790d69e22bc96d6d41562468158d51ec835aa
5
5
  SHA512:
6
- metadata.gz: 9a982f59f012188d651b430f320e57f694f1a5f5d1d7060e4d26bbcef625be5a4a2e3861d6fca2b4fcdffe9f97ac47ca68662c8ca27b54372b3ed825a5143533
7
- data.tar.gz: faffc48eb919a68fa0edd1d6bc74a6722528f15dea096de4a6c9f8eca25caf8a764b67c3e807b6f17edf637c82e02af337825fba430dc00ac0cf38b09ab1c2da
6
+ metadata.gz: a5def5c72916e9ceaf02fe6bfbc25bf76a76a9a8c5c5e27d538c4fc32cff64da85e362d8faa296c1072e120f9dcc6322779dd24346c08128d2b9d4824c7a8154
7
+ data.tar.gz: 4d802cab973d38096510f3d7c0e0a4d8e59503f3a7c0a8805e710f8ebd2a70777cdc6267821219dfaa1f0925d9a8513c68a47ec55ecaf93f3e085e5014ae3a0e
@@ -60,40 +60,6 @@ module HTMLHelpers
60
60
  end
61
61
  end
62
62
 
63
- def amazon_button(asin)
64
- html_fragment do |html|
65
- html.a(href: "http://www.amazon.com/dp/#{asin}") do
66
- html.img(src: '/images/buy1._V46787834_.gif', alt: 'Buy from Amazon.com')
67
- end
68
- end
69
- end
70
-
71
- def paypal_button(id)
72
- html_fragment do |html|
73
- html.form(action: 'https://www.paypal.com/cgi-bin/webscr', method: 'post') do
74
- html.input(
75
- type: 'hidden',
76
- name: 'cmd',
77
- value: '_s-xclick')
78
- html.input(
79
- type: 'hidden',
80
- name: 'hosted_button_id',
81
- value: id)
82
- html.input(
83
- type: 'image',
84
- src: 'https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif',
85
- name: 'submit',
86
- alt: 'PayPal - The safer, easier way to pay online!')
87
- html.img(
88
- alt: '',
89
- border: 0,
90
- width: 1,
91
- height: 1,
92
- src: 'https://www.paypalobjects.com/en_US/i/scr/pixel.gif')
93
- end
94
- end
95
- end
96
-
97
63
  def google_analytics(tracker_id)
98
64
  html_fragment do |html|
99
65
  html.script(type: 'text/javascript') do
@@ -14,13 +14,14 @@ module Mill
14
14
 
15
15
  end
16
16
 
17
- def initialize(items: [])
17
+ def initialize(items: [], site: nil)
18
18
  @items = Hash[
19
19
  items.map do |uri, title|
20
20
  item = Item.new(uri: uri, title: title)
21
21
  [item.uri, item]
22
22
  end
23
23
  ]
24
+ @site = site
24
25
  end
25
26
 
26
27
  def items
@@ -13,7 +13,6 @@ module Mill
13
13
  builder = Nokogiri::XML::Builder.new do |xml|
14
14
  xml.feed(xmlns: 'http://www.w3.org/2005/Atom') do
15
15
  xml.id(@site.tag_uri)
16
- # xml.generator(*@site.feed_generator)
17
16
  xml.title(@site.site_title) if @site.site_title
18
17
  xml.link(rel: 'alternate', type: 'text/html', href: @site.home_resource.uri) if @site.home_resource
19
18
  xml.link(rel: 'self', type: 'application/atom+xml', href: uri)
@@ -12,6 +12,12 @@ module Mill
12
12
  super(**args)
13
13
  end
14
14
 
15
+ def inspect
16
+ super + ", key: %p" % [
17
+ @key,
18
+ ]
19
+ end
20
+
15
21
  def load
16
22
  @content = "google-site-verification: #{@key}.html\n"
17
23
  super
@@ -20,6 +20,13 @@ module Mill
20
20
  attr_accessor :width
21
21
  attr_accessor :height
22
22
 
23
+ def inspect
24
+ super + ", width: %p, height: %p" % [
25
+ @width,
26
+ @height,
27
+ ]
28
+ end
29
+
23
30
  def load
24
31
  info = ImageSize.path(@input_file.to_s)
25
32
  @width, @height = *info.size
@@ -13,6 +13,13 @@ module Mill
13
13
  super(**args)
14
14
  end
15
15
 
16
+ def inspect
17
+ super + ", redirect_uri: %p, redirect_code: %p" % [
18
+ @redirect_uri.to_s,
19
+ @redirect_code,
20
+ ]
21
+ end
22
+
16
23
  def load
17
24
  @content = "%s %d" % [@redirect_uri, @redirect_code]
18
25
  super
@@ -60,18 +60,6 @@ module Mill
60
60
  end
61
61
  end
62
62
 
63
- def build
64
- replace_elements
65
- super
66
- end
67
-
68
- def replace_elements
69
- replace_pages_element
70
- remove_comments
71
- add_image_sizes
72
- # shorten_links
73
- end
74
-
75
63
  def parse_html_header
76
64
  unless @title
77
65
  if (title_elem = @content.at_xpath('/html/head/title'))
@@ -184,25 +172,6 @@ module Mill
184
172
  end
185
173
  end
186
174
 
187
- def replace_pages_element
188
- replace_element(@content, '//pages') do |elem|
189
- html_fragment do |html|
190
- html.dl do
191
- find_sibling_resources(Resource::Text).each do |page|
192
- html.dt do
193
- html.a(href: page.uri) { html << page.title.to_html }
194
- end
195
- html.dd do
196
- if (summary = page.summary)
197
- html << summary.to_html
198
- end
199
- end
200
- end
201
- end
202
- end
203
- end
204
- end
205
-
206
175
  def summary
207
176
  @summary || ((p = feed_content.at_xpath('//p')) && p.children)
208
177
  end
data/lib/mill/site.rb CHANGED
@@ -120,16 +120,6 @@ module Mill
120
120
  ]
121
121
  end
122
122
 
123
- def feed_generator
124
- [
125
- 'Mill',
126
- {
127
- uri: Addressable::URI.parse('http://github.com/jslabovitz/mill'),
128
- version: Mill::VERSION,
129
- }
130
- ]
131
- end
132
-
133
123
  def feed_author_name
134
124
  @site_title
135
125
  end
data/lib/mill/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Mill
2
2
 
3
- VERSION = '0.4'
3
+ VERSION = '0.5'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mill
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Labovitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2017-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable