google-apis-generator/lib/google/apis/generator.rb
def render(json)
        api = parse_description(json)
        Annotator.process(api, @names)
        context = {
          "api" => api,
          "generator_version" => Google::Apis::Generator::VERSION
        }

        base_path = api.gem_name
        lib_path = File.join(base_path, "lib")
        spec_path = File.join(base_path, "spec")
        module_path = File.join(lib_path, ActiveSupport::Inflector.underscore(api.qualified_name))

        result = Result.new({},
                            File.join(module_path, "gem_version.rb"),
                            File.join(base_path, "CHANGELOG.md"),
                            api.gem_name,
                            api.revision)
        result.files[File.join(base_path, ".rspec")] = render_template("dot-rspec", context)
        result.files[File.join(base_path, ".yardopts")] = render_template("dot-yardopts", context)
        result.files[result.changelog_path] = render_template("initial-changelog.md", context)
        result.files[File.join(base_path, "Gemfile")] = render_template("gemfile", context)
        result.files[File.join(base_path, "#{api.gem_name}.gemspec")] = render_template("gemspec", context)
        result.files[File.join(base_path, "LICENSE.md")] = render_template("license.md", context)
        result.files[File.join(base_path, "OVERVIEW.md")] = render_template("overview.md", context)
        result.files[File.join(base_path, "Rakefile")] = render_template("rakefile", context)
        result.files[File.join(lib_path, "#{api.gem_name}.rb")] = render_template("entry-point.rb", context)
        result.files[module_path + ".rb"] = render_template("module.rb", context)
        result.files[File.join(module_path, "classes.rb")] = render_template("classes.rb", context)
        result.files[File.join(module_path, "representations.rb")] = render_template("representations.rb", context)
        result.files[File.join(module_path, "service.rb")] = render_template("service.rb", context)
        result.files[result.version_path] = render_template("initial-gem_version.rb", context)
        result.files[File.join(spec_path, "generated_spec.rb")] = render_template("generated_spec.rb", context)
        result.files[File.join(base_path, ".repo-metadata.json")] = render_template("repo-metadata.json", context)
        result
      end
# Generates ruby source for an API
#
# @param [String] json
#  API Description, as JSON text
# @return [Hash<String,String>]
#  Hash of generated files keyed by path
Generates ruby source for an API
Generates ruby source for an API
def render(json)
        api = parse_description(json)
        Annotator.process(api, @names)
        context = {
          "api" => api,
          "generator_version" => Google::Apis::Generator::VERSION
        }
        base_path = api.gem_name
        lib_path = File.join(base_path, "lib")
        spec_path = File.join(base_path, "spec")
        module_path = File.join(lib_path, ActiveSupport::Inflector.underscore(api.qualified_name))
        result = Result.new({},
                            File.join(module_path, "gem_version.rb"),
                            File.join(base_path, "CHANGELOG.md"),
                            api.gem_name,
                            api.revision)
        result.files[File.join(base_path, ".rspec")] = render_template("dot-rspec", context)
        result.files[File.join(base_path, ".yardopts")] = render_template("dot-yardopts", context)
        result.files[result.changelog_path] = render_template("initial-changelog.md", context)
        result.files[File.join(base_path, "Gemfile")] = render_template("gemfile", context)
        result.files[File.join(base_path, "#{api.gem_name}.gemspec")] = render_template("gemspec", context)
        result.files[File.join(base_path, "LICENSE.md")] = render_template("license.md", context)
        result.files[File.join(base_path, "OVERVIEW.md")] = render_template("overview.md", context)
        result.files[File.join(base_path, "Rakefile")] = render_template("rakefile", context)
        result.files[File.join(lib_path, "#{api.gem_name}.rb")] = render_template("entry-point.rb", context)
        result.files[module_path + ".rb"] = render_template("module.rb", context)
        result.files[File.join(module_path, "classes.rb")] = render_template("classes.rb", context)
        result.files[File.join(module_path, "representations.rb")] = render_template("representations.rb", context)
        result.files[File.join(module_path, "service.rb")] = render_template("service.rb", context)
        result.files[result.version_path] = render_template("initial-gem_version.rb", context)
        result.files[File.join(spec_path, "generated_spec.rb")] = render_template("generated_spec.rb", context)
        result.files[File.join(base_path, ".repo-metadata.json")] = render_template("repo-metadata.json", context)
        result
      end
def render ( json ) api = parse_description ( json ) Annotator . process ( api , @names ) context = { "api" => api , "generator_version" => Google :: Apis :: Generator :: VERSION } base_path = api . gem_name lib_path = File . join ( base_path , "lib" ) spec_path = File . join ( base_path , "spec" ) module_path = File . join ( lib_path , ActiveSupport :: Inflector . underscore ( api . qualified_name ) ) result = Result . new ( { } , File . join ( module_path , "gem_version.rb" ) , File . join ( base_path , "CHANGELOG.md" ) , api . gem_name , api . revision ) result . files [ File . join ( base_path , ".rspec" ) ] = render_template ( "dot-rspec" , context ) result . files [ File . join ( base_path , ".yardopts" ) ] = render_template ( "dot-yardopts" , context ) result . files [ result . changelog_path ] = render_template ( "initial-changelog.md" , context ) result . files [ File . join ( base_path , "Gemfile" ) ] = render_template ( "gemfile" , context ) result . files [ File . join ( base_path , "#{api.gem_name}.gemspec" ) ] = render_template ( "gemspec" , context ) result . files [ File . join ( base_path , "LICENSE.md" ) ] = render_template ( "license.md" , context ) result . files [ File . join ( base_path , "OVERVIEW.md" ) ] = render_template ( "overview.md" , context ) result . files [ File . join ( base_path , "Rakefile" ) ] = render_template ( "rakefile" , context ) result . files [ File . join ( lib_path , "#{api.gem_name}.rb" ) ] = render_template ( "entry-point.rb" , context ) result . files [ module_path + ".rb" ] = render_template ( "module.rb" , context ) result . files [ File . join ( module_path , "classes.rb" ) ] = render_template ( "classes.rb" , context ) result . files [ File . join ( module_path , "representations.rb" ) ] = render_template ( "representations.rb" , context ) result . files [ File . join ( module_path , "service.rb" ) ] = render_template ( "service.rb" , context ) result . files [ result . version_path ] = render_template ( "initial-gem_version.rb" , context ) result . files [ File . join ( spec_path , "generated_spec.rb" ) ] = render_template ( "generated_spec.rb" , context ) result . files [ File . join ( base_path , ".repo-metadata.json" ) ] = render_template ( "repo-metadata.json" , context ) result end
Generates ruby source for an API
Generates ruby source for an API
Hash of generated files keyed by path
Hash of generated files keyed by path
Hash<String,String>
json
json API Description, as JSON text
json API Description as JSON text