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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41fed73a4f6510de01c226ad714a3afe1b3b2f73
4
- data.tar.gz: 5580a4092062d77dd7ff2189028d0e82481e2c8f
3
+ metadata.gz: c49628f0428b94a77d33730dc268835b34353bbc
4
+ data.tar.gz: a909a54c6eca6cea8953ca63436ae661f02aaa4e
5
5
  SHA512:
6
- metadata.gz: 0e0c5023f585c5f23cf7acf5993c31c33b909b0fd6973d09cdcb351cf4fcb65c76abe8ef064c3ca5f4b7b882c5802f57a3a3eb81a42bcab9b292ce4d7cfb0d7f
7
- data.tar.gz: 97105e0ef638bc9100eac9ad9b93c519a2465c940f221733bf68b0c120571d3a1615959a91906254d5732c6176ab01149d227a44d4573632321d0dd72d5ab8fb
6
+ metadata.gz: 4550b7cae53f98d6148babe8d8692382e2641572990e5a06c81585f6a51d65e7984e28468268a6c1cc0fbb180abc0a79c96014264fcb53e55b15ecc7914455c3
7
+ data.tar.gz: 69b5d0ee26a17629e2dd687202cc713174b9d4424d52172d585ec5f314a1d6f33c2bab6b08d433ee99873cb77c3f9a7861d2cbd42261222c4784bfa5ab299443
@@ -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.
@@ -2,16 +2,19 @@ require 'json'
2
2
 
3
3
  class Cog
4
4
  class Request
5
- attr_reader :options, :args, :input
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
@@ -1,3 +1,3 @@
1
1
  class Cog
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
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.2
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-30 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake