hoalife 0.1.5 → 0.1.6
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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile.lock +2 -2
- data/bin/release +16 -15
- data/examples/account.rb +1 -1
- data/examples/ccr_article_and_violation_types.rb +83 -81
- data/examples/property.rb +5 -5
- data/examples/test.rb +1 -1
- data/lib/hoalife/properties/supplemental_mailing_address.rb +18 -0
- data/lib/hoalife/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 976883417dc4d556bf92d5dd493b06b6d334f76c2310759c5e4a7d5177102aa0
|
4
|
+
data.tar.gz: 67a0105f764997958a1d42ac68659343b8090f174b225542b529ce73b5f7fe8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0d0f200d11f20bd00820d66547e1e3f6b98ca431aec5f11c5b94fee43ee448dd79e5d5826eaa46cc5e6c5ede1a1c72c086138f4fd3668f5a9258e733fedce6c
|
7
|
+
data.tar.gz: 629e1cf013dff435badbcf321a644d3b72ed1edc5a9f6978a0f8be9b740b65b0d3b3121475e9163490b8ea822356e91b87b67edef88145f19fd46410a7b08392
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hoalife (0.1.
|
4
|
+
hoalife (0.1.6)
|
5
5
|
zeitwerk (~> 2.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
addressable (>= 2.3.6)
|
45
45
|
crack (>= 0.3.2)
|
46
46
|
hashdiff (>= 0.4.0, < 2.0.0)
|
47
|
-
zeitwerk (2.
|
47
|
+
zeitwerk (2.4.0)
|
48
48
|
|
49
49
|
PLATFORMS
|
50
50
|
ruby
|
data/bin/release
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
case ARGV[0]
|
5
|
-
when 'major'
|
6
|
-
|
7
|
-
when 'minor'
|
8
|
-
|
9
|
-
when 'pre'
|
10
|
-
|
11
|
-
when /\d+\.\d+\.\d+$/
|
12
|
-
|
13
|
-
else
|
14
|
-
|
15
|
-
end
|
4
|
+
release_version = case ARGV[0]
|
5
|
+
when 'major'
|
6
|
+
'major'
|
7
|
+
when 'minor'
|
8
|
+
'minor'
|
9
|
+
when 'pre'
|
10
|
+
'pre'
|
11
|
+
when /\d+\.\d+\.\d+$/
|
12
|
+
ARGV[0]
|
13
|
+
else
|
14
|
+
'patch'
|
15
|
+
end
|
16
16
|
|
17
17
|
version = `gem bump --no-commit --version #{release_version} | awk '{ print $4 }' | head -n 1`.strip
|
18
18
|
|
@@ -24,11 +24,12 @@ system('git add Gemfile.lock')
|
|
24
24
|
system("git commit -m \"Bump HOALife to #{version}\"")
|
25
25
|
|
26
26
|
system("git tag v#{version}")
|
27
|
-
system(
|
27
|
+
system('git push')
|
28
|
+
system('git push --tags')
|
28
29
|
|
29
|
-
system(
|
30
|
+
system('gem build hoalife')
|
30
31
|
|
31
|
-
puts
|
32
|
+
puts 'OTP Code:'
|
32
33
|
code = gets.strip
|
33
34
|
system("gem push --otp #{code} --key hoalife_rubygems_api_key hoalife-#{version}.gem")
|
34
35
|
|
data/examples/account.rb
CHANGED
@@ -8,7 +8,7 @@ parent = HOALife::Account.where(organizational: true).first
|
|
8
8
|
|
9
9
|
csv = CSV.read(File.expand_path('properties.csv', __dir__), headers: true)
|
10
10
|
|
11
|
-
associations = csv.collect { |row| row[
|
11
|
+
associations = csv.collect { |row| row['association_name'] }.uniq
|
12
12
|
|
13
13
|
associations.each.with_index do |association, i|
|
14
14
|
attrs = {
|
@@ -1,158 +1,160 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
articles = [
|
2
4
|
{
|
3
|
-
article:
|
4
|
-
title:
|
5
|
+
article: 1,
|
6
|
+
title: 'Exterior Maintenance',
|
5
7
|
violation_types_attributes: [
|
6
8
|
{
|
7
|
-
title:
|
8
|
-
resolution_step:
|
9
|
-
days_to_cure:
|
9
|
+
title: 'Mildew on home',
|
10
|
+
resolution_step: 'Please pressure wash your home in the next 20 days',
|
11
|
+
days_to_cure: 20
|
10
12
|
},
|
11
13
|
{
|
12
|
-
title:
|
13
|
-
resolution_step:
|
14
|
-
days_to_cure:
|
14
|
+
title: 'Faded shutters',
|
15
|
+
resolution_step: 'Please paint your shutters in the next 20 days',
|
16
|
+
days_to_cure: 20
|
15
17
|
},
|
16
18
|
{
|
17
|
-
title:
|
18
|
-
resolution_step:
|
19
|
-
days_to_cure:
|
19
|
+
title: 'Siding damaged',
|
20
|
+
resolution_step: 'Please repair/replace the damaged siding in the next 20 day',
|
21
|
+
days_to_cure: 20
|
20
22
|
},
|
21
23
|
{
|
22
|
-
title:
|
23
|
-
resolution_step:
|
24
|
-
days_to_cure:
|
24
|
+
title: 'Shutter(s) missing/damaged',
|
25
|
+
resolution_step: 'Please repair/replace the missing/damaged shutter(s) in the next 20 days',
|
26
|
+
days_to_cure: 20
|
25
27
|
},
|
26
28
|
{
|
27
|
-
title:
|
28
|
-
resolution_step:
|
29
|
-
days_to_cure:
|
29
|
+
title: 'Mailbox is damaged',
|
30
|
+
resolution_step: 'Please repair/replace the damaged mailbox in the next 20 days',
|
31
|
+
days_to_cure: 20
|
30
32
|
},
|
31
33
|
{
|
32
|
-
title:
|
33
|
-
resolution_step:
|
34
|
-
days_to_cure:
|
34
|
+
title: 'Mailbox needs to be painted',
|
35
|
+
resolution_step: 'Please paint your mailbox in the next 20 days',
|
36
|
+
days_to_cure: 20
|
35
37
|
},
|
36
38
|
{
|
37
|
-
title:
|
38
|
-
resolution_step:
|
39
|
-
days_to_cure:
|
39
|
+
title: 'Garage door damaged',
|
40
|
+
resolution_step: 'Please repair/replace the garage door in the next 20 days',
|
41
|
+
days_to_cure: 20
|
40
42
|
},
|
41
43
|
{
|
42
|
-
title:
|
43
|
-
resolution_step:
|
44
|
-
days_to_cure:
|
44
|
+
title: 'Fence damaged',
|
45
|
+
resolution_step: 'Please repair the damaged fence in the next 20 days',
|
46
|
+
days_to_cure: 20
|
45
47
|
},
|
46
48
|
{
|
47
|
-
title:
|
48
|
-
resolution_step:
|
49
|
-
days_to_cure:
|
49
|
+
title: 'Trim on home needs to be painted',
|
50
|
+
resolution_step: 'Please paint the trim on your home in the next 20 days',
|
51
|
+
days_to_cure: 20
|
50
52
|
}
|
51
53
|
]
|
52
54
|
},
|
53
55
|
{
|
54
|
-
article:
|
55
|
-
title:
|
56
|
+
article: 2,
|
57
|
+
title: 'ARC',
|
56
58
|
violation_types_attributes: [
|
57
59
|
{
|
58
|
-
title:
|
59
|
-
resolution_step:
|
60
|
-
days_to_cure:
|
60
|
+
title: 'Unapproved structure',
|
61
|
+
resolution_step: 'Please submit an ARC form in the next 10 days',
|
62
|
+
days_to_cure: 10
|
61
63
|
}
|
62
64
|
]
|
63
65
|
},
|
64
66
|
{
|
65
|
-
article:
|
66
|
-
title:
|
67
|
+
article: 3,
|
68
|
+
title: 'Improper Storage',
|
67
69
|
violation_types_attributes: [
|
68
70
|
{
|
69
|
-
title:
|
70
|
-
resolution_step:
|
71
|
-
days_to_cure:
|
71
|
+
title: 'Basketball goal',
|
72
|
+
resolution_step: 'Please properly store your basketball goal when not in use',
|
73
|
+
days_to_cure: nil
|
72
74
|
},
|
73
75
|
{
|
74
|
-
title:
|
76
|
+
title: 'Garbage can(s) in view from street',
|
75
77
|
resolution_step: "Please store your garbage can(s) from the view of the street on days not \
|
76
78
|
deemed for pickup",
|
77
|
-
days_to_cure:
|
79
|
+
days_to_cure: nil
|
78
80
|
},
|
79
81
|
{
|
80
|
-
title:
|
81
|
-
resolution_step:
|
82
|
-
days_to_cure:
|
82
|
+
title: 'Improperly stored item(s) around home',
|
83
|
+
resolution_step: 'Please properly store all item(s) in the next 5 days',
|
84
|
+
days_to_cure: 5
|
83
85
|
}
|
84
86
|
]
|
85
87
|
},
|
86
88
|
{
|
87
|
-
article:
|
88
|
-
title:
|
89
|
+
article: 4,
|
90
|
+
title: 'Vehicles',
|
89
91
|
violation_types_attributes: [
|
90
92
|
{
|
91
|
-
title:
|
92
|
-
resolution_step:
|
93
|
-
days_to_cure:
|
93
|
+
title: 'Vehicle(s) parked in grass',
|
94
|
+
resolution_step: 'Please refrain from parking in the grassy areas of the community',
|
95
|
+
days_to_cure: nil
|
94
96
|
},
|
95
97
|
{
|
96
|
-
title:
|
97
|
-
resolution_step:
|
98
|
-
days_to_cure:
|
98
|
+
title: 'Inoperable vehicle at residence',
|
99
|
+
resolution_step: 'Please repair/properly register your vehicle in the next 10 days',
|
100
|
+
days_to_cure: 10
|
99
101
|
},
|
100
102
|
{
|
101
|
-
title:
|
102
|
-
resolution_step:
|
103
|
-
days_to_cure:
|
103
|
+
title: 'Trailer at residence',
|
104
|
+
resolution_step: 'Please remove the trailer from the community in the next 5 days',
|
105
|
+
days_to_cure: 5
|
104
106
|
},
|
105
107
|
{
|
106
|
-
title:
|
107
|
-
resolution_step:
|
108
|
-
days_to_cure:
|
108
|
+
title: 'Boat at residence',
|
109
|
+
resolution_step: 'Please remove the boat from the community in the next 5 days',
|
110
|
+
days_to_cure: 5
|
109
111
|
}
|
110
112
|
]
|
111
113
|
},
|
112
114
|
{
|
113
|
-
article:
|
114
|
-
title:
|
115
|
+
article: 5,
|
116
|
+
title: 'Lawn Maintenance',
|
115
117
|
violation_types_attributes: [
|
116
118
|
{
|
117
|
-
title:
|
118
|
-
resolution_step:
|
119
|
-
days_to_cure:
|
119
|
+
title: 'High grass',
|
120
|
+
resolution_step: 'Please mow your lawn in the next 7 days',
|
121
|
+
days_to_cure: 7
|
120
122
|
},
|
121
123
|
{
|
122
|
-
title:
|
123
|
-
resolution_step:
|
124
|
-
days_to_cure:
|
124
|
+
title: 'Weeds in lawn',
|
125
|
+
resolution_step: 'Please treat the weeds in your lawn in the next 15 days',
|
126
|
+
days_to_cure: 15
|
125
127
|
},
|
126
128
|
{
|
127
|
-
title:
|
128
|
-
resolution_step:
|
129
|
-
days_to_cure:
|
129
|
+
title: 'Weeds in landscaping bed(s)',
|
130
|
+
resolution_step: 'Please treat the weeds in your landscaping bed(s) in the next 15 days',
|
131
|
+
days_to_cure: 15
|
130
132
|
},
|
131
133
|
{
|
132
|
-
title:
|
133
|
-
resolution_step:
|
134
|
-
days_to_cure:
|
134
|
+
title: 'Bare spot(s) in lawn',
|
135
|
+
resolution_step: 'Please treat the bare spot(s) in your lawn in the next 15 days',
|
136
|
+
days_to_cure: 15
|
135
137
|
},
|
136
138
|
{
|
137
|
-
title:
|
138
|
-
resolution_step:
|
139
|
-
days_to_cure:
|
139
|
+
title: 'Rut in lawn',
|
140
|
+
resolution_step: 'Please fill in the rut in your lawn in the next 15 days',
|
141
|
+
days_to_cure: 15
|
140
142
|
},
|
141
143
|
{
|
142
|
-
title:
|
143
|
-
resolution_step:
|
144
|
-
days_to_cure:
|
144
|
+
title: 'Overgrown Shrub(s)',
|
145
|
+
resolution_step: 'Please trim your shrub(s) in the next 10 days',
|
146
|
+
days_to_cure: 10
|
145
147
|
}
|
146
148
|
]
|
147
149
|
}
|
148
150
|
]
|
149
151
|
|
150
152
|
parent = HOALife::Account.where(organizational: true).first
|
151
|
-
account = HOALife::Account.create(name:
|
153
|
+
account = HOALife::Account.create(name: 'Article & VT test', parent_id: parent.id)
|
152
154
|
|
153
155
|
articles.each do |article|
|
154
156
|
record = HOALife::CCRArticle.create(
|
155
|
-
article: article[:article], title: article[:title], description:
|
157
|
+
article: article[:article], title: article[:title], description: 'Description here!',
|
156
158
|
account_id: account.id
|
157
159
|
)
|
158
160
|
|
@@ -165,7 +167,7 @@ articles.each do |article|
|
|
165
167
|
article_violation_types = HOALife::CCRViolationType.where(ccr_article_id: record.id).tap(&:all)
|
166
168
|
assert_equal article[:violation_types_attributes].size, article_violation_types.count
|
167
169
|
|
168
|
-
article[:violation_types_attributes].each.with_index do |
|
170
|
+
article[:violation_types_attributes].each.with_index do |_vt, i|
|
169
171
|
violation_type = HOALife::CCRViolationType.where(external_id: i).first
|
170
172
|
assert(violation_type.destroy)
|
171
173
|
end
|
data/examples/property.rb
CHANGED
@@ -33,11 +33,11 @@ def create_account(name)
|
|
33
33
|
end
|
34
34
|
|
35
35
|
csv.each do |row|
|
36
|
-
association = find_or_create_account(row[
|
36
|
+
association = find_or_create_account(row['association_name'])
|
37
37
|
|
38
38
|
attrs = row.to_h.merge(
|
39
|
-
account_id: association.id, phone_numbers: row[
|
40
|
-
emails: row[
|
39
|
+
account_id: association.id, phone_numbers: row['phone_numbers'].split('|'),
|
40
|
+
emails: row['emails'].split('|')
|
41
41
|
)
|
42
42
|
|
43
43
|
property = HOALife::Property.create(attrs)
|
@@ -48,12 +48,12 @@ end
|
|
48
48
|
refute_equal(original_size, HOALife::Property.reload.count)
|
49
49
|
|
50
50
|
csv.each do |row|
|
51
|
-
find_by_external_id = HOALife::Property.where(external_id: row[
|
51
|
+
find_by_external_id = HOALife::Property.where(external_id: row['external_id'])
|
52
52
|
assert_equal 1, find_by_external_id.count
|
53
53
|
|
54
54
|
found = find_by_external_id.first
|
55
55
|
|
56
|
-
new_external_id = row[
|
56
|
+
new_external_id = row['external_id'] + 'WithAChange'
|
57
57
|
found.external_id = new_external_id
|
58
58
|
assert(found.save)
|
59
59
|
|
data/examples/test.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :nodoc
|
4
|
+
class HOALife::Properties::SupplementalMailingAddress < HOALife::Resource
|
5
|
+
include HOALife::Resources::Persistable
|
6
|
+
|
7
|
+
self.base_path = '/properties/supplemental_mailing_addresses'
|
8
|
+
|
9
|
+
def as_json
|
10
|
+
h = super
|
11
|
+
|
12
|
+
h.dig('data', 'relationships').merge!(
|
13
|
+
'property' => { 'data' => { 'id' => property_id } }
|
14
|
+
)
|
15
|
+
|
16
|
+
h
|
17
|
+
end
|
18
|
+
end
|
data/lib/hoalife/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoalife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Westendorf
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- lib/hoalife/error.rb
|
147
147
|
- lib/hoalife/escalation.rb
|
148
148
|
- lib/hoalife/inspection.rb
|
149
|
+
- lib/hoalife/properties/supplemental_mailing_address.rb
|
149
150
|
- lib/hoalife/property.rb
|
150
151
|
- lib/hoalife/resource.rb
|
151
152
|
- lib/hoalife/resources/collection.rb
|