screenshots 0.0.3 → 0.0.4
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 +4 -4
- data/bin/screenshots +6 -2
- data/lib/screenshots/page.rb +4 -2
- data/lib/screenshots/version.rb +1 -1
- data/spec/test_data.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c32891d0e1947f10107b23ce66ec01314dfeff7e
|
4
|
+
data.tar.gz: 85b05e4cf67e84910e5ecacb4fe64a30e5b1900d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2183256919c92b08c96ec62db4dd4bd49db04b78ac0e4e0fa39c6d6b1d60cb7284dc380f979ceb55ba909a65ee82f2da1aa3950bc3a0de9b6ef6c85b73bfb371
|
7
|
+
data.tar.gz: f2e13de8f4bc8cf7243bbf5f7926577940096d9ae05d7327db9228e634204b6357ec79f999cb6e8510e4b7a84e8530d7f1ae899da627c96d7a0747ab536713fd
|
data/bin/screenshots
CHANGED
@@ -31,11 +31,15 @@ if urls.empty?
|
|
31
31
|
exit -1
|
32
32
|
end
|
33
33
|
|
34
|
-
#
|
34
|
+
# Config
|
35
|
+
current_month = Time.now.strftime("%m")
|
36
|
+
current_year = Time.now.year
|
35
37
|
Screenshots.configure do |config|
|
36
|
-
config.blog_assets_url =
|
38
|
+
config.blog_assets_url = "http://www.codeur.com/blog/wp-content/uploads/#{current_year}/#{current_month}"
|
37
39
|
config.image_extension = 'jpeg'
|
38
40
|
end
|
41
|
+
|
42
|
+
# Generate the HTML
|
39
43
|
html = Screenshots::Processor.generate_list(urls)
|
40
44
|
|
41
45
|
# Print output on disk
|
data/lib/screenshots/page.rb
CHANGED
@@ -17,8 +17,10 @@ module Screenshots
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def generate_blog_section
|
20
|
-
section = "<h2><a href=\"#{@url}\">#{@title}</a></h2>\n"
|
21
|
-
section += "<
|
20
|
+
section = "<h2><a href=\"#{@url}\" title=\"#{@title}\">#{@title}</a></h2>\n"
|
21
|
+
section += "<a href=\"#{@url}\">"
|
22
|
+
section += "<img src=\"#{screenshot_url}\" alt=\"#{@title}\" title=\"#{@title}\" />"
|
23
|
+
section += "</a>\n"
|
22
24
|
end
|
23
25
|
|
24
26
|
def screenshot_url
|
data/lib/screenshots/version.rb
CHANGED
data/spec/test_data.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module TestData
|
2
2
|
|
3
3
|
def github_html_section
|
4
|
-
%Q(<h2><a href="https://github.com/rails/rails?param=1&x=2">rails/rails · GitHub</a></h2>
|
5
|
-
<img src="http://blog/https_github.com_rails_rails_param_1_x_2.jpg"
|
4
|
+
%Q(<h2><a href="https://github.com/rails/rails?param=1&x=2" title="rails/rails · GitHub">rails/rails · GitHub</a></h2>
|
5
|
+
<a href="https://github.com/rails/rails?param=1&x=2"><img src="http://blog/https_github.com_rails_rails_param_1_x_2.jpg" alt="rails/rails · GitHub" title="rails/rails · GitHub" /></a>
|
6
6
|
)
|
7
7
|
end
|
8
8
|
|
9
9
|
def google_html_section
|
10
|
-
%Q(<h2><a href="http://www.google.com">Google</a></h2>
|
11
|
-
<img src="http://blog/http_www.google.com.jpg"
|
10
|
+
%Q(<h2><a href="http://www.google.com" title="Google">Google</a></h2>
|
11
|
+
<a href="http://www.google.com"><img src="http://blog/http_www.google.com.jpg" alt="Google" title="Google" /></a>
|
12
12
|
)
|
13
13
|
end
|
14
14
|
end
|