Skip to content

Commit

Permalink
Merge pull request #1050 from ar31an/patch-1
Browse files Browse the repository at this point in the history
Fix Errno::ENOENT error for views generator
  • Loading branch information
yuki24 committed Feb 14, 2021
2 parents 7faed8e + 4f9111f commit 00657f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kaminari-core/lib/generators/kaminari/views_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ module GitHubApiHelper
require 'open-uri'

def get_files_in_master
master_tree_sha = open('https://api.github.com/repos/amatsuda/kaminari_themes/git/refs/heads/master') do |json|
master_tree_sha = URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/git/refs/heads/master') do |json|
ActiveSupport::JSON.decode(json.read)['object']['sha']
end
open('https://api.github.com/repos/amatsuda/kaminari_themes/git/trees/' + master_tree_sha + '?recursive=1') do |json|
URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/git/trees/' + master_tree_sha + '?recursive=1') do |json|
blobs = ActiveSupport::JSON.decode(json.read)['tree'].find_all {|i| i['type'] == 'blob' }
blobs.map do |blob|
[blob['path'], blob['sha']]
Expand All @@ -127,7 +127,7 @@ def get_files_in_master
module_function :get_files_in_master

def get_content_for(path)
open('https://api.github.com/repos/amatsuda/kaminari_themes/contents/' + path) do |json|
URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/contents/' + path) do |json|
Base64.decode64(ActiveSupport::JSON.decode(json.read)['content'])
end
end
Expand Down

0 comments on commit 00657f2

Please sign in to comment.