cle 0.0.1

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: 62adf89158b1b0fa9f8d95dee611d64bef1a8cf9
4
+ data.tar.gz: 7960ab91ffdd035d251fe8cf6e6281fa44aad229
5
+ SHA512:
6
+ metadata.gz: ba65f5e1695b3e46bbd6ceda009e678873dc772ce8f6240efdcdd87da3e4c949eff4a3665a2f7e1360a814aa72f0ff7c3d1a8e5a5197842c71bc624fa755a974
7
+ data.tar.gz: 6e87ab5d8c4ab2180fbaffbf53ba8832a56ef0d65df4a82eca81c2ae9a2b29bdcfcb746bc96da9c73333cf121101c7af1c2002e93abd63c03a562890ec113668
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = tab
5
+ indent_size = 4
6
+ charset = utf-8
7
+ insert_final_newline = true
8
+ trim_trailing_whitespace = true
9
+
10
+ [*.md]
11
+ trim_trailing_whitespace = false
12
+
13
+ [{*.{coffee,cson,yml,yaml,jade,pug,rb,gemspec},Rakefile,{package,bower}.json}]
14
+ indent_style = space
15
+ indent_size = 2
@@ -0,0 +1,92 @@
1
+
2
+ # Created by https://www.gitignore.io/api/ruby,linux,windows
3
+
4
+ ### Linux ###
5
+ *~
6
+
7
+ # temporary files which can be created if a process still has a handle open of a deleted file
8
+ .fuse_hidden*
9
+
10
+ # KDE directory preferences
11
+ .directory
12
+
13
+ # Linux trash folder which might appear on any partition or disk
14
+ .Trash-*
15
+
16
+ # .nfs files are created when an open file is removed but is still being accessed
17
+ .nfs*
18
+
19
+ ### Ruby ###
20
+ *.gem
21
+ *.rbc
22
+ /.config
23
+ /coverage/
24
+ /InstalledFiles
25
+ /pkg/
26
+ /spec/reports/
27
+ /spec/examples.txt
28
+ /test/tmp/
29
+ /test/version_tmp/
30
+ /tmp/
31
+
32
+ # Used by dotenv library to load environment variables.
33
+ # .env
34
+
35
+ ## Specific to RubyMotion:
36
+ .dat*
37
+ .repl_history
38
+ build/
39
+ *.bridgesupport
40
+ build-iPhoneOS/
41
+ build-iPhoneSimulator/
42
+
43
+ ## Specific to RubyMotion (use of CocoaPods):
44
+ #
45
+ # We recommend against adding the Pods directory to your .gitignore. However
46
+ # you should judge for yourself, the pros and cons are mentioned at:
47
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
48
+ #
49
+ # vendor/Pods/
50
+
51
+ ## Documentation cache and generated files:
52
+ /.yardoc/
53
+ /_yardoc/
54
+ /doc/
55
+ /rdoc/
56
+
57
+ ## Environment normalization:
58
+ /.bundle/
59
+ /vendor/bundle
60
+ /lib/bundler/man/
61
+
62
+ # for a library or gem, you might want to ignore these files since the code is
63
+ # intended to run in multiple environments; otherwise, check them in:
64
+ Gemfile.lock
65
+ .ruby-version
66
+ .ruby-gemset
67
+
68
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
69
+ .rvmrc
70
+
71
+ ### Windows ###
72
+ # Windows thumbnail cache files
73
+ Thumbs.db
74
+ ehthumbs.db
75
+ ehthumbs_vista.db
76
+
77
+ # Folder config file
78
+ Desktop.ini
79
+
80
+ # Recycle Bin used on file shares
81
+ $RECYCLE.BIN/
82
+
83
+ # Windows Installer files
84
+ *.cab
85
+ *.msi
86
+ *.msm
87
+ *.msp
88
+
89
+ # Windows shortcuts
90
+ *.lnk
91
+
92
+ # End of https://www.gitignore.io/api/ruby,linux,windows
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require spec_helper
3
+ -f d
@@ -0,0 +1,4 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Style/FrozenStringLiteralComment:
4
+ Enabled: false
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3
4
+ - 2.4
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
@@ -0,0 +1,21 @@
1
+ # cle
2
+ [![Gem](https://img.shields.io/gem/v/cle.svg?style=flat-square)](https://rubygems.org/gems/cle)
3
+ [![Gem](https://img.shields.io/gem/dv/cle/stable.svg?style=flat-square)](https://rubygems.org/gems/cle)
4
+ [![Travis](https://img.shields.io/travis/gluons/cle.svg?style=flat-square)](https://travis-ci.org/gluons/cle)
5
+
6
+ A simple CLI tool to completely clear terminal screen.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ gem install cle
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ Completely clear terminal screen.
18
+
19
+ Usage: cle
20
+ -h, --help Display help.
21
+ ```
@@ -0,0 +1,8 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec) do |t|
4
+ t.verbose = false
5
+ end
6
+
7
+ desc 'Run test'
8
+ task default: :spec
data/bin/cle ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'cle'
4
+
5
+ Cle::CLI.run(ARGV)
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
5
+
6
+ require 'cle/version'
7
+
8
+ Gem::Specification.new do |s|
9
+ s.name = 'cle'
10
+ s.version = Cle::VERSION
11
+ s.summary = 'Clear terminal screen completely.'
12
+ s.description = 'A simple cli to completely clear terminal screen.'
13
+ s.authors = ['Saran Tanpituckpong']
14
+ s.email = ['sarunta@gmail.com']
15
+ s.files = `git ls-files -z`.split("\x0")
16
+ s.executables = ['cle']
17
+ s.license = 'Unlicense'
18
+ s.homepage = 'https://github.com/gluons/cle'
19
+ s.metadata = {
20
+ 'issue_tracker' => 'https://github.com/gluons/cle/issues'
21
+ }
22
+ s.required_ruby_version = '>=2.3.0'
23
+
24
+ s.add_development_dependency 'aruba', '~> 0.14.2'
25
+ s.add_development_dependency 'rake', '~> 12.0'
26
+ s.add_development_dependency 'rspec', '~> 3.6'
27
+ s.add_development_dependency 'rubocop', '~> 0.49.1'
28
+ end
@@ -0,0 +1,14 @@
1
+ ##
2
+ # = Cle module
3
+ module Cle
4
+ autoload :CLI, 'cle/cli'
5
+ autoload :VERSION, 'cle/version'
6
+
7
+ ##
8
+ # Clear terminal screen completely
9
+ #
10
+ # Taken from {sindresorhus/ansi-escapes}[https://github.com/sindresorhus/ansi-escapes]
11
+ def self.clear
12
+ print "\u001Bc"
13
+ end
14
+ end
@@ -0,0 +1,35 @@
1
+ require 'optparse'
2
+
3
+ module Cle
4
+ ##
5
+ # == Command line interface class
6
+ class CLI
7
+ ##
8
+ # Run CLI.
9
+ def self.run(arguments)
10
+ CLI.parse(arguments)
11
+
12
+ Cle.clear
13
+ end
14
+
15
+ ##
16
+ # Parse CLI arguments.
17
+ def self.parse(arguments) # rubocop:disable Metrics/MethodLength
18
+ OptionParser.new do |opts|
19
+ opts.banner = <<~BANNER
20
+ Completely clear terminal screen.
21
+
22
+ Usage: cle
23
+ BANNER
24
+
25
+ opts.version = Cle::VERSION
26
+ opts.on('-h', '--help', 'Display help.') do
27
+ puts opts
28
+ exit
29
+ end
30
+
31
+ opts.parse(arguments)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module Cle
2
+ VERSION = '0.0.1'.freeze
3
+ end
@@ -0,0 +1,14 @@
1
+ require 'cle'
2
+
3
+ RSpec.describe Cle::CLI, type: :aruba do
4
+ before(:each) do
5
+ run 'cle'
6
+ end
7
+
8
+ it "Run 'cle' command without error" do
9
+ expect(last_command_started).to be_successfully_executed
10
+ end
11
+ it 'Print the clear screen character' do
12
+ expect(last_command_started).to have_output "\u001Bc"
13
+ end
14
+ end
@@ -0,0 +1 @@
1
+ require 'aruba/rspec'
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cle
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Saran Tanpituckpong
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aruba
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.14.2
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.14.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.49.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.49.1
69
+ description: A simple cli to completely clear terminal screen.
70
+ email:
71
+ - sarunta@gmail.com
72
+ executables:
73
+ - cle
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".editorconfig"
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".rubocop.yml"
81
+ - ".travis.yml"
82
+ - Gemfile
83
+ - LICENSE
84
+ - README.md
85
+ - Rakefile
86
+ - bin/cle
87
+ - cle.gemspec
88
+ - lib/cle.rb
89
+ - lib/cle/cli.rb
90
+ - lib/cle/version.rb
91
+ - spec/cli_spec.rb
92
+ - spec/spec_helper.rb
93
+ homepage: https://github.com/gluons/cle
94
+ licenses:
95
+ - Unlicense
96
+ metadata:
97
+ issue_tracker: https://github.com/gluons/cle/issues
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 2.3.0
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.6.13
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Clear terminal screen completely.
118
+ test_files: []