Sha256: 8a509ebc7d922d1ecc501fad099723ebd754a9237ea229341bfcbda88e5cd326

Contents?: true

Size: 748 Bytes

Versions: 8

Compression:

Stored size: 748 Bytes

Contents

module Climine::Command
  class Base < Thor

    no_commands {
      def config
        @config ||= Climine::Config.new
      end
      def redmine
        @redmine ||= Climine::Redmine.new(config)
      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

8 entries across 8 versions & 1 rubygems

Version Path
climine-0.1.1 lib/climine/command/base.rb
climine-0.1.0 lib/climine/command/base.rb
climine-0.0.8 lib/climine/command/base.rb
climine-0.0.7 lib/climine/command/base.rb
climine-0.0.6 lib/climine/command/base.rb
climine-0.0.5 lib/climine/command/base.rb
climine-0.0.4 lib/climine/command/base.rb
climine-0.0.3 lib/climine/command/base.rb