lib/gist_updater/updater.rb in gist_updater-0.2.0 vs lib/gist_updater/updater.rb in gist_updater-0.3.0
- old
+ new
@@ -10,25 +10,27 @@
end
def update
count = 0
- config.each do |gist_id, file_path|
- count += 1 if update_1(gist_id, file_path)
+ config.each do |gist_id:, file_paths:|
+ file_paths.each do |file_path|
+ count += 1 if update_by_gist(gist_id, file_path)
+ end
end
count
end
private
attr_reader :user, :access_token, :config
- def update_1(gist_id, file_path)
+ def update_by_gist(id, file_path)
Content.new(
user: user,
access_token: access_token,
- gist_id: gist_id,
+ gist_id: id,
file_path: file_path
).update_if_need
end
end
end