Sha256: 5062fd4f918edfbfea3da56a78bce0f882245c22d42ffdf3be70f21dd943b1cd

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

module Climine::Command
  class Base < Thor

    no_commands {
      def redmine
        @redmine ||= Climine::Redmine.new(Climine::Config.new)
      end
      def render template_name, response
        unless response.error
          template = Climine::Template.new(template_name)
          if template.exist?
            res = response
            puts template.build.result(binding)
          else
            pp response
          end
        else
          say "-- Error or NotFound", :red
        end
      end
      def render_table data
        puts Hirb::Helpers::AutoTable.render(data)
      end
      def sort_by_id ary
        ary.sort{|a,b| a.id - b.id}
      end
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
climine-0.0.2 lib/climine/command/base.rb
climine-0.0.1 lib/climine/command/base.rb