Skip to content

Commit

Permalink
Fix apipie static generation on RPM build time
Browse files Browse the repository at this point in the history
  • Loading branch information
iNecas committed Aug 6, 2013
1 parent 7d804d2 commit 238fcce
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 264 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ locale/*/LC_MESSAGES
locale/.cache/*
.yardoc
yardoc
apidoc
doc/apidoc*
doc/headpin-apidoc*
public/apipie-cache*
public/headpin-apipie-cache*
project.vim
routes.html
routes.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def index
param_group :content_view_definition
param :content_view_definition, Hash do
param :label, String, :desc => "Content view identifier"
param :composite, :boolean, :desc => "True for composite definition"
param :composite, :bool, :desc => "True for composite definition"
end
def create
attrs = params[:content_view_definition]
Expand Down
226 changes: 0 additions & 226 deletions app/controllers/api/v1/content_view_definitions_controller.rb.orig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def destroy

api :POST, '/organizations/:organization_id/default_info/:informable_type/apply', "Apply existing default info on all informable resources"
param_group :informable_identifier
param :async, :boolean, :required => false, :desc => "directive to run this asynchronously or not"
param :async, :bool, :required => false, :desc => "directive to run this asynchronously or not"
def apply_to_all
params[:async] = true if params[:async].nil?

Expand Down
4 changes: 4 additions & 0 deletions app/controllers/api/v2/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ class Api::V2::ApiController < Api::ApiController
include Util::ThreadSession::Controller
include AuthorizationRules

resource_description do
api_version 'v2'
end

end
2 changes: 1 addition & 1 deletion app/controllers/api/v2/repositories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def param_rules
api :POST, "/products/:product_id/repositories", "Create a repository"
param :product_id, :number, :required => true, :desc => "id of a product the repository will be contained in"
param_group :repo
see "v2#gpg_keys#index"
see "v1#gpg_keys#index"
def create
raise HttpErrors::BadRequest, _("Repository can be only created for custom provider.") unless @product.custom?

Expand Down
1 change: 1 addition & 0 deletions bundler.d/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
group :build do
# for apipie (it is in default group)
gem 'maruku'
gem 'sqlite3'
end

group :ci do
Expand Down
9 changes: 1 addition & 8 deletions config/environments/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@

# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
config.cache_classes = false

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
end

class ActiveRecord::Base
def self.establish_connection(*args)
# do nothing - we don't need to have database installed to run
# this environments.
end
end
11 changes: 11 additions & 0 deletions config/initializers/apipie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
config.doc_base_url = "/apidoc"
config.use_cache = Rails.env.production?
config.validate = false
config.default_version = 'v1'

unless config.use_cache?
require 'maruku'
Expand All @@ -32,6 +33,16 @@ def self.to_html(text)
Api::V1::TasksController
Api::V1::TemplatesController
Api::V1::TemplatesContentController
Api::V2::ChangesetsController
Api::V2::ChangesetsContentController
Api::V2::ErrataController
Api::V2::DistributionsController
Api::V2::GpgKeysController
Api::V2::RepositoriesController
Api::V2::PackagesController
Api::V2::TasksController
Api::V2::TemplatesController
Api::V2::TemplatesContentController
]

config.cache_dir = File.join(Rails.root, "public/headpin-apipie-cache")
Expand Down
7 changes: 7 additions & 0 deletions config/katello_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,10 @@ test:
# The following configuration values override ones from the common section
#
build:
use_pulp: false
use_candlepin: false
database:
adapter: sqlite3
database: db/build.sqlite3
pool: 5
timeout: 5000
Loading

0 comments on commit 238fcce

Please sign in to comment.