fredric 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/fredric/command_line.rb +4 -4
- data/lib/fredric/docopt.txt +4 -4
- data/lib/fredric/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d967dcaedc94f0f9d4eea06e6f37defc4ee1cef0
|
4
|
+
data.tar.gz: bf8d0abc434b9ae0bb70b103b2b1e3fa127698dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6a01e4e40852df35754250407c184b46cd1798ace70bdae57bbc676aa2dd7b9fee01f4c56c64aa8a17125ad5da1b477e017ae51b218893ef233c5bfe300b77b
|
7
|
+
data.tar.gz: 02fc75cde31ae9ed972e18217c85f53560f2ccc66de2fd22b3f0558d4fdfd077a57e5767520c48ec76e70c8a07e0627e451226a9d7b7e0797f12de7357d72ac2
|
data/README.md
CHANGED
@@ -140,10 +140,9 @@ Command Line
|
|
140
140
|
--------------------------------------------------
|
141
141
|
|
142
142
|
The command line utility `fred` acts in a similar way. To set your
|
143
|
-
FRED API Key, simply set it in the environment
|
144
|
-
`FREDRIC_KEY`:
|
143
|
+
FRED API Key, simply set it in the environment variable `FRED_KEY`:
|
145
144
|
|
146
|
-
`$ export
|
145
|
+
`$ export FRED_KEY=y0urAP1k3y`
|
147
146
|
|
148
147
|
These commands are available:
|
149
148
|
|
@@ -204,8 +203,8 @@ To enable caching for the command line, simply set one or both of
|
|
204
203
|
these environment variables:
|
205
204
|
|
206
205
|
```
|
207
|
-
$ export
|
208
|
-
$ export
|
206
|
+
$ export FRED_CACHE_DIR=cache # default: 'cache'
|
207
|
+
$ export FRED_CACHE_LIFE=120 # default: 3600 (1 hour)
|
209
208
|
$ fred see category/children
|
210
209
|
# => This call will be cached
|
211
210
|
```
|
data/lib/fredric/command_line.rb
CHANGED
@@ -42,7 +42,7 @@ module Fredric
|
|
42
42
|
@csv = args['--csv']
|
43
43
|
|
44
44
|
unless api_key
|
45
|
-
raise Fredric::MissingAuth, "Missing Authentication\nPlease set
|
45
|
+
raise Fredric::MissingAuth, "Missing Authentication\nPlease set FRED_KEY=y0urAP1k3y"
|
46
46
|
end
|
47
47
|
|
48
48
|
return get if args['get']
|
@@ -106,15 +106,15 @@ module Fredric
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def api_key
|
109
|
-
ENV['
|
109
|
+
ENV['FRED_KEY']
|
110
110
|
end
|
111
111
|
|
112
112
|
def cache_dir
|
113
|
-
ENV['
|
113
|
+
ENV['FRED_CACHE_DIR']
|
114
114
|
end
|
115
115
|
|
116
116
|
def cache_life
|
117
|
-
ENV['
|
117
|
+
ENV['FRED_CACHE_LIFE']
|
118
118
|
end
|
119
119
|
|
120
120
|
end
|
data/lib/fredric/docopt.txt
CHANGED
@@ -44,16 +44,16 @@ Flags:
|
|
44
44
|
have a 'data' attribute.
|
45
45
|
|
46
46
|
Environment Variables:
|
47
|
-
|
47
|
+
FRED_KEY=y0urAP1k3y
|
48
48
|
Set Your FRED api key. This variable is required.
|
49
49
|
|
50
|
-
|
50
|
+
FRED_CACHE_LIFE=360
|
51
51
|
Set the number of seconds to consider the cache fresh. This variable
|
52
52
|
it optional.
|
53
53
|
|
54
|
-
|
54
|
+
FRED_CACHE_DIR=./cache
|
55
55
|
Set the cache directory. This variable is optional.
|
56
|
-
If both
|
56
|
+
If both FRED_CACHE_DIR and FRED_CACHE_LIFE are not set, requests
|
57
57
|
will not be cached.
|
58
58
|
|
59
59
|
Examples:
|
data/lib/fredric/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fredric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|