cli_miami 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b637c3d16bf3a87fed9823000666decbdb874390
4
- data.tar.gz: b4eb682f983cf93a600a5d67bb619d79b9020d21
3
+ metadata.gz: faa50511e25723fc7ca8fbdec47e34dfc7dda118
4
+ data.tar.gz: a44662dc8d2a3f75d4734bd14f1cc0de6367cc0a
5
5
  SHA512:
6
- metadata.gz: b6ee682fead793ce3a8f29d5f6d91160cd8c408786c3be7b4848da9bd42d3919302ecc7c10c0961133e7f9faec54fd4bdccc41d64295c2e35a5d6f0d2cf8e336
7
- data.tar.gz: cbd87e672d63ec1b135bfc007ad4f7e15a8ef273b567695c795f448a16f0b2a69b092fda5c32dd61372745a8be01587362612b62a751aa5b925e04281f70a691
6
+ metadata.gz: 4dd5ea9264adc62e6ae4eb032ef37697ae2d5b79cd6aa3a48aee881dc77a53c660f85eb4f2fc3c2a01ea1e39a05e738ffd044b102954ed3499db806a902b1edb
7
+ data.tar.gz: f50b149cef566a8611d6c44b277385cc9fa234bff335309f4952f00f5f3b9dae7caa0966fab2519117aaacf1fd2b13bb761f4232082a59acd1d56ce9dd8fd35a
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ coverage
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  gem 'term-ansicolor', '~> 1.3'
4
4
 
5
5
  group :test do
6
+ gem 'coveralls', :require => false
6
7
  gem 'guard', '~> 2.6'
7
8
  gem 'guard-rspec', '~> 4.3', :require => false
8
9
  gem 'rspec', '~> 3.1'
data/Gemfile.lock CHANGED
@@ -4,7 +4,14 @@ GEM
4
4
  celluloid (0.16.0)
5
5
  timers (~> 4.0.0)
6
6
  coderay (1.1.0)
7
+ coveralls (0.7.1)
8
+ multi_json (~> 1.3)
9
+ rest-client
10
+ simplecov (>= 0.7)
11
+ term-ansicolor
12
+ thor
7
13
  diff-lcs (1.2.5)
14
+ docile (1.1.5)
8
15
  ffi (1.9.6)
9
16
  formatador (0.2.5)
10
17
  guard (2.10.5)
@@ -26,7 +33,10 @@ GEM
26
33
  rb-inotify (>= 0.9)
27
34
  lumberjack (1.0.9)
28
35
  method_source (0.8.2)
36
+ mime-types (2.4.3)
37
+ multi_json (1.10.1)
29
38
  nenv (0.1.1)
39
+ netrc (0.10.2)
30
40
  pry (0.10.1)
31
41
  coderay (~> 1.1.0)
32
42
  method_source (~> 0.8.1)
@@ -34,6 +44,9 @@ GEM
34
44
  rb-fsevent (0.9.4)
35
45
  rb-inotify (0.9.5)
36
46
  ffi (>= 0.5.0)
47
+ rest-client (1.7.2)
48
+ mime-types (>= 1.16, < 3.0)
49
+ netrc (~> 0.7)
37
50
  rspec (3.1.0)
38
51
  rspec-core (~> 3.1.0)
39
52
  rspec-expectations (~> 3.1.0)
@@ -46,6 +59,11 @@ GEM
46
59
  rspec-mocks (3.1.3)
47
60
  rspec-support (~> 3.1.0)
48
61
  rspec-support (3.1.2)
62
+ simplecov (0.9.1)
63
+ docile (~> 1.1.0)
64
+ multi_json (~> 1.0)
65
+ simplecov-html (~> 0.8.0)
66
+ simplecov-html (0.8.0)
49
67
  slop (3.6.0)
50
68
  term-ansicolor (1.3.0)
51
69
  tins (~> 1.0)
@@ -59,6 +77,7 @@ PLATFORMS
59
77
  ruby
60
78
 
61
79
  DEPENDENCIES
80
+ coveralls
62
81
  guard (~> 2.6)
63
82
  guard-rspec (~> 4.3)
64
83
  rspec (~> 3.1)
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/cli_miami.svg)](http://badge.fury.io/rb/cli_miami)
2
2
  [![Build Status](https://travis-ci.org/brewster1134/CLI-Miami.svg)](https://travis-ci.org/brewster1134/CLI-Miami)
3
+ [![Coverage Status](https://coveralls.io/repos/brewster1134/CLI-Miami/badge.png)](https://coveralls.io/r/brewster1134/CLI-Miami)
3
4
 
4
5
  # CLI Miami
5
6
  A feature rich alternative for `gets` and `puts` for your cli interface
@@ -25,6 +26,19 @@ _* see supported options below_
25
26
  S.ay 'Hello World', :color => :red
26
27
  ```
27
28
 
29
+ Sometimes you want to have multiple styles on a single line. There are 2 ways to do this.
30
+
31
+ The multi-line way using `:newline => false`
32
+ ```ruby
33
+ S.ay 'Hello ', :color => :red, :newline => false
34
+ S.ay 'World', :color => :blue
35
+ ```
36
+
37
+ Or on a single line using ANSI codes as methods. *All the ANSI color and style codes listed below can be used*
38
+ ```ruby
39
+ S.ay "#{'Hello'.red} #{'World'.blue}"
40
+ ```
41
+
28
42
  #### A.sk
29
43
  `A.sk` accepts the same arguments as `S.say`, with additional support for a block that passes the users response
30
44
 
@@ -37,8 +51,6 @@ end
37
51
  #### Options
38
52
  Both `S.ay` and `A.sk` suport the same options
39
53
 
40
- https://github.com/flori/term-ansicolor/tree/master/lib/term/ansicolor/attribute
41
-
42
54
  ```ruby
43
55
  color: => [symbol] # See ansi color codes below
44
56
  bgcolor: => [symbol] # See ansi color codes below
data/lib/cli_miami/ask.rb CHANGED
@@ -13,7 +13,7 @@ class CliMiami::A
13
13
  def self.sk question, options = {}, &block
14
14
  # set default options
15
15
  @options = {
16
- :readline => false,
16
+ :readline => false
17
17
  }
18
18
 
19
19
  # merge preset options
@@ -37,7 +37,12 @@ class CliMiami::A
37
37
  $stdin.gets
38
38
  end.rstrip
39
39
 
40
- yield output if block
40
+ # return response if no block is passed
41
+ if block
42
+ yield output
43
+ else
44
+ return output
45
+ end
41
46
  end
42
47
 
43
48
  private
data/lib/namespaced.rb CHANGED
@@ -7,16 +7,13 @@ class CliMiami
7
7
  # default presets
8
8
  @@presets = {
9
9
  :fail => {
10
- :color => :red,
11
- :style => :bold
10
+ :color => :red
12
11
  },
13
12
  :warn => {
14
- :color => :yellow,
15
- :style => :bold
13
+ :color => :yellow
16
14
  },
17
15
  :success => {
18
- :color => :green,
19
- :style => :bold
16
+ :color => :green
20
17
  }
21
18
  }
22
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cli_miami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Brewster
@@ -118,9 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.5
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: A feature rich alternative for `gets` and `puts` for your cli interface
125
125
  test_files: []
126
- has_rdoc: