Skip to content

Commit

Permalink
WIP for issue #73
Browse files Browse the repository at this point in the history
  • Loading branch information
LightGuard committed Nov 8, 2013
1 parent 48be074 commit 0f2f61a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helpers/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def clone_repo
git.add_remote('upstream', fork_response.parent.clone_url)

@logger.debug 'pulling from git'
Open3.popen3("git pull upstream master") do |_, _, stderr, wait_thr|
Open3.popen3('git pull upstream master') do |_, _, stderr, wait_thr|
exit_value = wait_thr.value
@logger.debug "pull exit status: #{exit_value}"
error = stderr.readlines.join "\n"
Expand Down
7 changes: 3 additions & 4 deletions public_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'date'
require 'digest/sha2'
require 'securerandom'
require 'uri'

# External
require 'bundler'
Expand Down Expand Up @@ -109,15 +108,15 @@ class PublicApp < Sinatra::Base
end

post '/settings' do
settings = read_settings().merge({ 'repo' => params['repo'] })
settings = read_settings().merge({ 'repo' => params['repo'].sub(%r{^((([email protected]:)|(https(s)?://github.com/)?))},'').sub(/\.git$/,'') })
write_settings settings
end

put '/settings' do
settings = read_settings().merge({ 'repo' => params['repo'] })
settings = read_settings().merge({ 'repo' => params['repo'].sub(%r{^((([email protected]:)|(https(s)?://github.com/)?))},'').sub(/\.git$/,'') })
logger.debug "Settings: #{settings}"
get_github_token settings
repo = AwestructWebEditor::Repository.new(:name => URI(settings['repo']).path.split('/').last,
repo = AwestructWebEditor::Repository.new(:name => settings['repo'].split('/').last,
:token => session[:github_auth], :username => session['username'])
repo.init_empty
repo.add_creds
Expand Down

0 comments on commit 0f2f61a

Please sign in to comment.