ttycaca 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3b77c3d376057a4a9c582a5ead322bfa987111bc
4
+ data.tar.gz: ff14acce09367a6c55fed2cf970897e4c9658bc9
5
+ SHA512:
6
+ metadata.gz: d93a014eec2c981dffd8871cb701e563bec860b7363793ce9cca6e26c08ea96bc4447d673fb14d313d16a699bf895de0946eb0c5911b06e9357cd9277335e782
7
+ data.tar.gz: 24ed96ac06b9e26835fd45ed150457054013baf5d8c6096b1e112573c87eae090347eff2521f521045ebe7aaa1ab525c40248e29a1c48080738e02b0bba56c78
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in usaidwat.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 Michael Dippery
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,41 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'ttycaca/version'
4
+
5
+ GEMNAME = 'ttycaca'
6
+ GEMVERSION = Ttycaca::VERSION
7
+ GEM = "#{GEMNAME}-#{GEMVERSION}.gem"
8
+ GEMSPEC = `git ls-files | grep gemspec`.chomp
9
+
10
+ desc "Build #{GEMNAME}.gem"
11
+ task :build => :perms do
12
+ system "gem", "build", GEMSPEC
13
+ end
14
+
15
+ desc "Ensure correct permissions for #{GEMNAME}.gem"
16
+ task :perms do
17
+ system "chmod", "-R", "a+rX", *`git ls-files`.chomp.split("\n")
18
+ end
19
+
20
+ desc "Tag the latest version of #{GEMNAME}"
21
+ task :tag do
22
+ system "git", "tag", "-s", "-m", "#{GEMNAME} v#{GEMVERSION}", "v#{GEMVERSION}"
23
+ end
24
+
25
+ desc "Install #{GEMNAME}.gem"
26
+ task :install => :build do
27
+ system "gem", "install", GEM
28
+ end
29
+
30
+ desc "Push gem to RubyGems"
31
+ task :release => [:tag, :build] do
32
+ fail 'Cannot release a dev version' if Ttycaca::VERSION.end_with?('dev')
33
+ system "gem", "push", GEM
34
+ end
35
+
36
+ desc "Clean built products"
37
+ task :clean do
38
+ rm Dir.glob("*.gem"), :verbose => true
39
+ end
40
+
41
+ task :default => :build
@@ -0,0 +1,17 @@
1
+ require 'highline'
2
+
3
+ module Ttycaca
4
+ class Terminal
5
+ def initialize
6
+ @term = HighLine.new
7
+ end
8
+
9
+ def width
10
+ @term.output_cols
11
+ end
12
+
13
+ def height
14
+ @term.output_rows
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module Ttycaca
2
+ VERSION = '1.0.0'
3
+ end
data/lib/ttycaca.rb ADDED
@@ -0,0 +1 @@
1
+ require 'ttycaca/terminal'
@@ -0,0 +1 @@
1
+ require 'ttycaca'
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ module Ttycaca
4
+ describe Terminal do
5
+ let (:terminal) { Terminal.new }
6
+
7
+ describe "#width" do
8
+ it "should return a positive integer" do
9
+ expect(terminal.width).to be > 0
10
+ end
11
+ end
12
+
13
+ describe "#height" do
14
+ it "should return a positive integer" do
15
+ expect(terminal.height).to be > 0
16
+ end
17
+ end
18
+ end
19
+ end
data/ttycaca.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require 'ttycaca/version'
7
+
8
+ Gem::Specification.new do |gem|
9
+ gem.name = 'ttycaca'
10
+ gem.version = Ttycaca::VERSION
11
+ gem.licenses = ['MIT']
12
+ gem.authors = ['Michael Dippery']
13
+ gem.email = ['michael@monkey-robot.com']
14
+ gem.homepage = 'https://github.com/mdippery/ttycaca'
15
+ gem.summary = 'Probe the terminal for information'
16
+ gem.description = 'An interface for querying the console for information about itself'
17
+
18
+ gem.metadata = {
19
+ 'build_date' => Time.now.strftime('%Y-%m-%d %H:%M:%S %Z'),
20
+ 'commit' => `git describe`.chomp,
21
+ 'commit_hash' => `git rev-parse HEAD`.chomp,
22
+ }
23
+
24
+ gem.files = `git ls-files`.split($/)
25
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
26
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
27
+ gem.require_paths = ['lib']
28
+
29
+ gem.required_ruby_version = '>= 1.9.3'
30
+
31
+ gem.add_runtime_dependency('highline', '~> 1.7')
32
+
33
+ gem.add_development_dependency('rspec', '~> 3.4')
34
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ttycaca
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Michael Dippery
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: highline
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.4'
41
+ description: An interface for querying the console for information about itself
42
+ email:
43
+ - michael@monkey-robot.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - Rakefile
52
+ - lib/ttycaca.rb
53
+ - lib/ttycaca/terminal.rb
54
+ - lib/ttycaca/version.rb
55
+ - spec/spec_helper.rb
56
+ - spec/ttycaca/terminal_spec.rb
57
+ - ttycaca.gemspec
58
+ homepage: https://github.com/mdippery/ttycaca
59
+ licenses:
60
+ - MIT
61
+ metadata:
62
+ build_date: 2015-11-19 19:59:49 PST
63
+ commit: v1.0.0
64
+ commit_hash: 16ed1d5b2e4f4cdfed2059666f367bb6f83bd4c5
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.9.3
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.4.5.1
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Probe the terminal for information
85
+ test_files:
86
+ - spec/spec_helper.rb
87
+ - spec/ttycaca/terminal_spec.rb