Sha256: d47b71d4123f7a15970c69f40a248ffc80ea403de367f47c13aa02f1bf71bf02

Contents?: true

Size: 816 Bytes

Versions: 1

Compression:

Stored size: 816 Bytes

Contents

require "thor"
require "rubygems"

module Skelegem
  module Templates

    class SemverInit < Thor::Group

      include Thor::Actions

      argument :name

      def self.source_root
        File.dirname(__FILE__)
      end

      def init_semver
        version = SemVer.new
        version.save ".semver"

        # Object.send(:remove_const, :SemVer)
      end

      def create_lib_file
        File.delete "lib/#{name}/version.rb"
        template('version.tt', "lib/#{name}/version.rb")
      end

      def update_gemspec
        my_spec = Skelegem::Store.gemspec
        tmp_spec = Gem::Specification::from_yaml( `gem spec semver2 -r` )


        # puts "Adding #{tmp_spec.name}, #{tmp_spec.requirement.to_s}"
        my_spec.add_dependency tmp_spec.name, tmp_spec.version.to_s
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skelegem-0.1.0 lib/skelegem/templates/semver_init/semver_init.rb