leafy-ruby 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 0cf163d4cd002f7035394d9997d425b7f0834fc2cc91a42a516f3de9de5c6bfe
4
- data.tar.gz: 234f95015a72ad3aacf0db48bfe6c4bc5f7c48db0f1e474c6a88516b9e0a3911
3
+ metadata.gz: 1e9b8ab7fa5fce879b69856041e24097cc574e41343f3c954c6256d45b8746c0
4
+ data.tar.gz: de0763a761626b180748303a01bd0cf9d403d012ac13c61af212051e1a65b35a
5
5
  SHA512:
6
- metadata.gz: c4c5342b0a90c406bd6cb4e04969f3e9ec59cb10e03d91e2ea1f91d2db8f6cc125809ee23bade0b098480db82a22cba079d344ff4a599b9db9085cd0ee55b8a4
7
- data.tar.gz: 8d6cb3f31e9bab0543e51a3b5344ef6ddd26c1052ad07254b6ef89365fd5ab9a55d92de8472688034da3a51191601ac0924eda53b9bdca497d9890c1e48b482d
6
+ metadata.gz: e5390a02d111263752b418777d2cdcee9e224a9f3c52db573362da4d63f1af9f66f3cf17865d978c95d5317b18d87b4a379161f5f40efbc09bae1335ffca710e
7
+ data.tar.gz: d3e94469b3c0a7d22de8415a5f22550ac90dbf40f72c3986181914c75127c631c53fa1cc97cda8b40199cae5d7bdf4401e7e48071b4fd4dfa208d428565826c3
data/README.md CHANGED
@@ -70,9 +70,9 @@ host.leafy_fields_attributes = [
70
70
 
71
71
  # or build schema yourself
72
72
 
73
- field_1 = Leafy::Field.new(name: "Field 1", type: :integer, id: "id_1", default: 1, placeholder: "enter an integer", required: true)
74
- field_2 = Leafy::Field.new(name: "Field 2", type: :string, id: "id_2", default: "", placeholder: "enter value")
75
- field_3 = Leafy::Field.new(name: "Field 3", type: :datetime, id: "id_3", order: 10000)
73
+ field_1 = Leafy::Field.new(name: "Field 1", type: :integer, id: "id_1", metadata: { default: 1, placeholder: "enter an integer", required: true })
74
+ field_2 = Leafy::Field.new(name: "Field 2", type: :string, id: "id_2", metadata: { default: "", placeholder: "enter value" })
75
+ field_3 = Leafy::Field.new(name: "Field 3", type: :datetime, id: "id_3", metadata: { order: 10000 })
76
76
 
77
77
  schema = Leafy::Schema.new
78
78
  schema << field_1
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  It ships with several basic data types and allows you to add your own data type converters.
18
18
  DESC
19
19
 
20
- spec.homepage = "https://gibhub.com/estepnv/leafy"
20
+ spec.homepage = "https://github.com/estepnv/leafy"
21
21
  spec.license = "MIT"
22
22
 
23
23
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
+ spec.required_ruby_version = '>= 2.2'
29
30
 
30
31
  spec.add_development_dependency "bundler", "~> 1.16"
31
32
  spec.add_development_dependency "rake", "~> 10.0"
@@ -9,8 +9,8 @@ module Leafy
9
9
  raise ArgumentError, "attributes is not a Hash" unless attributes.is_a?(Hash)
10
10
  attributes = Leafy::Utils.symbolize_keys(attributes)
11
11
 
12
- self.name = attributes[:name]
13
- self.type = attributes[:type]
12
+ self.name = attributes.fetch(:name)
13
+ self.type = attributes.fetch(:type)
14
14
  self.id = attributes.fetch(:id) { [name.downcase.strip.tr(" ", "-"), SecureRandom.uuid].join("-") }
15
15
  self.metadata = attributes.fetch(:metadata, {})
16
16
  end
@@ -8,7 +8,7 @@ module Leafy
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 0
11
- TINY = 1
11
+ TINY = 2
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leafy-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Stepanov
@@ -137,7 +137,7 @@ files:
137
137
  - lib/leafy/schema.rb
138
138
  - lib/leafy/utils.rb
139
139
  - lib/leafy/version.rb
140
- homepage: https://gibhub.com/estepnv/leafy
140
+ homepage: https://github.com/estepnv/leafy
141
141
  licenses:
142
142
  - MIT
143
143
  metadata: {}
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: '2.2'
153
153
  required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - ">="