grepg 0.0.4 → 0.0.5

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: e5768dab30082e58dce3e5b49cdb76a29b8fa9da
4
- data.tar.gz: ddf1a091efc9ad7eee32d37e3d65ef40696b1127
3
+ metadata.gz: cee82c12d92813e766763700c3fea73eb1d20f3a
4
+ data.tar.gz: bc0ed894ffecec938bebf35369bdfc97438e2195
5
5
  SHA512:
6
- metadata.gz: f2bfe0fa4f80d0c1a6baa4cbd25d2bdc5bff1e5c59f1effaeda4a38bb4a1e8818e642192d13bd15f4d09ea1d3a7f00c0171a3908ee5e858602e993b1e7ca3135
7
- data.tar.gz: 73da667814bd9860af347e465933ed7eacc04d376690d832cee8595097c354b529036e0bd2d3486c8cd841e18d6247637d15cdb93ab54c9851267dd778eb69c6
6
+ metadata.gz: 82fe6a2c37ebcf1e40ec3d3543d0e36aa7534e070900042eb19aef525af5ddeedeb90f61d45f0ef89ff25e4a87d1a5ef32d8e3d4f884d9bcbf9391a8b43cf3f4
7
+ data.tar.gz: 227627ba0b54bb55b037df46a2e9e86328b70e2d01a3aa45cbff76f3809cbf7fa09c9761c34472522c8369c02690eb0009c3c161416d6609fb732ab7d856b151
data/README.md CHANGED
@@ -3,15 +3,23 @@ grepg
3
3
 
4
4
  `grepg` (pronounced Grep G) is a ruby client for [GrepPage](https://www.greppage.com). It allows you to access your cheat sheets without leaving the terminal.
5
5
 
6
+ ![grepg screenshot](https://github.com/evidanary/grepg/raw/master/img/screenshot.png)
7
+
6
8
  #Installation
7
- To install `grepg` run
9
+ To install `grepg` run
8
10
 
9
11
  ```
10
12
  gem install grepg
11
13
  ```
12
14
 
15
+ #Requirements
16
+ - ruby (tested on 2.1.2)
17
+
18
+
13
19
  #Usage
14
20
 
21
+ Enter user and topic name followed by an optional search string.
22
+
15
23
  ```
16
24
  $ grepg --help
17
25
  Usage:
@@ -21,7 +29,7 @@ Options:
21
29
  -u, --user=<s> username
22
30
  -t, --topic=<s> topic
23
31
  -s, --search=<s> text to search
24
- -c, --colorize, --no-colorize colorize output (default: true)
32
+ -c, --colorize colorize output (default: true)
25
33
  -v, --version Print version and exit
26
34
  -h, --help Show this message
27
35
 
@@ -56,15 +64,10 @@ $ grepg -u kdavis -t git -s stash
56
64
  User: kdavis, Topic: git, Search-Term: stash
57
65
  TO apply your changes
58
66
  git stash --apply
59
-
60
- To list the stash
61
- git stash list
62
-
63
- Git stash
64
- git stash
67
+ ...
65
68
  ```
66
69
 
67
- #Defaults File
70
+ #Configuration
68
71
  Setup defaults in `~/.grepg.yml`
69
72
 
70
73
  ```
@@ -72,7 +75,7 @@ user: evidanary
72
75
  colorize: true
73
76
  ```
74
77
 
75
- Now, you can access client with
78
+ Now, you can do
76
79
 
77
80
  ```
78
81
  $ grepg -t bootstrap
@@ -80,8 +83,8 @@ User: evidanary, Topic: bootstrap
80
83
  ...
81
84
  ```
82
85
 
83
- ##Development
86
+ #Development
84
87
  To execute tests run ```bundle exec rake spec```. To install the gem locally, first build it using ```bundle exec rake build```. Then install the gem ```gem install pkg/grepg-0.0.1.gem```
85
88
 
86
- ##License
89
+ #License
87
90
  grepg is under the [MIT License](http://www.opensource.org/licenses/MIT).
Binary file
data/lib/grepg/parser.rb CHANGED
@@ -47,7 +47,12 @@ Defaults:
47
47
  end
48
48
 
49
49
  @opts = Trollop::with_standard_exception_handling parser do
50
- parser.parse args
50
+ opts = parser.parse args
51
+ # User is a required field, manually handling validation because
52
+ # we fallback on defaults from the file
53
+ raise Trollop::CommandlineError,
54
+ "Missing --user parameter. e.g. --user evidanary" unless opts[:user]
55
+ opts
51
56
  end
52
57
 
53
58
  @user = @opts[:user]
data/lib/grepg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GrepPage
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -34,6 +34,17 @@ describe GrepPage::Parser do
34
34
  parser = GrepPage::Parser.new('-t css'.split(' '))
35
35
  expect(parser.instance_variable_get(:@opts)[:user]).to eq('kdavis')
36
36
  end
37
+
38
+ # Test if we get an error when no user is specified. We should tell the user
39
+ # a sample username they can use if they want to try the client out without
40
+ # creating an account
41
+ it "errors when no user is specified" do
42
+ expect(File).to receive(:exist?).and_return(false)
43
+ expect do
44
+ output = GrepPage::Parser.new('-t css'.split(' '))
45
+ expect(output).to match(/Missing --user parameter.*--user.*"/)
46
+ end.to raise_error(SystemExit)
47
+ end
37
48
  end
38
49
  end
39
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grepg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yash Ranadive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-16 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop
@@ -109,6 +109,7 @@ files:
109
109
  - Rakefile
110
110
  - bin/grepg
111
111
  - grepg.gemspec
112
+ - img/screenshot.png
112
113
  - lib/grepg.rb
113
114
  - lib/grepg/api.rb
114
115
  - lib/grepg/formatter.rb