Sha256: 09530f3ab79927a7697fb6bf636d3ad23fb45e8025400c0fab426d04092e89de

Contents?: true

Size: 1.27 KB

Versions: 149

Compression:

Stored size: 1.27 KB

Contents

module Origen
  module CodeGenerators
    class GemSetup < Origen::CodeGenerators::Base
      desc <<-END
This generator creates a gemspec file in the top-level directory to allow it
to be packed up and distributed as a gem.
END
      def create_gemspec_file
        @summary = ask 'Describe your plugin in a few words:'
        template 'templates/code_generators/gemspec.rb', File.join(Origen.root, "#{Origen.app.name}.gemspec")
      end

      def create_master_require_file
        file = "#{Origen.root}/lib/#{Origen.app.name}.rb"
        if File.exist?(file)
          prepend_to_file file, <<-END
require "origen"
require_relative "../config/application.rb"
require_relative "../config/environment.rb"

END
        else
          create_file file do
            <<-END
require "origen"
require_relative "../config/application.rb"
require_relative "../config/environment.rb"
END
          end
        end
      end

      def verify_semver
        unless Origen.app.version.semantic?
          puts <<-END

Warning, you application is not currently using semantic (1.2.3) versioning, this must be used if
you want to publish your plugin as a gem.

To upgrade your application to semantic versioning run the following command:

  origen add semver

END
        end
      end
    end
  end
end

Version data entries

149 entries across 149 versions & 1 rubygems

Version Path
origen-0.7.20 lib/origen/code_generators/gem_setup.rb
origen-0.7.19 lib/origen/code_generators/gem_setup.rb
origen-0.7.18 lib/origen/code_generators/gem_setup.rb
origen-0.7.17 lib/origen/code_generators/gem_setup.rb
origen-0.7.16 lib/origen/code_generators/gem_setup.rb
origen-0.7.15 lib/origen/code_generators/gem_setup.rb
origen-0.7.14 lib/origen/code_generators/gem_setup.rb
origen-0.7.13 lib/origen/code_generators/gem_setup.rb
origen-0.7.12 lib/origen/code_generators/gem_setup.rb
origen-0.7.11 lib/origen/code_generators/gem_setup.rb
origen-0.7.10 lib/origen/code_generators/gem_setup.rb
origen-0.7.9 lib/origen/code_generators/gem_setup.rb
origen-0.7.8 lib/origen/code_generators/gem_setup.rb
origen-0.7.7 lib/origen/code_generators/gem_setup.rb
origen-0.7.6 lib/origen/code_generators/gem_setup.rb
origen-0.7.5 lib/origen/code_generators/gem_setup.rb
origen-0.7.4 lib/origen/code_generators/gem_setup.rb
origen-0.7.3 lib/origen/code_generators/gem_setup.rb
origen-0.7.2 lib/origen/code_generators/gem_setup.rb
origen-0.7.1 lib/origen/code_generators/gem_setup.rb