Sha256: e1e8b1f3237dd36424d0bd60ebcc37aa093d6f1d9ebdecdd869e0d1d79bf6561

Contents?: true

Size: 715 Bytes

Versions: 15

Compression:

Stored size: 715 Bytes

Contents

module Gemsmith
  module Skeletons
    class BaseSkeleton
      def initialize cli
        @cli = cli
      end

      def self.run cli
        self.new(cli).create
      end

      def create
        public_methods.each { |method| public_send(method) if method =~ /^create_.+$/ }
      end

      def respond_to? name, include_private = false
        @cli.respond_to?(name, include_private) || super(name, include_private)
      end

      def method_missing name, *args, &block
        if respond_to?(name)
          @cli.public_send name, *args, &block
        else
          super name, *args, &block
        end
      end

      private

      def lib_root
        "%gem_name%/lib"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gemsmith-5.3.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-5.2.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-5.1.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-5.0.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-4.3.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-4.2.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-4.1.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-4.0.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-3.2.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-3.1.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-3.0.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-2.4.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-2.3.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-2.2.0 lib/gemsmith/skeletons/base_skeleton.rb
gemsmith-2.1.0 lib/gemsmith/skeletons/base_skeleton.rb