Sha256: 7c13daae6ce8d136781bf6b93615d8e9aeeab961cacbc80fc0374195ad7829b8
Contents?: true
Size: 1.07 KB
Versions: 19
Compression:
Stored size: 1.07 KB
Contents
require 'thor' require 'thor/group' module Utter module Generators class Ext < Thor::Group include Thor::Actions desc 'Generate an utter domain extension' def create_ext params={} @ext_name = params[:ext_name].downcase empty_directory "domain/#{@ext_name.downcase}/lib/internals" @file = <<-FOO module #{@ext_name.capitalize} VERSION = "0.0.0" class Main def initialize(app, opts={}, params={}) @app = app @opts = opts @params = params end def call(env) #TODO manipulate value objects, before passing to the stack! @app.call(env) #TODO manipulate value objects, after passing to the stack! end end end FOO create_file "domain/#{@ext_name.downcase}/lib/main.rb" append_to_file "domain/#{@ext_name.downcase}/lib/main.rb", @file empty_directory "domain/#{@ext_name.downcase}/spec" create_file "domain/#{@ext_name.downcase}/spec/spec_helper.rb" create_file "domain/#{@ext_name.downcase}/spec/main_spec.rb" create_file "domain/#{@ext_name.downcase}/README.md" end end end end
Version data entries
19 entries across 19 versions & 1 rubygems