Sha256: e753a19a5b1851ab35ea53a9d650ab227e7a8c63d0c93b55e0c70027dffda617

Contents?: true

Size: 872 Bytes

Versions: 17

Compression:

Stored size: 872 Bytes

Contents

# -*- encoding : utf-8 -*-

require 'generators/card'

class Card
  module Generators
    class FormatGenerator < NamedBase
      source_root File.expand_path('../templates', __FILE__)

      argument :module_name, :required => true
      class_option 'core', :type => :boolean, aliases: '-c', :default => false, :group => :runtime, 
       :desc=>'create format files in Card gem'

      def create_files
        mod_path = if options.core?
            File.join Cardio.gem_root, 'mod', file_name
          else
            File.join 'mod', file_name
          end
        format_path = File.join(mod_path, 'format', "#{module_name}_format.rb")
        spec_path = File.join(mod_path, 'spec', 'format', "#{module_name}_format_spec.rb")
        template 'format_template.erb', format_path
        template 'format_spec_template.erb', spec_path
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
card-1.16.6 lib/generators/card/format/format_generator.rb
card-1.16.5 lib/generators/card/format/format_generator.rb
card-1.16.4 lib/generators/card/format/format_generator.rb
card-1.16.3 lib/generators/card/format/format_generator.rb
card-1.16.2 lib/generators/card/format/format_generator.rb
card-1.16.1 lib/generators/card/format/format_generator.rb
card-1.16.0 lib/generators/card/format/format_generator.rb
card-1.15.7 lib/generators/card/format/format_generator.rb
card-1.15.6 lib/generators/card/format/format_generator.rb
card-1.15.5 lib/generators/card/format/format_generator.rb
card-1.15.4 lib/generators/card/format/format_generator.rb
card-1.15.3 lib/generators/card/format/format_generator.rb
card-1.15.2 lib/generators/card/format/format_generator.rb
card-1.15.1 lib/generators/card/format/format_generator.rb
card-1.15.0 lib/generators/card/format/format_generator.rb
card-1.15.pre2 lib/generators/card/format/format_generator.rb
card-1.15.pre lib/generators/card/format/format_generator.rb