Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
1  .gitignore
... ...
@@ -0,0 +1 @@
  1
+*.gem
14  README.md → README.rdoc
Source Rendered
... ...
@@ -1,7 +1,14 @@
1  
-# Terminal.size
  1
+= Terminal.size
2 2
 
3 3
 A tiny gem to accomplish a simple task: Determining the terminal size.
4 4
 
  5
+== Usage
  6
+
  7
+    p Terminal.size # ⇒ {height: 90, width: 161}
  8
+    p Terminal.size! # to get 80×25 as a fallback instead of nil
  9
+
  10
+== Bonus Contract
  11
+
5 12
 One of the guarantees of this project is that it will always be exactly one
6 13
 file: `lib/terminal-size/terminal.rb`
7 14
 
@@ -11,7 +18,7 @@ not-easily-updated Copy & Paste). I'm kicking around the idea of using this as
11 18
 an example of an automatic, namespaced fat-pack trick, but we'll see if that's
12 19
 really necessary.
13 20
 
14  
-## Installation
  21
+== Installation
15 22
 
16 23
 Add this line to your application's Gemfile:
17 24
 
@@ -25,6 +32,3 @@ Or install it yourself as:
25 32
 
26 33
     $ gem install terminal-size
27 34
 
28  
-## Usage
29  
-
30  
-    p Terminal.size
2  lib/terminal-size.rb
... ...
@@ -1,5 +1,5 @@
1 1
 class Terminal
2  
-  class Size; VERSION = '0.0.1' end
  2
+  class Size; VERSION = '0.0.2' end
3 3
   class << self
4 4
     def size
5 5
       size_via_low_level_ioctl or size_via_stty or nil
25  terminal-size.gemspec
... ...
@@ -1,17 +1,12 @@
1 1
 # -*- encoding: utf-8 -*-
2  
-$:.unshift './lib'
  2
+require 'working/gemspec'
3 3
 require 'terminal-size'
4  
-
5  
-Gem::Specification.new do |gem|
6  
-  gem.name          = 'terminal-size'
7  
-  gem.version       = Terminal::Size::VERSION
8  
-  gem.authors       = %w(☈king Norrin)
9  
-  gem.email         = ['rking-terminal-size@sharpsaw.org']
10  
-  gem.description   = gem.summary = %q{Terminal.size ⇒ {columns: 80, rows: 25}}
11  
-  gem.homepage      = 'https://github.com/rking/terminal-size'
12  
-  gem.files         = `git ls-files`.split($/)
13  
-  gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14  
-  gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
15  
-
16  
-  gem.add_development_dependency 'working'
17  
-end
  4
+Working.gemspec \
  5
+  name: 'terminal-size',
  6
+  summary: Working.third_line_of_readme,
  7
+  description: Working.readme_snippet(/== Usage/, /== Installation/),
  8
+  version: Terminal::Size::VERSION,
  9
+  authors: %w(☈king Norrin),
  10
+  email: 'rking-terminal-size@sharpsaw.org',
  11
+  github: 'rking/terminal-size',
  12
+  deps: []

No commit comments for this range

Something went wrong with that request. Please try again.