psychic-runner 0.0.2 → 0.0.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: 67df9a60685ee7062b1b4a26ef84a74157338023
4
- data.tar.gz: 5fd8577946b451d79ac3b7b928538089d66f512e
3
+ metadata.gz: 69224ee73f0d75190d851b16319792a4dc766f34
4
+ data.tar.gz: 1cddbfe6844bf53e58a6b15113b57c18b823a9f6
5
5
  SHA512:
6
- metadata.gz: 8ef2abd35ba79d48c86b27389731b6b6962dcd793a4810b144b439d1b846351f7052cc213a4d77463c468f7dc22ba825180e723244e45eab4001026c5b0f8a62
7
- data.tar.gz: f254488c0fa32cd13e8f8c7477988d3d61b7a5b165e08d31626f07834d0341fd33097ac85eeb101ae73d3fbeb1e7b9d5a8aea864065b620eb8bc02ab6afd9a5e
6
+ metadata.gz: 7784c2bf1669787a6dc29eb096dd21e6afec25204a5d44e43c6f92bd342490065d3fbb4f5acad414865e8637023812f6b1a284a5fce5309251e1ee6f61b946e7
7
+ data.tar.gz: e42b2f1153877d7d04fb91a0c7cd19438e35f30b5f82669cb776b27fe5768ab17a93c15404a947fcbd44258d843d02510eafcca1825d14066b8bcfdb834a2d43
@@ -1,5 +1,5 @@
1
1
  module Psychic
2
2
  class Runner
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -12,6 +12,8 @@ module Psychic
12
12
  attr_reader :stderr
13
13
  # coerce_value String, ->(v) { v.force_encoding('utf-8') }
14
14
 
15
+ include Psychic::Util::Hashable
16
+
15
17
  def initialize(results)
16
18
  @exitstatus = results.fetch(:exitstatus)
17
19
  # Needs to be UTF-8 to serialize as YAML
data/lib/psychic/util.rb CHANGED
@@ -2,6 +2,13 @@ module Psychic
2
2
  autoload :RegexpTokenHandler, 'psychic/tokens'
3
3
  autoload :MustacheTokenHandler, 'psychic/tokens'
4
4
  class Util
5
+ module Hashable
6
+ def to_hash
7
+ instance_variables.each_with_object({}) do |var,hash|
8
+ hash[var.to_s.delete("@")] = instance_variable_get(var)
9
+ end
10
+ end
11
+ end
5
12
  # Returns a new Hash with all key values coerced to strings. All keys
6
13
  # within a Hash are coerced by calling #to_s and hashes with arrays
7
14
  # and other hashes are traversed.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psychic-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Lincoln