Permalink
Browse files

api v1 - restapi renamed to apipie

  • Loading branch information...
1 parent 64b920e commit 981a95082583910355873a3c675bb7c748227f21 @mbacovsky mbacovsky committed with ohadlevy Jul 23, 2012
View
@@ -12,7 +12,7 @@ gem 'scoped_search', '>= 2.3.7'
gem 'net-ldap'
gem "safemode", "~> 1.0.1"
gem 'uuidtools'
-gem "restapi", :git => "git://github.com/Katello/rails-restapi.git", :branch => "katello"
+gem "apipie-rails", ">= 0.0.7"
gem 'rabl'
# Previous versions collide with Environment model
gem "ruby_parser", ">= 2.3.1"
View
@@ -2,9 +2,6 @@ require File.expand_path('../config/application', __FILE__)
require 'rake'
include Rake::DSL
-if Rails.env.test?
- require 'single_test'
- SingleTest.load_tasks
-end
+SingleTest.load_tasks if defined? SingleTest
Foreman::Application.load_tasks
View
@@ -3,4 +3,7 @@
gem "ruby-debug", :platforms => :ruby_18
gem "ruby-debug19", :platforms => :ruby_19
gem 'redcarpet'
+ gem 'single_test'
+ gem 'pry'
+ gem "term-ansicolor"
end
@@ -1,4 +1,4 @@
-Restapi.configure do |config|
+Apipie.configure do |config|
config.app_name = "Foreman"
config.app_info = "The Foreman is aimed to be a single address for all machines life cycle management."
config.copyright = ""
@@ -9,11 +9,11 @@
config.use_cache = false #Rails.env.production?
config.validate = false
config.reload_controllers = true
- config.markup = Restapi::Markup::Markdown.new
+ config.markup = Apipie::Markup::Markdown.new
end
# special type of validator: we say that it's not specified
-class UndefValidator < Restapi::Validator::BaseValidator
+class UndefValidator < Apipie::Validator::BaseValidator
def validate(value)
true
@@ -30,19 +30,19 @@ def description
end
end
-class Restapi::Validator::TypeValidator
+class Apipie::Validator::TypeValidator
def description
@type.name
end
end
-class Restapi::Validator::HashValidator
+class Apipie::Validator::HashValidator
def description
"Hash"
end
end
-class NumberValidator < Restapi::Validator::BaseValidator
+class NumberValidator < Apipie::Validator::BaseValidator
def validate(value)
value.to_s =~ /^(0|[1-9]\d*)$/
@@ -63,7 +63,7 @@ def description
end
end
-class IdentifierValidator < Restapi::Validator::BaseValidator
+class IdentifierValidator < Apipie::Validator::BaseValidator
def validate(value)
value = value.to_s
@@ -85,7 +85,7 @@ def description
end
end
-class BooleanValidator < Restapi::Validator::BaseValidator
+class BooleanValidator < Apipie::Validator::BaseValidator
def validate(value)
%w[true false].include?(value.to_s)
@@ -1,4 +1,4 @@
# config/routes/api/restapidoc.rb
Rails.application.routes.draw do |map|
- restapi
+ apipie
end

0 comments on commit 981a950

Please sign in to comment.