terminal_helpers 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9f19e57b8017cc316f622bc6135cb4187799698b
4
+ data.tar.gz: 8f2c1a2757d9502ba6c08f85ece478fcc3d46d0a
5
+ SHA512:
6
+ metadata.gz: eb06397de9514aa575886e195aa9c3316750a5f5a86fe99472acb3ed81cd96ae947ac79e37f4ded2a501000efb70bf36f6812dd77fd3d7e0a1963da7de106f58
7
+ data.tar.gz: 4c07d12825440f1776b3b6e35cc8b63421889010458a15d26a4ac75d90f9b821f30e2b765a5d74a6b810c7c1be3fe0e13b4edcc4d08d48f2ff98916caf4f0b7f
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2011-2013 Dan Sosedoff.
2
+
3
+ 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:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ 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.
data/README.md CHANGED
@@ -1,20 +1,16 @@
1
1
  # TerminalHelpers
2
2
 
3
- This is a collection of helper method for your console-based applications.
4
-
5
- It does not have any gem dependencies and could be easily plugged-in into your existing code.
6
-
7
- Was inspired by ```heroku``` CLI app.
3
+ Collection of helper methods for terminal applications. Zero dependencies.
8
4
 
9
5
  ## Installation
10
6
 
11
- You can install it using rubygems:
7
+ Install from rubygems:
12
8
 
13
9
  ```
14
10
  gem install terminal_helpers
15
11
  ```
16
12
 
17
- Or build it:
13
+ Build locally:
18
14
 
19
15
  ```
20
16
  rake install
@@ -86,10 +82,4 @@ echo_off
86
82
 
87
83
  ## License
88
84
 
89
- Copyright © 2011 Dan Sosedoff.
90
-
91
- 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:
92
-
93
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
94
-
95
- 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.
85
+ See LICENSE file for details
data/Rakefile CHANGED
@@ -1,21 +1,10 @@
1
- task :install do
2
- gem_name = "terminal_helpers"
3
-
4
- require 'fileutils'
5
- require File.expand_path("../lib/#{gem_name}/version", __FILE__)
6
-
7
- gem_file = "#{gem_name}-#{TerminalHelpers::VERSION}.gem"
8
-
9
- if File.exists?(gem_file)
10
- FileUtils.rm_f(gem_file)
11
- end
12
-
13
- puts "-> Uninstalling..."
14
- puts `gem uninstall -x #{gem_name} --version=#{TerminalHelpers::VERSION}`
15
-
16
- puts "-> Building..."
17
- puts `gem build #{gem_name}.gemspec`
18
-
19
- puts "-> Installing..."
20
- puts `gem install #{gem_file}`
21
- end
1
+ require 'bundler'
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:test) do |t|
6
+ t.pattern = 'spec/*_spec.rb'
7
+ t.verbose = false
8
+ end
9
+
10
+ task :default => :test
@@ -1,12 +1,14 @@
1
1
  module Colors
2
- def red; colorize(self, "\e[1m\e[31m"); end
3
- def green; colorize(self, "\e[1m\e[32m"); end
4
- def dark_green; colorize(self, "\e[32m"); end
5
- def yellow; colorize(self, "\e[1m\e[33m"); end
6
- def blue; colorize(self, "\e[1m\e[34m"); end
7
- def dark_blue; colorize(self, "\e[34m"); end
8
- def purple; colorize(self, "\e[1m\e[35m"); end
9
- def magenta; colorize(self, "\e[1m\e[36m"); end
2
+ COLORS = [:red, :green, :dark_green, :yellow, :blue, :dark_blue, :purple, :magenta]
3
+
4
+ def red ; colorize(self, "\e[1m\e[31m") ; end
5
+ def green ; colorize(self, "\e[1m\e[32m") ; end
6
+ def dark_green ; colorize(self, "\e[32m") ; end
7
+ def yellow ; colorize(self, "\e[1m\e[33m") ; end
8
+ def blue ; colorize(self, "\e[1m\e[34m") ; end
9
+ def dark_blue ; colorize(self, "\e[34m") ; end
10
+ def purple ; colorize(self, "\e[1m\e[35m") ; end
11
+ def magenta ; colorize(self, "\e[1m\e[36m") ; end
10
12
 
11
13
  def colorize(text, color_code)
12
14
  "#{color_code}#{text}\e[0m"
@@ -19,7 +19,7 @@ module TerminalHelpers
19
19
  echo_off if options[:echo] == false
20
20
 
21
21
  print(title_str)
22
- result = gets.strip
22
+ result = STDIN.gets.strip
23
23
  result = options[:default] if result.empty? && options.key?(:default)
24
24
  #result = result.scan(/[a-z\d\_\-]{1,}/i) if options.key?(:array)
25
25
 
@@ -67,7 +67,7 @@ module TerminalHelpers
67
67
  #
68
68
  def prompt(prefix='> ')
69
69
  print("#{prefix}")
70
- gets.strip
70
+ STDIN.gets.strip
71
71
  end
72
72
 
73
73
  # Print an information message
@@ -1,3 +1,3 @@
1
1
  module TerminalHelpers
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -3,8 +3,8 @@ require File.expand_path('../lib/terminal_helpers/version', __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "terminal_helpers"
5
5
  s.version = TerminalHelpers::VERSION.dup
6
- s.summary = "Various helpers for console-based applications"
7
- s.description = "Various helpers for console-based applications"
6
+ s.summary = "Collection of helper methods for terminal applications"
7
+ s.description = "Collection of helper methods for terminal applications"
8
8
  s.homepage = "http://github.com/sosedoff/terminal_helpers"
9
9
  s.authors = ["Dan Sosedoff"]
10
10
  s.email = ["dan.sosedoff@gmail.com"]
metadata CHANGED
@@ -1,24 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dan Sosedoff
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-12-05 00:00:00.000000000Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: Various helpers for console-based applications
13
+ description: Collection of helper methods for terminal applications
15
14
  email:
16
15
  - dan.sosedoff@gmail.com
17
16
  executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
21
- - .gitignore
20
+ - ".gitignore"
21
+ - Gemfile
22
+ - LICENSE
22
23
  - README.md
23
24
  - Rakefile
24
25
  - lib/terminal_helpers.rb
@@ -30,26 +31,26 @@ files:
30
31
  - terminal_helpers.gemspec
31
32
  homepage: http://github.com/sosedoff/terminal_helpers
32
33
  licenses: []
34
+ metadata: {}
33
35
  post_install_message:
34
36
  rdoc_options: []
35
37
  require_paths:
36
38
  - lib
37
39
  required_ruby_version: !ruby/object:Gem::Requirement
38
- none: false
39
40
  requirements:
40
- - - ! '>='
41
+ - - ">="
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
44
  required_rubygems_version: !ruby/object:Gem::Requirement
44
- none: false
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  requirements: []
50
50
  rubyforge_project:
51
- rubygems_version: 1.8.10
51
+ rubygems_version: 2.4.3
52
52
  signing_key:
53
- specification_version: 3
54
- summary: Various helpers for console-based applications
53
+ specification_version: 4
54
+ summary: Collection of helper methods for terminal applications
55
55
  test_files: []
56
+ has_rdoc: