render 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTJlZmIxMGY4MTViYTcxMTc1ZDQ1Y2NiMzQyOWIwOTJiNjkzODM1Yw==
4
+ ZDdkY2Y3ZDlhMDIxZjQyZDA1OTNiZDJjZWQzMDIzMTI0YjkwM2E0Mw==
5
5
  data.tar.gz: !binary |-
6
- OGRkZWY2MWQ2Y2NlY2MxNGJmYThmNzIwMmY3MjAyMTI5NDEwYWVkNw==
6
+ ZDY4MTllMWE1NTgyYmI4ZmRjOWIwNzA0NzEwNDcwMzM3YjFjMTA5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzdlN2JkNWU3MDdlOTUzYWUwY2RkZTYyOTFiN2U3ZGE5MTNiYTIwMzgzNmQ1
10
- YmM3MzE3ZDYyODU3NTNjYTI2NjM0NjY3ZjJkNDA4ZDc5Nzg1YjY2ZGIzODgx
11
- ZWQ2YjhkMDdkNzk5OTg0NTM5MDQ3YjA5YjkzYjZhNGRjMGEwYWQ=
9
+ MmJlMWIwNjZkZjcyNDcwZDlkNDBjNmM0OWI4NDA4YWViNjM2MDVmMTkxYjJl
10
+ ZjU1NDYyN2NjMjZhZDIzMmY2NjhhMWYyZWE5YzFmYWI0OTI1MzBmZTAzOWJm
11
+ M2E4N2MzZTVhNzNkMGRiZGVlYzI1MzZiZDFmYzNlYjk0ZjM2MDY=
12
12
  data.tar.gz: !binary |-
13
- ZjMwNDIyNDdmZDg1ZGIyNDExMjYwODkzYjY2YTY3ZjllYWUzY2RkMmI4NjE0
14
- NDQ0NTc2MzVhZjQzZTA0MGZhOTkzMzIxYzk4MTdlNTEwZTViYmM5MjVkNDgx
15
- YzlhNDVjMWEwODkzMWJiMDZmZWQwNThhMGZhMjE3ODk5OTk4OTg=
13
+ YzExNmU4ZjQ0NDk0NmYxYTFjMDcyZDZmODAxZmYwZDlhNDJjY2FhYjc3Yjgx
14
+ ZjNhYzQxMGIwN2ZlOTViMDM3MDgzMjQ5YWEwNzBjOTgyMWI1YzZiNGZkZjcw
15
+ MzdmZmFmNjNjZmZhNjY3YWY5MGQxZmYyM2RlZDM3MjM2NDE1MTE=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- render (0.0.5)
4
+ render (0.0.6)
5
5
  uuid (= 2.3.7)
6
6
 
7
7
  GEM
@@ -3,6 +3,7 @@
3
3
 
4
4
  require "uuid"
5
5
  require "render/errors"
6
+ require "date"
6
7
 
7
8
  module Render
8
9
  class Generator
@@ -64,5 +65,6 @@ module Render
64
65
  Generator.create!(Time, /.*/, proc { |attribute| time = Time.now; (attribute.type == String) ? time.to_s : time })
65
66
  Generator.create!(Type::Boolean, /.*/, proc { [true, false].sample })
66
67
  Generator.create!(Type::Enum, /.*/, proc { |attribute| attribute.enums.sample })
68
+ Generator.create!(Type::Date, /.*/, proc { Time.now.to_date })
67
69
  end
68
70
  end
data/lib/render/type.rb CHANGED
@@ -9,6 +9,7 @@ module Render
9
9
 
10
10
  class Enum; end
11
11
  class Boolean; end
12
+ class Date; end
12
13
 
13
14
  class << self
14
15
  attr_accessor :instances
@@ -24,8 +25,6 @@ module Render
24
25
  def parse(name, raise_error = false)
25
26
  return name unless name.is_a?(String)
26
27
  Render::Type.find(name) || Object.const_get(name.capitalize)
27
- rescue NameError => error
28
- raise Errors::InvalidType.new(name) if raise_error
29
28
  end
30
29
 
31
30
  def parse!(name)
@@ -59,5 +58,6 @@ module Render
59
58
  add!(:time, Time)
60
59
  add_render_specific_type!(:Boolean)
61
60
  add_render_specific_type!(:Enum)
61
+ add_render_specific_type!(:Date)
62
62
  end
63
63
  end
@@ -1,3 +1,3 @@
1
1
  module Render
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Weber