bumblebee 3.1.0.pre.alpha → 3.1.0

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: d61fbe056f88ae749567bcdd927e09a4c9d6b14cd42813495a49423e161f4bc7
4
- data.tar.gz: 9c51b4f56fe3e4c7db3a4aecef92b1b96cd3b50d4537bee5c468839e3cfd746b
3
+ metadata.gz: b778ae4e05a2d4d578f8fb3f98af32929d2b1a00f2289fefe29b4a3e7d41a353
4
+ data.tar.gz: f48433f936d8c11fba080224ba64df7b167717d24c72f1a8e92971ab603cb0fb
5
5
  SHA512:
6
- metadata.gz: 64cc246904617a66ba882fa6010cdb5a772a179191b53fbecf596628dd4e73e1e461f56b5f102df4c141837dd06c5b348567ac887c7bc7110b5b5fc4d29e3190
7
- data.tar.gz: db3509825cbaea3ada1012d8e7c2fd5aea5efc612e8a2ab284a86a32ab9a38a0606b3ab8c6d219afe76cc3020830508d99eed3d8fab9886fc09d4174f92edf77
6
+ metadata.gz: 0ba3577b2116ff8f9a27fa1275555f7c322d9ea26df18ee6518a4dfdfb993ade238cc5c92951b33f8468a16baacad88f407707cf81a0cf22fd9c2aae63364059
7
+ data.tar.gz: 6a10009dfa2ca2b0d2c4415ff4198469f1f5cb1b3460f66c390b785b8053435f2c38ec354d724584defbbc4f6361e089e9c10a698aff5101750e1d872205f1ff
@@ -1,4 +1,4 @@
1
- # 3.1.0-alpha (December 24th, 2019)
1
+ # 3.1.0 (December 26th, 2019)
2
2
 
3
3
  Additions/Changes:
4
4
 
data/README.md CHANGED
@@ -46,13 +46,13 @@ Then `objects` is this array of hashes:
46
46
 
47
47
  ````ruby
48
48
  [
49
- { id: '1', name: 'Matt', dob: '2/3/01', phone: '555-555-5555' },
50
- { id: '2', name: 'Nick', dob: '9/3/21', phone: '444-444-4444' },
51
- { id: '3', name: 'Sam', dob: '12/12/32', phone: '333-333-3333' }
49
+ { id: '1', name: 'Matt', dob: '1901-02-03', phone: '555-555-5555' },
50
+ { id: '2', name: 'Nick', dob: '1921-09-03', phone: '444-444-4444' },
51
+ { id: '3', name: 'Sam', dob: '1932-12-12', phone: '333-333-3333' }
52
52
  ]
53
53
  ````
54
54
 
55
- *Note: Data, in this case, would be the read CSV file contents in string format.*
55
+ *Note: Data, in this case, would be the CSV file contents in string format.*
56
56
 
57
57
  ### Custom Headers
58
58
 
@@ -99,7 +99,7 @@ objects = [
99
99
  demo: { dob: '1932-12-12' },
100
100
  contact: { phone: '333-333-3333' }
101
101
  }
102
- ]
102
+ }
103
103
  ````
104
104
 
105
105
  We could create a flat-file CSV:
@@ -127,7 +127,7 @@ columns = {
127
127
  property: :phone,
128
128
  through: :contact
129
129
  }
130
- ]
130
+ }
131
131
  ````
132
132
 
133
133
  And executing the following:
@@ -136,7 +136,7 @@ And executing the following:
136
136
  csv = Bumblebee::Template.new(columns: columns).generate(objects)
137
137
  ````
138
138
 
139
- The above columns config would work both ways, so if we received the CSV, we could parse it to an array of nested hashes. Unfortunately, for now, we cannot do better than an array of nested hashes.
139
+ The above columns config would work both ways, so if we received the CSV, we could parse it to an array of nested hashes.
140
140
 
141
141
  ### Custom Formatting
142
142
 
@@ -278,7 +278,7 @@ objects = Bumblebee::Template.new(columns: columns, object_class: OpenStruct).pa
278
278
 
279
279
  Objects will now be an array of OpenStruct objects instead of Hash objects.
280
280
 
281
- * Note: you must also specify this in pluck_split:
281
+ *Note:* you must also specify this in pluck_split:
282
282
 
283
283
  ````ruby
284
284
  columns = {
@@ -14,22 +14,14 @@ module Bumblebee
14
14
  module Types
15
15
  IGNORE = :ignore
16
16
  end
17
- include Mutator::Types
17
+ include Types
18
18
 
19
19
  attr_reader :converter, :type
20
20
 
21
21
  def initialize(arg)
22
- @type = nil
23
22
  @resolver = Objectable.resolver
24
-
25
- if arg.nil?
26
- @converter = NullConverter.new
27
- elsif mutator?(arg)
28
- @type = Mutator::Types.const_get(arg.to_s.upcase.to_sym)
29
- @converter = NullConverter.new
30
- else
31
- @converter = SimpleConverter.new(arg)
32
- end
23
+ @converter = arg.nil? || mutator?(arg) ? NullConverter.new : SimpleConverter.new(arg)
24
+ @type = mutator?(arg) ? Types.const_get(arg.to_s.upcase.to_sym) : nil
33
25
 
34
26
  freeze
35
27
  end
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module Bumblebee
11
- VERSION = '3.1.0-alpha'
11
+ VERSION = '3.1.0'
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumblebee
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.pre.alpha
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-24 00:00:00.000000000 Z
11
+ date: 2019-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_hashable
@@ -200,9 +200,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  version: 2.3.8
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
- - - ">"
203
+ - - ">="
204
204
  - !ruby/object:Gem::Version
205
- version: 1.3.1
205
+ version: '0'
206
206
  requirements: []
207
207
  rubygems_version: 3.0.3
208
208
  signing_key: