use registered services
This commit is contained in:
parent
79022c7a9c
commit
353b5fa502
30
Gemfile.lock
30
Gemfile.lock
|
@ -6,10 +6,10 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/getsentry/raven-ruby.git
|
||||
revision: 97bbe7211308d1eb1502df4545592c11e56908ae
|
||||
revision: 3cd6f4746e7f111d1e835c7f4c8142aee9d7df03
|
||||
specs:
|
||||
sentry-raven (0.3.1)
|
||||
faraday (~> 0.8.0.rc2)
|
||||
faraday (>= 0.7.6)
|
||||
hashie
|
||||
multi_json (~> 1.0)
|
||||
uuidtools
|
||||
|
@ -63,7 +63,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/travis-ci/travis-sidekiqs.git
|
||||
revision: 33cf6b1ed576231c1cc5368f734171b4edd4768b
|
||||
revision: 4959bd0c3454b98cbf18a5f506f8f33a9a63689d
|
||||
specs:
|
||||
travis-sidekiqs (0.0.1)
|
||||
sentry-raven
|
||||
|
@ -71,7 +71,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/travis-ci/travis-support.git
|
||||
revision: ce25da5b53d2dbb67798084a87e91b84f5626061
|
||||
revision: f78d9161369f574f12b9c0c0dbfe13b997766bdd
|
||||
specs:
|
||||
travis-support (0.0.1)
|
||||
|
||||
|
@ -132,7 +132,7 @@ GEM
|
|||
coderay (1.0.8)
|
||||
connection_pool (0.9.2)
|
||||
daemons (1.1.9)
|
||||
dalli (2.3.0)
|
||||
dalli (2.5.0)
|
||||
data_migrations (0.0.1)
|
||||
activerecord
|
||||
rake
|
||||
|
@ -169,7 +169,7 @@ GEM
|
|||
avl_tree (~> 1.1.2)
|
||||
hitimes (~> 1.1)
|
||||
mime-types (1.19)
|
||||
mocha (0.12.7)
|
||||
mocha (0.13.0)
|
||||
metaclass (~> 0.0.1)
|
||||
multi_json (1.3.7)
|
||||
multipart-post (1.1.5)
|
||||
|
@ -219,21 +219,21 @@ GEM
|
|||
rerun (0.7.1)
|
||||
listen
|
||||
rollout (1.1.0)
|
||||
rspec (2.11.0)
|
||||
rspec-core (~> 2.11.0)
|
||||
rspec-expectations (~> 2.11.0)
|
||||
rspec-mocks (~> 2.11.0)
|
||||
rspec-core (2.11.1)
|
||||
rspec-expectations (2.11.3)
|
||||
rspec (2.12.0)
|
||||
rspec-core (~> 2.12.0)
|
||||
rspec-expectations (~> 2.12.0)
|
||||
rspec-mocks (~> 2.12.0)
|
||||
rspec-core (2.12.0)
|
||||
rspec-expectations (2.12.0)
|
||||
diff-lcs (~> 1.1.3)
|
||||
rspec-mocks (2.11.3)
|
||||
sidekiq (2.5.2)
|
||||
rspec-mocks (2.12.0)
|
||||
sidekiq (2.5.3)
|
||||
celluloid (~> 0.12.0)
|
||||
connection_pool (~> 0.9.2)
|
||||
multi_json (~> 1)
|
||||
redis (~> 3)
|
||||
redis-namespace
|
||||
signature (0.1.6)
|
||||
signature (0.1.4)
|
||||
simple_states (0.1.1)
|
||||
activesupport
|
||||
hashr (~> 0.0.10)
|
||||
|
|
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Accounts < Endpoint
|
||||
get '/', scope: :private do
|
||||
respond_with service(:users, :find_accounts, params), type: :accounts
|
||||
respond_with service(:find_user_accounts, params), type: :accounts
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ class Travis::Api::App
|
|||
class Artifacts < Endpoint
|
||||
# Fetches an artifact by it's *id*.
|
||||
get '/:id' do |id|
|
||||
respond_with service(:artifacts, :find_one, params)
|
||||
respond_with service(:find_artifact, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Branches < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:branches, :find_all, params), type: :branches
|
||||
respond_with service(:find_branches, params), type: :branches
|
||||
end
|
||||
|
||||
# get '/:owner_name/:name/branches' do # v1
|
||||
|
|
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Broadcasts < Endpoint
|
||||
get '/', scope: :private do
|
||||
respond_with service(:users, :find_broadcasts, params), type: :broadcasts
|
||||
respond_with service(:find_user_broadcasts, params), type: :broadcasts
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Builds < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:builds, :find_all, params)
|
||||
respond_with service(:find_builds, params)
|
||||
end
|
||||
|
||||
get '/:id' do
|
||||
respond_with service(:builds, :find_one, params)
|
||||
respond_with service(:find_build, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Events < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:events, :find_all, params), type: :events
|
||||
respond_with service(:find_events, params), type: :events
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Hooks < Endpoint
|
||||
get '/', scope: :private do
|
||||
respond_with service(:hooks, :find_all, params), type: :hooks
|
||||
respond_with service(:find_hooks, params), type: :hooks
|
||||
end
|
||||
|
||||
put '/:id?', scope: :private do
|
||||
respond_with service(:hooks, :update, id: params[:id] || params[:hook][:id], active: params[:hook][:active])
|
||||
respond_with service(:update_hook, id: params[:id] || params[:hook][:id], active: params[:hook][:active])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Jobs < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:jobs, :find_all, params)
|
||||
respond_with service(:find_jobs, params)
|
||||
end
|
||||
|
||||
get '/:id' do
|
||||
respond_with service(:jobs, :find_one, params)
|
||||
respond_with service(:find_job, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,31 +9,31 @@ class Travis::Api::App
|
|||
# owned by johndoe by adding `owner_name=johndoe`, or all repositories that johndoe has access to by adding
|
||||
# `member=johndoe`. The parameter names correspond to the keys of the response hash.
|
||||
get '/' do
|
||||
respond_with service(:repositories, :find_all, params)
|
||||
respond_with service(:find_repos, params)
|
||||
end
|
||||
|
||||
get '/:id' do
|
||||
respond_with service(:repositories, :find_one, params)
|
||||
respond_with service(:find_repo, params)
|
||||
end
|
||||
|
||||
get '/:id/cc' do
|
||||
respond_with service(:repositories, :find_one, params.merge(schema: 'cc'))
|
||||
respond_with service(:find_repo, params.merge(schema: 'cc'))
|
||||
end
|
||||
|
||||
get '/:owner_name/:name' do
|
||||
respond_with service(:repositories, :find_one, params)
|
||||
respond_with service(:find_repo, params)
|
||||
end
|
||||
|
||||
get '/:owner_name/:name/builds' do
|
||||
respond_with service(:builds, :find_all, params)
|
||||
respond_with service(:find_builds, params)
|
||||
end
|
||||
|
||||
get '/:owner_name/:name/builds/:id' do
|
||||
respond_with service(:builds, :find_one, params)
|
||||
respond_with service(:find_build, params)
|
||||
end
|
||||
|
||||
get '/:owner_name/:name/cc' do
|
||||
respond_with service(:repositories, :find_one, params.merge(schema: 'cc'))
|
||||
respond_with service(:find_repo, params.merge(schema: 'cc'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Requests < Endpoint
|
||||
post '/' do
|
||||
respond_with service(:requests, :requeue, params)
|
||||
respond_with service(:requeue_request, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Stats < Endpoint
|
||||
get '/repos' do
|
||||
{ :stats => service(:stats, :daily_repos) }
|
||||
{ :stats => service(:find_daily_repos_stats) }
|
||||
end
|
||||
|
||||
get '/tests' do
|
||||
{ :stats => service(:stats, :daily_tests) }
|
||||
{ :stats => service(:find_daily_tests_stats) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ class Travis::Api::App
|
|||
end
|
||||
|
||||
get '/permissions', scope: :private do
|
||||
respond_with service(:users, :find_permissions), type: :permissions
|
||||
respond_with service(:find_user_permissions), type: :permissions
|
||||
end
|
||||
|
||||
# TODO fix url/key generation in ember-data
|
||||
|
@ -38,11 +38,11 @@ class Travis::Api::App
|
|||
# end
|
||||
|
||||
put '/:id?', scope: :private do
|
||||
respond_with service(:users, :update, params[:user])
|
||||
respond_with service(:update_user, params[:user])
|
||||
end
|
||||
|
||||
post '/sync', scope: :private do
|
||||
respond_with service(:users, :sync)
|
||||
respond_with service(:sync_user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Travis::Api::App
|
|||
class Endpoint
|
||||
class Workers < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:workers, :find_all, params)
|
||||
respond_with service(:find_workers, params)
|
||||
end
|
||||
|
||||
get '/:id' do
|
||||
respond_with service(:workers, :find_one, params)
|
||||
respond_with service(:find_worker, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ describe 'Hooks' do
|
|||
let :payload do
|
||||
{
|
||||
:name => 'travis',
|
||||
:events => Travis::Services::Github::SetHook::EVENTS,
|
||||
:events => Travis::Github::Services::SetHook::EVENTS,
|
||||
:active => true,
|
||||
:config => { :user => user.login, :token => user.tokens.first.token, :domain => 'listener.travis-ci.org' }
|
||||
}
|
||||
|
|
5
spec/unit/endpoint/repos_spec.rb
Normal file
5
spec/unit/endpoint/repos_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Travis::Api::App::Endpoint::Repos do
|
||||
it 'has to be tested'
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Travis::Api::App::Endpoint::Repositories do
|
||||
it 'has to be tested'
|
||||
end
|
Loading…
Reference in New Issue
Block a user