gist_updater 0.3.1 → 0.4.2
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/README.md +1 -1
- data/lib/gist_updater/content.rb +7 -3
- data/lib/gist_updater/updater.rb +4 -4
- data/lib/gist_updater/version.rb +1 -1
- 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: b3ed527300512428190170b5851a2ed073d94c19
|
4
|
+
data.tar.gz: 0fd1c1ce362b672e45a9127d0af132e1980e4425
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349c22ceb6c53151eef3a787f80af72b9e5486eb659cba479159f0657c06549ed255f98873d63dfad747e3cbc5d2e21652c9c902363f4834744ebc2a4fb17532
|
7
|
+
data.tar.gz: 0cecc509af86e5ae6b6db1f7c00bb8feb4682f22d5cb9bdc2c6607ea897e1b58407f728131370facb0eabeda5a7e209f300d8ed1bd54a1a3904df246e107c470
|
data/README.md
CHANGED
data/lib/gist_updater/content.rb
CHANGED
@@ -22,13 +22,13 @@ module GistUpdater
|
|
22
22
|
# @return [NilClass] isnot updated
|
23
23
|
def update_if_need
|
24
24
|
if need_to_update?
|
25
|
-
|
26
|
-
puts "Updated `#{file_path}` to #{
|
25
|
+
resource = update
|
26
|
+
puts "Updated `#{file_path}` to #{resource.html_url}"
|
27
27
|
elsif GistUpdater.debug
|
28
28
|
puts "There is no update for `#{file_path}`."
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
pick_a_file(resource)
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
@@ -51,6 +51,10 @@ module GistUpdater
|
|
51
51
|
@local ||= File.read(file_path)
|
52
52
|
end
|
53
53
|
|
54
|
+
def pick_a_file(resource)
|
55
|
+
resource.files[file_name] if resource
|
56
|
+
end
|
57
|
+
|
54
58
|
# Update a Gist file
|
55
59
|
#
|
56
60
|
# @return [Sawyer::Resource]
|
data/lib/gist_updater/updater.rb
CHANGED
@@ -14,17 +14,17 @@ module GistUpdater
|
|
14
14
|
|
15
15
|
# Update your Gist
|
16
16
|
#
|
17
|
-
# @return [
|
17
|
+
# @return [Array<Sawyer::Resource>] Updated resource(s)
|
18
18
|
def update
|
19
|
-
|
19
|
+
updated = []
|
20
20
|
|
21
21
|
config.each do |gist_id:, file_paths:|
|
22
22
|
file_paths.each do |file_path|
|
23
|
-
|
23
|
+
updated << update_by_gist(gist_id, file_path)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
updated.compact
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
data/lib/gist_updater/version.rb
CHANGED