Coder Social home page Coder Social logo

jibby's Introduction

Jibby

Jibby is an interactive Jira client. This allows you to load Jira tickets on the console.

TODO: Make better descriptions

Installation

$ gem install jibby

Usage

run jibby from command line using the following syntax:

$ jibby <jira instance url>

TODO: Finish

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/sidapa/jibby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make changes
  4. Make sure specs and rubocop passes
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request

jibby's People

Contributors

sidapa avatar

Watchers

CodeAbstract avatar James Cloos avatar Kristine Sevilla avatar  avatar  avatar  avatar  avatar

jibby's Issues

Make this work with Ruby 2.0.0

The default ruby version of Mavericks (and El Capitan(?)) is 2.0 but the gem uses features like required named parameters which was introduced with 2.1. We need to support 2.0 and will need to make the app run on the said ruby version

Need a multi line editor

We need a way for users to edit multi-line fields like comments, descriptions or acceptance criteria. Proposed solution is to use a curses window like the following below.

Following things to note:

  • Code needs heavy optimization
  • Code needs a windowing mechanism for when the text is much longer than the viewport
  • The idea is when the user presses , the final text is displayed to the user and the user is given an option to either, continue, cancel or re-edit.
  • markdown as a future consideration?
  • using #status_print to display usernames when mentioning with @?
  • Other ideas open
#!~/.rbenv/shims/ruby

require "curses"
include Curses

class Console
  def initialize(input)
    @string_array = input.split(/\r?\n/)

    @current_line = @string_array.size + 1
    @current_col = @string_array.last.size
    @sa_index = @string_array.size - 1
    @ls_index = @string_array.last.size - 1
  end

  def reset_cursor
    @sa_index = 0
    @ls_index = 0
    @current_line = 2
    @current_col = 1
  end

  def cursor_end
    setpos(@current_line, @current_col)
  end

  def status_print(text)
    setpos(lines - 1, 1)
    clrtoeol
    addstr(text)
    cursor_end
  end

  def redraw_window
    clear
    setpos(1,1)
    addstr("-- Press Esc when finished. --")

    setpos(1, 1)

    c_line = 2
    @string_array.each do |lstring|
      setpos(c_line, 1)
      addstr(lstring)
      c_line += 1
    end

    cursor_end
  end

  def start
    init_screen
    begin
      c = nil

      crmode
      stdscr.keypad = true
      noecho

      redraw_window

      loop do
        status_print("getch = #{c}; @sa_index = #{@sa_index}; @string_array[@sa_index] = #{@string_array[@sa_index]}; current character: #{@string_array[@sa_index][@ls_index]}") if c
        refresh

        c = getch

        break if c == 27

        if c == 259 && @sa_index > 0
            @sa_index -= 1
            @current_line -= 1
            if @ls_index > @string_array[@sa_index].size
              @ls_index = @string_array[@sa_index].size
              @current_col = @string_array[@sa_index].size + 1
            end
        elsif c == 258 && @sa_index < @string_array.size - 1
            @sa_index += 1
            @current_line += 1
            if @ls_index > @string_array[@sa_index].size
              @ls_index = @string_array[@sa_index].size
              @current_col = @string_array[@sa_index].size + 1
            end
        elsif c == 260 && @ls_index > 0
            @ls_index -= 1
            @current_col -= 1
        elsif c == 261 && @ls_index < @string_array[@sa_index].size
            @ls_index += 1
            @current_col += 1
        elsif c == 127 && @ls_index > 0
            @ls_index -= 1
            @current_col -= 1
            setpos(@current_line, @current_col)
            @string_array[@sa_index].slice! @ls_index
            delch
        elsif c == 330
            @string_array[@sa_index].slice! @ls_index
            delch
        elsif c == 10
            @string_array.insert(@sa_index + 1, "")
            @sa_index += 1
            @current_line += 1
            if @ls_index > @string_array[@sa_index].size
              @ls_index = @string_array[@sa_index].size
              @current_col = @string_array[@sa_index].size + 1
            end
            redraw_window
        elsif c.class == String
            @string_array[@sa_index] = @string_array[@sa_index].insert(@ls_index, c)
            insch(c)

            if @ls_index < @string_array[@sa_index].size
              @ls_index += 1
              @current_col += 1
            end
        end
      end
    ensure
      close_screen
    end

    @string_array.join("\n")
  end
end

test =<<-EOF
This is just a test.
hello there!
This quick brown fox
jumped over the lazy dog

lorem ipsum dolor
EOF

system('clear')
while true do
  '> '.display
  command = gets.chomp
  break if command == 'q'

  case command
  when 'window'
    test = Console.new(test).start
    puts 'New text value:'
    puts
    puts test
  when 'print'
    puts test
  else
    puts command
  end
end

Add 'help' command

We need a way for users to be able to figure out 1) Which commands I can use 2) How to use each command.

Maybe create a help command shows help content based on argument and general help details (including list of commands) when called with no args?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.