figs 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/lib/figs/env.rb +28 -2
  2. data/lib/figs/version.rb +1 -1
  3. metadata +11 -5
  4. checksums.yaml +0 -15
data/lib/figs/env.rb CHANGED
@@ -5,9 +5,35 @@ module Figs
5
5
  def env
6
6
  @env ||= ::ENV
7
7
  end
8
-
8
+
9
+ # Since Ruby's implementation of YAML has a set of "basic types" that are
10
+ # implicitly converted from String to the appropriate type, we convert the
11
+ # "basic types" to strings (appropriately) and store them in ENV, so that
12
+ # a Figs application can just call ENV['VAR_NAME'] for "basic types"
13
+ # Basic Types handled are
14
+ # - Integer
15
+ # - Float
16
+ # - Null
17
+ # - Boolean
18
+ # - Time (in the ISO8601 format)
19
+ # - Date (in the ISO8601 format)
9
20
  def set(key,value)
10
- env[key.to_s] = value.is_a?(String) ? value : YAML::dump(value)
21
+ env[key.to_s] = begin
22
+ case value
23
+ when String
24
+ value
25
+ when Integer, Float
26
+ value.to_s
27
+ when FalseClass, TrueClass
28
+ value.to_s
29
+ when Time, Date
30
+ value.iso8601
31
+ when NilClass
32
+ '~'
33
+ else
34
+ YAML::dump(value)
35
+ end
36
+ end
11
37
  end
12
38
 
13
39
  def [](key)
data/lib/figs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Figs
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: figs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - hab278
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
12
+ date: 2014-08-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: git
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -63,25 +68,26 @@ files:
63
68
  homepage: https://github.com/NYULibraries/figs
64
69
  licenses:
65
70
  - MIT
66
- metadata: {}
67
71
  post_install_message:
68
72
  rdoc_options: []
69
73
  require_paths:
70
74
  - lib
71
75
  required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
72
77
  requirements:
73
78
  - - ! '>='
74
79
  - !ruby/object:Gem::Version
75
80
  version: '0'
76
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
77
83
  requirements:
78
84
  - - ! '>='
79
85
  - !ruby/object:Gem::Version
80
86
  version: '0'
81
87
  requirements: []
82
88
  rubyforge_project:
83
- rubygems_version: 2.1.11
89
+ rubygems_version: 1.8.23
84
90
  signing_key:
85
- specification_version: 4
91
+ specification_version: 3
86
92
  summary: Simple app configuration
87
93
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTIxNDJlZThiNjY0ZjYwMGVjNDdlOTdlNDliZTM4MmZmNTdjMzQzMA==
5
- data.tar.gz: !binary |-
6
- MTY3YzU0YWVkYmY3NTNkOWIwMDg4YzJhNGE5Y2MwMmI1MGFjNjllYQ==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- ZDA0NDFlOTgxODViM2U5NGMzZjQzZGM4ZGM4MmM4YzkxMmVlNjI4Mjk1MjEy
10
- ODNlMGUxNmYxNGRkZDI5YzdiNzRlOTY3OWY3Y2IwYWU4M2ViMjczZGJjNTE0
11
- ZmI2ODI5NzJjYTQxMWVmYTNhNjdmYmFhYzZiZjhkNmQxZmM3YTI=
12
- data.tar.gz: !binary |-
13
- NTk1ODRkNmViZmViNjk4YjQyNDRlYTE3MjczOGE4NWFhMGY0ZmVmY2RiNjQ3
14
- N2Q2OTliMjdjNGFlNThhYjQ3ZWJhMDEwODU5NzY0NWFjYmM5ZDQ4NTcxODRi
15
- OTg4NzFlOWE4NGNmY2VkZTM2ODA2OWY0MzhjMmZlY2JiZTk1Y2Q=