cog-rb 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/cog/request.rb +5 -2
- data/lib/cog/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: c49628f0428b94a77d33730dc268835b34353bbc
|
4
|
+
data.tar.gz: a909a54c6eca6cea8953ca63436ae661f02aaa4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4550b7cae53f98d6148babe8d8692382e2641572990e5a06c81585f6a51d65e7984e28468268a6c1cc0fbb180abc0a79c96014264fcb53e55b15ecc7914455c3
|
7
|
+
data.tar.gz: 69b5d0ee26a17629e2dd687202cc713174b9d4424d52172d585ec5f314a1d6f33c2bab6b08d433ee99873cb77c3f9a7861d2cbd42261222c4784bfa5ab299443
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.4.3
|
2
|
+
|
3
|
+
* Memoize Cog::Request.input as a class variable so that we don't try
|
4
|
+
to read STDIN more than once if we initialize request more than once
|
5
|
+
for any reason.
|
6
|
+
|
1
7
|
## 0.4.2
|
2
8
|
|
3
9
|
* Minor change to `cogrb template:update` to remove line wrapping of values.
|
data/lib/cog/request.rb
CHANGED
@@ -2,16 +2,19 @@ require 'json'
|
|
2
2
|
|
3
3
|
class Cog
|
4
4
|
class Request
|
5
|
-
attr_reader :options, :args
|
5
|
+
attr_reader :options, :args
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@args = populate_args
|
9
9
|
@options = populate_options
|
10
|
-
@input = (STDIN.tty?) ? {} : JSON.parse(STDIN.read)
|
11
10
|
end
|
12
11
|
|
13
12
|
private
|
14
13
|
|
14
|
+
def input
|
15
|
+
@@input = (STDIN.tty?) ? {} : JSON.parse(STDIN.read)
|
16
|
+
end
|
17
|
+
|
15
18
|
def populate_args
|
16
19
|
(0 .. (ENV['COG_ARGC'].to_i - 1)).map { |n| ENV["COG_ARGV_#{n}"] }
|
17
20
|
end
|
data/lib/cog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cog-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Imbriaco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|