-
-
Save anonymous/2e59f773f9c335d146ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_repos | |
parsed_response = JSON.parse(open("https://api.github.com/users/xxxxxx/repos").read) | |
parsed_response.select! { |hash| hash["fork"] == false } | |
parsed_response.map do |hash| | |
hash.select! do |key, value| | |
["name", "url", "description"].include? key | |
end | |
end | |
@results = parsed_response | |
@options = @results.collect {|p| [ p['name'] ] } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@response = project_params | |
repo_hash = @results.select { |a| a["name"] == @response["name"] } | |
test = repo_hash[0] | |
@project = Project.new(test) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment