Skip to content

Commit

Permalink
Initial project setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Sep 30, 2012
0 parents commit 26afe8e
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in tty.gemspec
gemspec
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2012 Piotr Murach

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# TTY
[![Build Status](https://secure.travis-ci.org/peter-murach/tty.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/peter-murach/tty.png?travis)][gemnasium] [![Code Climate](https://codeclimate.com/badge.png)][codeclimate]

[travis]: http://travis-ci.org/peter-murach/tty
[gemnasium]: https://gemnasium.com/peter-murach/tty
[codeclimate]: https://codeclimate.com/github/peter-murach/tty

Toolbox for developing CLI clients.

## Features

Jump-start development of your command line app:

* Fully customizable table rendering with an easy-to-use API.
(status: In Progress)
* Terminal output colorization. (status: TODO)
* Terminal & System detection utilities. (status: TODO)
* Text alignment/padding and diffs. (status: TODO)
* Shell user interface. (status: TODO)
* No dependencies to allow for easy gem vendoring.

## Installation

Add this line to your application's Gemfile:

gem 'tty'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tty

## Usage

### Table

Creating tables

```ruby
table = TTY::Table.new ['Header 1', 'Header 2']
table << ['a1', 'a2', 'a3']
table << ['b1', 'b2', 'b3']
```

```ruby
table = TTY::Table.new header: ['Header 1', 'Header 2'] do |t|
t << ['a1', 'a2', 'a3']
t << ['b1', 'b2', 'b3']
end
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

Copyright (c) 2012 Piotr Murach. See LICENSE for further details.
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- encoding: utf-8 -*-
$:.unshift File.expand_path('../lib', __FILE__)
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

task :default => [:spec]
11 changes: 11 additions & 0 deletions lib/tty.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- encoding: utf-8 -*-

require 'tty/version'
require 'tty/table'
require 'tty/color'

require 'tty/support/utils'

module TTY

end # TTY
5 changes: 5 additions & 0 deletions lib/tty/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- encoding: utf-8 -*-

module TTY
VERSION = "0.0.1"
end
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'rubygems'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rspec'
require 'tty'

RSpec.configure do |config|
config.order = :rand
end

class String
def normalize
gsub(/^[ \t]*/, '').chomp
end
end
23 changes: 23 additions & 0 deletions tty.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tty/version'

Gem::Specification.new do |gem|
gem.name = "tty"
gem.version = TTY::VERSION
gem.authors = ["Piotr Murach"]
gem.email = [""]
gem.description = %q{Toolbox for developing CLI clients}
gem.summary = %q{Toolbox for developing CLI clients}
gem.homepage = "http://github.com/peter-murach/tty"

gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.add_development_dependency 'rspec'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'yard'
end

0 comments on commit 26afe8e

Please sign in to comment.