pastel-cli 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 501b467f33dd826b032142b327fa0ca8b558380d
4
- data.tar.gz: cec310379eb8b8dce650f28604df1486a2a8fea1
3
+ metadata.gz: 4e967a73d4b4239fcc3a89d9d96ca72fa57a3162
4
+ data.tar.gz: a94b8ddf623418430a14a47f6c20a6f6277daa85
5
5
  SHA512:
6
- metadata.gz: 481c39118c50c710910b2fa3c50f0184d8b5f18cac7f705556cad902bf72e8e6492060d3aac1d82355a12a5646b8a82d1a1f402f0307cf0f08463fa8f4631bfa
7
- data.tar.gz: 512b5e7be87598d76cf642c2a5d9f2ae0b663cba46cff99a510b32cfe36593b4156be940194a0e5a84cab69bc6ac7b310de5745000d44825149ff15718de7c74
6
+ metadata.gz: dc3650c54b2bb1721292aeada353aff4756bfdc14eff43a9e2d5d9302a4c3d9b71ca4e3efbc91eeb70c23b2807c090be4493ebc44bf624f5b9cc24439e76928c
7
+ data.tar.gz: ce7a3900f50ee239850a1b355a5784de7789517dd06ee8ff053293cd9b51e6ede367b6c8744596ae8fb7f18c2e37c8027f684336ea7bfcb9b05b08b27ebadcdf
data/.codeclimate.yml ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ engines:
3
+ fixme:
4
+ enabled: true
5
+ ratings:
6
+ paths:
7
+ - bin/*
8
+ exclude_paths:
9
+ - spec/
10
+ - tasks/
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.2.0] - 2016-03-05
4
+
5
+ ### Added
6
+ * Add --help/-h flags
7
+
3
8
  ## [v0.1.0] - 2016-01-15
4
9
 
5
10
  Initial release
6
11
 
12
+ [v0.2.0]: https://github.com/peter-murach/pastel-cli/compare/v0.1.0...v0.2.0
7
13
  [v0.1.0]: https://github.com/peter-murach/pastel-cli/compare/v0.1.0
data/Gemfile CHANGED
@@ -2,11 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- group :development do
6
- gem 'rspec', '~> 3.4.0'
7
- end
8
-
9
- group :metrics do
10
- gem 'coveralls', '~> 0.8.9'
11
- gem 'simplecov', '~> 0.10.0'
5
+ group :test do
6
+ gem 'rspec', '~> 3.4.0'
7
+ gem 'simplecov', '~> 0.11.2'
8
+ gem 'codeclimate-test-reporter', '~> 0.4.8'
12
9
  end
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # Pastel CLI
2
2
  [![Gem Version](https://badge.fury.io/rb/pastel-cli.svg)][gem]
3
3
  [![Build Status](https://secure.travis-ci.org/peter-murach/pastel-cli.svg?branch=master)][travis]
4
+ [![Code Climate](https://codeclimate.com/github/peter-murach/pastel-cli/badges/gpa.svg)][codeclimate]
5
+ [![Coverage Status](https://codeclimate.com/github/peter-murach/pastel-cli/badges/coverage.svg)][codeclimate]
4
6
 
5
7
  [gem]: http://badge.fury.io/rb/pastel-cli
6
8
  [travis]: http://travis-ci.org/peter-murach/pastel-cli
9
+ [codeclimate]: https://codeclimate.com/github/peter-murach/pastel-cli
7
10
 
8
11
  > CLI tool for intuitive terminal output styling
9
12
 
data/bin/pastel CHANGED
@@ -50,7 +50,7 @@ SEE ALSO
50
50
  EOS
51
51
  opts = {}
52
52
 
53
- if ARGV.empty?
53
+ if ARGV.empty? || ARGV.any? { |a| %w(--help -h).include?(a) }
54
54
  puts help
55
55
  exit
56
56
  elsif !(index = ARGV.index('--enabled')).nil?
data/pastel-cli.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'pastel-cli'
5
- spec.version = '0.1.0'
5
+ spec.version = '0.2.0'
6
6
  spec.authors = ['Piotr Murach']
7
7
  spec.email = ['']
8
8
  spec.summary = %q{CLI tool for intuitive terminal output styling}
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,14 @@
1
1
  # encoding: utf-8
2
2
 
3
+ $:.unshift File.expand_path("../../bin", __FILE__)
4
+
3
5
  if RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])
4
6
  require 'simplecov'
5
- require 'coveralls'
7
+ require 'codeclimate-test-reporter'
6
8
 
7
9
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
8
10
  SimpleCov::Formatter::HTMLFormatter,
9
- Coveralls::SimpleCov::Formatter
11
+ CodeClimate::TestReporter::Formatter
10
12
  ]
11
13
 
12
14
  SimpleCov.start do
@@ -3,37 +3,42 @@
3
3
  RSpec.describe 'pastel command' do
4
4
 
5
5
  it 'runs without arguments and shows help' do
6
- expect(`pastel`).to match(/PASTEL\(1\)/)
6
+ expect(`bin/pastel`).to match(/PASTEL\(1\)/)
7
+ expect($?.exitstatus).to eq(0)
8
+ end
9
+
10
+ it "runs with --help/-h flags" do
11
+ expect(`bin/pastel`).to match(/PASTEL\(1\)/)
7
12
  expect($?.exitstatus).to eq(0)
8
13
  end
9
14
 
10
15
  it 'runs with text only' do
11
- expect(`pastel foo`).to match(/foo/)
16
+ expect(`bin/pastel foo`).to match(/foo/)
12
17
  expect($?.exitstatus).to eq(0)
13
18
  end
14
19
 
15
20
  it 'runs with foreground option' do
16
- expect(`pastel green foo`).to match(/\e\[32mfoo\e\[0m/)
21
+ expect(`bin/pastel green foo`).to match(/\e\[32mfoo\e\[0m/)
17
22
  expect($?.exitstatus).to eq(0)
18
23
  end
19
24
 
20
25
  it "runs with foreground & background options" do
21
- expect(`pastel green on_red foo`).to match(/\e\[32;41mfoo\e\[0m/)
26
+ expect(`bin/pastel green on_red foo`).to match(/\e\[32;41mfoo\e\[0m/)
22
27
  expect($?.exitstatus).to eq(0)
23
28
  end
24
29
 
25
30
  it "runs with foreground & background & style options" do
26
- expect(`pastel green on_red bold foo`).to match(/\e\[32;41;1mfoo\e\[0m/)
31
+ expect(`bin/pastel green on_red bold foo`).to match(/\e\[32;41;1mfoo\e\[0m/)
27
32
  expect($?.exitstatus).to eq(0)
28
33
  end
29
34
 
30
35
  it "runs with piped input" do
31
- expect(`echo foo | pastel green`).to match(/\e\[32mfoo\e\[0m/)
36
+ expect(`echo foo | bin/pastel green`).to match(/\e\[32mfoo\e\[0m/)
32
37
  expect($?.exitstatus).to eq(0)
33
38
  end
34
39
 
35
40
  it "runs with --enabled option" do
36
- expect(`pastel --enabled green foo`).to match(/\e\[32mfoo\e\[0m/)
41
+ expect(`bin/pastel --enabled green foo`).to match(/\e\[32mfoo\e\[0m/)
37
42
  expect($?.exitstatus).to eq(0)
38
43
  end
39
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pastel-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel
@@ -66,6 +66,7 @@ executables:
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
+ - .codeclimate.yml
69
70
  - .gitignore
70
71
  - .rspec
71
72
  - .ruby-version