apipie-rails 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +5 -3
- data/README.rst +688 -0
- data/apipie-rails.gemspec +2 -4
- data/app/controllers/apipie/apipies_controller.rb +73 -41
- data/app/views/apipie/apipies/index.html.erb +10 -3
- data/app/views/apipie/apipies/method.html.erb +5 -2
- data/app/views/apipie/apipies/resource.html.erb +10 -3
- data/lib/apipie-rails.rb +1 -0
- data/lib/apipie/apipie_module.rb +28 -79
- data/lib/apipie/application.rb +194 -97
- data/lib/apipie/client/generator.rb +5 -4
- data/lib/apipie/configuration.rb +112 -0
- data/lib/apipie/dsl_definition.rb +93 -16
- data/lib/apipie/extractor.rb +12 -5
- data/lib/apipie/extractor/collector.rb +1 -1
- data/lib/apipie/extractor/recorder.rb +2 -1
- data/lib/apipie/extractor/writer.rb +11 -4
- data/lib/apipie/helpers.rb +15 -4
- data/lib/apipie/markup.rb +3 -4
- data/lib/apipie/method_description.rb +28 -22
- data/lib/apipie/resource_description.rb +44 -42
- data/lib/apipie/routing.rb +3 -1
- data/lib/apipie/static_dispatcher.rb +0 -1
- data/lib/apipie/version.rb +1 -1
- data/lib/generators/apipie/install/README +6 -0
- data/lib/generators/apipie/install/install_generator.rb +25 -0
- data/lib/generators/apipie/install/templates/initializer.rb.erb +7 -0
- data/lib/tasks/apipie.rake +31 -39
- data/spec/controllers/api/v1/architectures_controller_spec.rb +30 -0
- data/spec/controllers/api/v2/architectures_controller_spec.rb +12 -0
- data/spec/controllers/apipies_controller_spec.rb +18 -12
- data/spec/controllers/users_controller_spec.rb +56 -19
- data/spec/dummy/app/controllers/api/base_controller.rb +4 -0
- data/spec/dummy/app/controllers/api/v1/architectures_controller.rb +32 -0
- data/spec/dummy/app/controllers/api/v1/base_controller.rb +11 -0
- data/spec/dummy/app/controllers/api/v2/architectures_controller.rb +32 -0
- data/spec/dummy/app/controllers/api/v2/base_controller.rb +11 -0
- data/spec/dummy/app/controllers/twitter_example_controller.rb +1 -1
- data/spec/dummy/app/controllers/users_controller.rb +2 -3
- data/spec/dummy/config/initializers/apipie.rb +29 -6
- data/spec/lib/method_description_spec.rb +29 -0
- data/spec/lib/param_description_spec.rb +41 -0
- data/spec/lib/resource_description_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -1
- metadata +99 -164
- data/README.rdoc +0 -367
- data/lib/apipie/client/base.rb +0 -133
- data/lib/apipie/client/cli_command.rb +0 -130
- data/lib/apipie/client/main.rb +0 -101
- data/lib/apipie/client/rest_client_oauth.rb +0 -19
- data/lib/apipie/client/template/Gemfile.tt +0 -3
- data/lib/apipie/client/template/README.tt +0 -3
- data/lib/apipie/client/template/Rakefile.tt +0 -2
- data/lib/apipie/client/template/a_name.gemspec.tt +0 -23
- data/lib/apipie/client/template/bin/bin.rb.tt +0 -30
- data/lib/apipie/client/template/lib/a_name.rb.tt +0 -27
- data/lib/apipie/client/template/lib/a_name/commands/cli.rb.tt +0 -22
- data/lib/apipie/client/template/lib/a_name/config.yml +0 -6
- data/lib/apipie/client/template/lib/a_name/resources/resource.rb.tt +0 -22
- data/lib/apipie/client/template/lib/a_name/version.rb.tt +0 -3
- data/lib/apipie/client/thor.rb +0 -21
- data/rubygem-apipie-rails.spec +0 -122
- data/spec/lib/parameter_description_spec.rb +0 -41
@@ -1,130 +0,0 @@
|
|
1
|
-
module Apipie
|
2
|
-
module Client
|
3
|
-
class CliCommand < Thor
|
4
|
-
no_tasks do
|
5
|
-
def client
|
6
|
-
resource_class = apipie_options[:client_module]::Resources.const_get(self.class.name[/[^:]*$/])
|
7
|
-
@client ||= resource_class.new(apipie_options[:config])
|
8
|
-
end
|
9
|
-
|
10
|
-
def transform_options(inline_params, transform_hash = { })
|
11
|
-
# we use not mentioned params without change
|
12
|
-
transformed_options = (options.keys - transform_hash.values.flatten - inline_params).reduce({ }) { |h, k| h.update(k => options[k]) }
|
13
|
-
|
14
|
-
inline_params.each { |p| transformed_options[p] = options[p] }
|
15
|
-
|
16
|
-
transform_hash.each do |sub_key, params|
|
17
|
-
transformed_options[sub_key] = { }
|
18
|
-
params.each { |p| transformed_options[sub_key][p] = options[p] if options.has_key?(p) }
|
19
|
-
end
|
20
|
-
|
21
|
-
return transformed_options
|
22
|
-
end
|
23
|
-
|
24
|
-
def print_data(data)
|
25
|
-
case data
|
26
|
-
when Array
|
27
|
-
print_big_table(table_from_array(data))
|
28
|
-
when Hash
|
29
|
-
print_table(table_from_hash(data))
|
30
|
-
else
|
31
|
-
print_unknown(data)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unifies the data for further processing. e.g.
|
36
|
-
#
|
37
|
-
# { "user" => {"username" => "test", "password" => "changeme" }
|
38
|
-
#
|
39
|
-
# becomes:
|
40
|
-
#
|
41
|
-
# { "username" => "test", "password" => "changeme" }
|
42
|
-
def normalize_item_data(item)
|
43
|
-
if item.size == 1 && item.values.first.is_a?(Hash)
|
44
|
-
item.values.first
|
45
|
-
else
|
46
|
-
item
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def table_from_array(data)
|
51
|
-
return [] if data.empty?
|
52
|
-
table = []
|
53
|
-
items = data.map { |item| normalize_item_data(item) }
|
54
|
-
columns = items.first.keys
|
55
|
-
table << columns
|
56
|
-
items.each do |item|
|
57
|
-
row = columns.map { |c| item[c] }
|
58
|
-
table << row.map(&:to_s)
|
59
|
-
end
|
60
|
-
return table
|
61
|
-
end
|
62
|
-
|
63
|
-
def table_from_hash(data)
|
64
|
-
return [] if data.empty?
|
65
|
-
table = []
|
66
|
-
normalize_item_data(data).each do |k, v|
|
67
|
-
table << ["#{k}:", v].map(&:to_s)
|
68
|
-
end
|
69
|
-
table
|
70
|
-
end
|
71
|
-
|
72
|
-
def print_unknown(data)
|
73
|
-
say data
|
74
|
-
end
|
75
|
-
|
76
|
-
def print_big_table(table, options={ })
|
77
|
-
return if table.empty?
|
78
|
-
|
79
|
-
formats, ident, colwidth = [], options[:ident].to_i, options[:colwidth]
|
80
|
-
options[:truncate] = terminal_width if options[:truncate] == true
|
81
|
-
|
82
|
-
formats << "%-#{colwidth + 2}s" if colwidth
|
83
|
-
start = colwidth ? 1 : 0
|
84
|
-
|
85
|
-
start.upto(table.first.length - 2) do |i|
|
86
|
-
maxima ||= table.max { |a, b| a[i].size <=> b[i].size }[i].size
|
87
|
-
formats << "%-#{maxima + 2}s"
|
88
|
-
end
|
89
|
-
|
90
|
-
formats << "%s"
|
91
|
-
formats[0] = formats[0].insert(0, " " * ident)
|
92
|
-
|
93
|
-
header_printed = false
|
94
|
-
table.each do |row|
|
95
|
-
sentence = ""
|
96
|
-
|
97
|
-
row.each_with_index do |column, i|
|
98
|
-
sentence << formats[i] % column.to_s
|
99
|
-
end
|
100
|
-
|
101
|
-
sentence = truncate(sentence, options[:truncate]) if options[:truncate]
|
102
|
-
$stdout.puts sentence
|
103
|
-
say(set_color("-" * sentence.size, :green)) unless header_printed
|
104
|
-
header_printed = true
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
class << self
|
111
|
-
def help(shell, subcommand = true)
|
112
|
-
list = self.printable_tasks(true, subcommand)
|
113
|
-
Thor::Util.thor_classes_in(self).each do |klass|
|
114
|
-
list += printable_tasks(false)
|
115
|
-
end
|
116
|
-
list.sort! { |a, b| a[0] <=> b[0] }
|
117
|
-
|
118
|
-
shell.say
|
119
|
-
shell.print_table(list, :indent => 2, :truncate => true)
|
120
|
-
shell.say
|
121
|
-
Thor.send(:class_options_help, shell)
|
122
|
-
end
|
123
|
-
|
124
|
-
def banner(task, namespace = nil, subcommand = false)
|
125
|
-
task.name
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
data/lib/apipie/client/main.rb
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
require "apipie/client/thor"
|
2
|
-
require "apipie/client/cli_command"
|
3
|
-
|
4
|
-
module Apipie
|
5
|
-
module Client
|
6
|
-
class Main < Thor
|
7
|
-
|
8
|
-
def help(meth = nil)
|
9
|
-
if meth && !self.respond_to?(meth)
|
10
|
-
initialize_thorfiles(meth)
|
11
|
-
klass, task = Thor::Util.find_class_and_task_by_namespace(meth)
|
12
|
-
self.class.handle_no_task_error(task, false) if klass.nil?
|
13
|
-
klass.start(["-h", task].compact, :shell => self.shell)
|
14
|
-
else
|
15
|
-
say "#{apipie_options[:name].capitalize} CLI"
|
16
|
-
say
|
17
|
-
invoke :commands
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "commands [SEARCH]", "List the available commands"
|
22
|
-
def commands(search="")
|
23
|
-
initialize_thorfiles
|
24
|
-
klasses = Thor::Base.subclasses
|
25
|
-
display_klasses(false, false, klasses)
|
26
|
-
end
|
27
|
-
|
28
|
-
class << self
|
29
|
-
private
|
30
|
-
def dispatch(task, given_args, given_options, config)
|
31
|
-
parser = Thor::Options.new :auth => Thor::Option.parse(%w[auth -a], :string)
|
32
|
-
opts = parser.parse(given_args)
|
33
|
-
if opts['auth']
|
34
|
-
username, password = opts['auth'].split(':')
|
35
|
-
apipie_options[:config][:username] = username
|
36
|
-
apipie_options[:config][:password] = password
|
37
|
-
end
|
38
|
-
remaining = parser.remaining
|
39
|
-
|
40
|
-
super(task, remaining, given_options, config)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def method_missing(meth, *args)
|
47
|
-
meth = meth.to_s
|
48
|
-
initialize_thorfiles(meth)
|
49
|
-
klass, task = Thor::Util.find_class_and_task_by_namespace(meth)
|
50
|
-
args.unshift(task) if task
|
51
|
-
klass.start(args, :shell => self.shell)
|
52
|
-
end
|
53
|
-
|
54
|
-
# Load the thorfiles. If relevant_to is supplied, looks for specific files
|
55
|
-
# in the thor_root instead of loading them all.
|
56
|
-
#
|
57
|
-
# By default, it also traverses the current path until find Thor files, as
|
58
|
-
# described in thorfiles. This look up can be skipped by suppliying
|
59
|
-
# skip_lookup true.
|
60
|
-
#
|
61
|
-
def initialize_thorfiles(relevant_to=nil, skip_lookup=false)
|
62
|
-
thorfiles.each do |f|
|
63
|
-
Thor::Util.load_thorfile(f, nil, options[:debug])
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def thorfiles
|
68
|
-
Dir[File.expand_path("*/commands/*.thor", apipie_options[:root])]
|
69
|
-
end
|
70
|
-
|
71
|
-
# Display information about the given klasses. If with_module is given,
|
72
|
-
# it shows a table with information extracted from the yaml file.
|
73
|
-
#
|
74
|
-
def display_klasses(with_modules=false, show_internal=false, klasses=Thor::Base.subclasses)
|
75
|
-
klasses -= [Thor, Main, ::Apipie::Client::CliCommand, ::Thor] unless show_internal
|
76
|
-
|
77
|
-
show_modules if with_modules && !thor_yaml.empty?
|
78
|
-
|
79
|
-
list = Hash.new { |h, k| h[k] = [] }
|
80
|
-
groups = []
|
81
|
-
|
82
|
-
# Get classes which inherit from Thor
|
83
|
-
(klasses - groups).each { |k| list[k.namespace.split(":").first] += k.printable_tasks(false) }
|
84
|
-
|
85
|
-
# Get classes which inherit from Thor::Base
|
86
|
-
groups.map! { |k| k.printable_tasks(false).first }
|
87
|
-
list["root"] = groups
|
88
|
-
|
89
|
-
# Order namespaces with default coming first
|
90
|
-
list = list.sort { |a, b| a[0].sub(/^default/, '') <=> b[0].sub(/^default/, '') }
|
91
|
-
list.each { |n, tasks| display_tasks(n, tasks) unless tasks.empty? }
|
92
|
-
end
|
93
|
-
|
94
|
-
def display_tasks(namespace, list) #:nodoc:
|
95
|
-
say namespace
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
end
|
101
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
unless RestClient.const_defined? :OAUTH_EXTENSION
|
2
|
-
RestClient::OAUTH_EXTENSION = lambda do |request, args|
|
3
|
-
if args[:oauth]
|
4
|
-
uri = URI.parse args[:url]
|
5
|
-
default_options = { :site => "#{uri.scheme}://#{uri.host}:#{uri.port.to_s}",
|
6
|
-
:request_token_path => "",
|
7
|
-
:authorize_path => "",
|
8
|
-
:access_token_path => "" }
|
9
|
-
options = default_options.merge args[:oauth][:options] || { }
|
10
|
-
consumer = OAuth::Consumer.new(args[:oauth][:consumer_key], args[:oauth][:consumer_secret], options)
|
11
|
-
|
12
|
-
consumer.sign!(request)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
unless RestClient.before_execution_procs.include? RestClient::OAUTH_EXTENSION
|
18
|
-
RestClient.add_before_execution_proc &RestClient::OAUTH_EXTENSION
|
19
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/<%= name %><%= suffix %>/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["TODO"]
|
6
|
-
gem.email = ["TODO"]
|
7
|
-
gem.description = %q{TODO: Write a gem description}
|
8
|
-
gem.summary = %q{TODO: Write a gem summary}
|
9
|
-
gem.homepage = ""
|
10
|
-
|
11
|
-
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name = "<%= name %><%= suffix %>"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
gem.version = <%= class_base %><%= class_suffix %>::VERSION
|
17
|
-
|
18
|
-
<% if all? %>gem.add_dependency 'thor', '>= 0.15.4'<% end %>
|
19
|
-
gem.add_dependency 'apipie-rails', '~> <%= Apipie::VERSION %>'
|
20
|
-
gem.add_dependency 'json'
|
21
|
-
gem.add_dependency 'rest-client', '>= 1.6.1'
|
22
|
-
gem.add_dependency 'oauth'
|
23
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require "rubygems" # ruby1.9 doesn't "require" it though
|
3
|
-
require "pathname"
|
4
|
-
require "thor"
|
5
|
-
require 'thor/core_ext/file_binary_read'
|
6
|
-
|
7
|
-
load_path = File.expand_path("../../lib", __FILE__)
|
8
|
-
$: << load_path unless $:.include?(load_path)
|
9
|
-
|
10
|
-
name, suffix = "<%= name %>", "<%= suffix %>"
|
11
|
-
|
12
|
-
require name + suffix
|
13
|
-
require 'apipie/client/main'
|
14
|
-
|
15
|
-
client_module = Object.const_get "<%= class_base %><%= class_suffix %>"
|
16
|
-
|
17
|
-
begin
|
18
|
-
Apipie::Client::Main.apipie_options = { :name => name,
|
19
|
-
:config => client_module.client_config,
|
20
|
-
:client_module => client_module,
|
21
|
-
:root => client_module.root }
|
22
|
-
Apipie::Client::Main.start
|
23
|
-
rescue RestClient::Exception => e
|
24
|
-
$stderr.puts e.message
|
25
|
-
exit 1
|
26
|
-
rescue Errno::ECONNREFUSED => e
|
27
|
-
$stderr.puts "Server #{client_module.client_config[:base_url]} not available"
|
28
|
-
$stderr.puts e.message
|
29
|
-
exit 1
|
30
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'apipie/client/base'
|
2
|
-
require 'json'
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
Object.const_set("<%= class_base + class_suffix %>", client_module = Module.new do
|
6
|
-
def self.client_config
|
7
|
-
@client_config ||= YAML.load_file("#{root}/#{name}/config.yml")
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.root
|
11
|
-
@root ||= File.expand_path(File.dirname(__FILE__))
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.name
|
15
|
-
"<%= name %><%= suffix %>"
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.doc
|
19
|
-
@doc ||= File.open("#{root}/#{name}/documentation.json", 'r') do |f|
|
20
|
-
JSON.load(f.read)['docs']
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end)
|
24
|
-
|
25
|
-
require '<%= name %><%= suffix %>/version'
|
26
|
-
resource_files = Dir[File.expand_path("#{client_module.root}/#{client_module.name}/resources/*.rb", __FILE__)]
|
27
|
-
resource_files.each { |f| require f }
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class <%= resource_name.camelize %> < Apipie::Client::CliCommand
|
2
|
-
|
3
|
-
<% resource[:methods].each do |method| -%>
|
4
|
-
desc '<%= method[:name] %>', '<%= api(method)[:short_description] %>'
|
5
|
-
<% params_in_path(method).each do |param| -%>
|
6
|
-
method_option :<%= param %>, :required => 'true'
|
7
|
-
<% end
|
8
|
-
method[:params].map {|p| p[:expected_type] == "hash" ? (p[:params] || p) : p}.flatten.each do |param| -%>
|
9
|
-
method_option :<%= param[:name] %>, :required => <%= param[:required] ? 'true' : 'false' %>, :desc => '<%= plaintext(param[:description]) %>', :type => :<%= param[:expected_type] %>
|
10
|
-
<% end -%>
|
11
|
-
def <%= method[:name] %>
|
12
|
-
<% #if params_in_path(method).any? || transformation_hash(method).any?
|
13
|
-
transform_options_params = [params_in_path(method).inspect]
|
14
|
-
transform_options_params << transformation_hash(method).inspect if transformation_hash(method).any? -%>
|
15
|
-
params = transform_options(<%= transform_options_params.join(", ").html_safe %>)
|
16
|
-
<% #end -%>
|
17
|
-
data, resp = client.<%= method[:name] %>(params)
|
18
|
-
print_data(data)
|
19
|
-
end
|
20
|
-
|
21
|
-
<% end -%>
|
22
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module <%= class_base %><%= class_suffix %>
|
2
|
-
module Resources
|
3
|
-
class <%= resource_name.camelize %> < Apipie::Client::Base
|
4
|
-
def self.doc
|
5
|
-
@doc ||= <%= class_base %><%= class_suffix %>.doc['resources']["<%= resource_key %>"]
|
6
|
-
end
|
7
|
-
<% resource[:methods].each do |method| -%>
|
8
|
-
|
9
|
-
# @param [Hash] params a hash of params to be passed to the service
|
10
|
-
# allowed keys are: <%= validation(method).inspect %>
|
11
|
-
#
|
12
|
-
# @param [Hash] headers additional http headers
|
13
|
-
def <%= method[:name] %>(params = { }, headers = { })
|
14
|
-
check_params params, :allowed => <%= method[:params].any? %>, :method => __method__
|
15
|
-
url, params = fill_params_in_url "<%= api(method)[:api_url] %>", params
|
16
|
-
call(:"<%= api(method)[:http_method].downcase %>", url, params, headers)
|
17
|
-
end
|
18
|
-
<% end -%>
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/lib/apipie/client/thor.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
module Apipie
|
2
|
-
module Client
|
3
|
-
class Thor < ::Thor
|
4
|
-
|
5
|
-
def self.apipie_options
|
6
|
-
Apipie::Client::Thor.instance_variable_get :@apipie_options
|
7
|
-
end
|
8
|
-
|
9
|
-
no_tasks do
|
10
|
-
def apipie_options
|
11
|
-
self.class.apipie_options
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.apipie_options=(options)
|
16
|
-
Apipie::Client::Thor.instance_variable_set :@apipie_options, options
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/rubygem-apipie-rails.spec
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
%global gem_name apipie-rails
|
2
|
-
|
3
|
-
%if 0%{?rhel} == 6 || 0%{?fedora} < 17
|
4
|
-
%define rubyabi 1.8
|
5
|
-
%else
|
6
|
-
%define rubyabi 1.9.1
|
7
|
-
%endif
|
8
|
-
%if 0%{?rhel} == 6
|
9
|
-
%global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
|
10
|
-
%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}
|
11
|
-
%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem
|
12
|
-
%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
|
13
|
-
%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}
|
14
|
-
%global gem_libdir %{gem_dir}/gems/%{gem_name}-%{version}/lib
|
15
|
-
%endif
|
16
|
-
|
17
|
-
Summary: Rails API documentation tool and client generator
|
18
|
-
Name: rubygem-%{gem_name}
|
19
|
-
Version: 0.0.11
|
20
|
-
Release: 3%{?dist}
|
21
|
-
Group: Development/Libraries
|
22
|
-
License: MIT
|
23
|
-
URL: http://github.com/Pajk/apipie-rails
|
24
|
-
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
|
25
|
-
Requires: ruby(abi) >= %{rubyabi}
|
26
|
-
Requires: rubygems
|
27
|
-
%if 0%{?fedora}
|
28
|
-
BuildRequires: rubygems-devel
|
29
|
-
%endif
|
30
|
-
BuildRequires: ruby(abi) >= %{rubyabi}
|
31
|
-
BuildRequires: rubygems
|
32
|
-
BuildArch: noarch
|
33
|
-
Provides: rubygem(%{gem_name}) = %{version}
|
34
|
-
|
35
|
-
%description
|
36
|
-
This gem adds new methods to Rails controllers that can be used to describe
|
37
|
-
resources exposed by API. Information entered with provided DSL are used
|
38
|
-
to generate documentation, client or to validate incoming requests.
|
39
|
-
|
40
|
-
%package doc
|
41
|
-
BuildArch: noarch
|
42
|
-
Requires: %{name} = %{version}-%{release}
|
43
|
-
Summary: Documentation for rubygem-%{gem_name}
|
44
|
-
|
45
|
-
%description doc
|
46
|
-
This package contains documentation for rubygem-%{gem_name}.
|
47
|
-
|
48
|
-
%prep
|
49
|
-
%setup -q -c -T
|
50
|
-
mkdir -p .%{gem_dir}
|
51
|
-
gem install --local --install-dir .%{gem_dir} \
|
52
|
-
--force %{SOURCE0} --no-rdoc --no-ri
|
53
|
-
|
54
|
-
%build
|
55
|
-
|
56
|
-
%install
|
57
|
-
mkdir -p %{buildroot}%{gem_dir}
|
58
|
-
cp -a .%{gem_dir}/* \
|
59
|
-
%{buildroot}%{gem_dir}/
|
60
|
-
|
61
|
-
%files
|
62
|
-
%dir %{gem_instdir}
|
63
|
-
%{gem_instdir}/app
|
64
|
-
%{gem_instdir}/lib
|
65
|
-
%exclude %{gem_instdir}/Gemfile.lock
|
66
|
-
%exclude %{gem_cache}
|
67
|
-
%{gem_spec}
|
68
|
-
%doc %{gem_instdir}/MIT-LICENSE
|
69
|
-
%doc %{gem_instdir}/APACHE-LICENSE-2.0
|
70
|
-
|
71
|
-
%exclude %{gem_instdir}/spec
|
72
|
-
%exclude %{gem_instdir}/rel-eng
|
73
|
-
%exclude %{gem_instdir}/.gitignore
|
74
|
-
%exclude %{gem_instdir}/.rspec
|
75
|
-
%exclude %{gem_instdir}/.rvmrc
|
76
|
-
%exclude %{gem_instdir}/.travis.yml
|
77
|
-
%exclude %{gem_instdir}/rubygem-apipie-rails.spec
|
78
|
-
%exclude %{gem_dir}/cache/%{gem_name}-%{version}.gem
|
79
|
-
|
80
|
-
%files doc
|
81
|
-
%doc %{gem_instdir}/MIT-LICENSE
|
82
|
-
%doc %{gem_instdir}/README.rdoc
|
83
|
-
%doc %{gem_instdir}/NOTICE
|
84
|
-
%{gem_instdir}/Rakefile
|
85
|
-
%{gem_instdir}/Gemfile
|
86
|
-
%{gem_instdir}/%{gem_name}.gemspec
|
87
|
-
|
88
|
-
%changelog
|
89
|
-
* Fri Sep 07 2012 Miroslav Suchý <msuchy@redhat.com> 0.0.11-3
|
90
|
-
- summary should not end with dot (msuchy@redhat.com)
|
91
|
-
- fix spelling (msuchy@redhat.com)
|
92
|
-
- do not package Gemfile.lock (msuchy@redhat.com)
|
93
|
-
|
94
|
-
* Fri Aug 17 2012 Ivan Necas <inecas@redhat.com> 0.0.11-2
|
95
|
-
- fix building for F17 reusing the macros from rubygem- devel
|
96
|
-
|
97
|
-
* Wed Aug 15 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.11-1
|
98
|
-
- apipie-rails v0.0.11
|
99
|
-
- cli client improvements
|
100
|
-
|
101
|
-
* Tue Jul 31 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.9-2
|
102
|
-
- exclude documentation from rpm
|
103
|
-
|
104
|
-
* Tue Jul 31 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.9-1
|
105
|
-
- New version of apipie-rails gem (pajkycz@gmail.com)
|
106
|
-
- fixed client generator
|
107
|
-
- resource level error descriptions
|
108
|
-
- response supported formats
|
109
|
-
|
110
|
-
* Thu Jul 26 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.8-3
|
111
|
-
- Require rubygems in spec file
|
112
|
-
|
113
|
-
* Thu Jul 26 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.8-2
|
114
|
-
- New version of apipie-rails gem
|
115
|
-
- Generated client improvements
|
116
|
-
|
117
|
-
* Thu Jul 26 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.7-2
|
118
|
-
- removed doc files from rpm
|
119
|
-
|
120
|
-
* Wed Jul 25 2012 Pavel Pokorný <pajkycz@gmail.com> 0.0.7-1
|
121
|
-
- new package built with tito
|
122
|
-
|