sawaal 1.0.0 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +23 -9
- data/lib/sawaal.rb +7 -1
- data/lib/sawaal/cursor.rb +0 -3
- data/lib/sawaal/selector.rb +0 -5
- data/lib/sawaal/version.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- data/spec/version_spec.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e978a9b6e143d26214406463c01e71a451e7a68
|
|
4
|
+
data.tar.gz: 71902ca54956076caad312c058a26417018f8b50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52ac2030ccee6a5e821e23178ed0e713d2574c59c73e32ac25a424a89aabd260c761478d2855e7cfefdb4fb67e38b9c1feb7172127488b0075a434a40e984e64
|
|
7
|
+
data.tar.gz: 22a8352be84bc657308306c2be8c7443c7231c8ca20f4f5ff33247410ae10cda5c3f25e33d61dd8eda959787f9ce392714524583166ffbbd44fa9aadb79550f7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
[](https://travis-ci.org/anshulverma/sawaal)
|
|
4
4
|
[](https://codeclimate.com/github/anshulverma/sawaal)
|
|
5
5
|
[](https://codeclimate.com/github/anshulverma/sawaal)
|
|
6
|
-
[](https://gemnasium.com/anshulverma/sawaal)
|
|
7
6
|
[](http://inch-ci.org/github/anshulverma/sawaal)
|
|
8
7
|
[](https://rubygems.org/gems/sawaal)
|
|
9
8
|
|
|
@@ -11,16 +10,35 @@
|
|
|
11
10
|
**Table of Contents**
|
|
12
11
|
|
|
13
12
|
- [sawaal](#sawaal)
|
|
14
|
-
- [
|
|
13
|
+
- [Quickstart](#quickstart)
|
|
15
14
|
- [Installation](#installation)
|
|
16
|
-
- [Usage](#usage)
|
|
17
15
|
- [Contributing](#contributing)
|
|
18
16
|
|
|
19
17
|
<!-- markdown-toc end -->
|
|
20
18
|
|
|
21
|
-
#
|
|
19
|
+
# Quickstart
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
Here is an example usage of this gem. This should be enough to get
|
|
22
|
+
started with `sawaal`.
|
|
23
|
+
|
|
24
|
+
``` ruby
|
|
25
|
+
require 'sawaal'
|
|
26
|
+
|
|
27
|
+
selected = Sawaal::Selector.choose(
|
|
28
|
+
'which key is the best?', {
|
|
29
|
+
:key1 => 'key1 is the best',
|
|
30
|
+
:key2 => 'key2 is the best for sure',
|
|
31
|
+
:key3 => 'key3 might be the one',
|
|
32
|
+
:key4 => 'key4 is surely the best',
|
|
33
|
+
:key5 => 'key5'
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
puts selected
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The only thing to remember is that in the choose call, you can use
|
|
40
|
+
either a hash of options or an array. If you used an array, the return
|
|
41
|
+
selected value will be the 0-based index of the selected item.
|
|
24
42
|
|
|
25
43
|
## Installation
|
|
26
44
|
|
|
@@ -38,10 +56,6 @@ Or install it yourself as:
|
|
|
38
56
|
|
|
39
57
|
$ gem install sawaal
|
|
40
58
|
|
|
41
|
-
## Usage
|
|
42
|
-
|
|
43
|
-
TODO: Write usage instructions here
|
|
44
|
-
|
|
45
59
|
## Contributing
|
|
46
60
|
|
|
47
61
|
1. Fork it ( https://github.com/[my-github-username]/sawaal/fork )
|
data/lib/sawaal.rb
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
require '
|
|
3
|
+
require 'io/console'
|
|
4
|
+
|
|
5
|
+
require 'sawaal/color'
|
|
6
|
+
require 'sawaal/cursor'
|
|
7
|
+
require 'sawaal/selections'
|
|
4
8
|
require 'sawaal/selector'
|
|
9
|
+
require 'sawaal/tty'
|
|
10
|
+
require 'sawaal/version'
|
|
5
11
|
|
|
6
12
|
# Helps a command line application by allowing it to ask
|
|
7
13
|
# multiple choice questions
|
data/lib/sawaal/cursor.rb
CHANGED
data/lib/sawaal/selector.rb
CHANGED
data/lib/sawaal/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/version_spec.rb
CHANGED
metadata
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sawaal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anshul Verma
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-07-
|
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '1.6'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ~>
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.6'
|
|
27
27
|
description: |2
|
|
@@ -61,17 +61,17 @@ require_paths:
|
|
|
61
61
|
- lib
|
|
62
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
63
|
requirements:
|
|
64
|
-
- -
|
|
64
|
+
- - '>='
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
66
|
version: 1.9.3
|
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements:
|
|
69
|
-
- -
|
|
69
|
+
- - '>='
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
71
|
version: 1.3.6
|
|
72
72
|
requirements: []
|
|
73
73
|
rubyforge_project:
|
|
74
|
-
rubygems_version: 2.
|
|
74
|
+
rubygems_version: 2.4.6
|
|
75
75
|
signing_key:
|
|
76
76
|
specification_version: 4
|
|
77
77
|
summary: Helper gem for asking questions on terminal
|