hoalife 0.1.5 → 0.1.6

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: 8ad1bb55abf72eafa0ab03d98f64780ccc256c845270dec9da47aee29d577779
4
- data.tar.gz: e2e098330eb8cb4212a26dde0c7a99bc98dea0d8ce8cf854fec7fac18e56032b
3
+ metadata.gz: 976883417dc4d556bf92d5dd493b06b6d334f76c2310759c5e4a7d5177102aa0
4
+ data.tar.gz: 67a0105f764997958a1d42ac68659343b8090f174b225542b529ce73b5f7fe8a
5
5
  SHA512:
6
- metadata.gz: d000fdb3f1c2443426140d6010346638de821b0fde9140654765407f47045eb3ad07928a1a04bee6bdbfdc289c14ae4482dee2d579fa7e6bce0327f179bccbe8
7
- data.tar.gz: 9bee59c77f7d47a1b9b7f801d8e0d32ae6c4a44005efd00c9e48be1cdf479c59c19d813611fe9e9fda811b749c164e91450390e94b855ea4b79f7f7297f497b4
6
+ metadata.gz: d0d0f200d11f20bd00820d66547e1e3f6b98ca431aec5f11c5b94fee43ee448dd79e5d5826eaa46cc5e6c5ede1a1c72c086138f4fd3668f5a9258e733fedce6c
7
+ data.tar.gz: 629e1cf013dff435badbcf321a644d3b72ed1edc5a9f6978a0f8be9b740b65b0d3b3121475e9163490b8ea822356e91b87b67edef88145f19fd46410a7b08392
@@ -3,7 +3,7 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.0
7
- - 2.6.0
8
- - 2.7.0
6
+ - 2.5
7
+ - 2.6
8
+ - 2.7
9
9
  before_install: gem install bundler -v 2.0.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hoalife (0.1.5)
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.3.0)
47
+ zeitwerk (2.4.0)
48
48
 
49
49
  PLATFORMS
50
50
  ruby
@@ -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
- release_version = 'major'
7
- when 'minor'
8
- release_version = 'minor'
9
- when 'pre'
10
- release_version = 'pre'
11
- when /\d+\.\d+\.\d+$/
12
- release_version = ARGV[0]
13
- else
14
- release_version = 'patch'
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("git push --tags")
27
+ system('git push')
28
+ system('git push --tags')
28
29
 
29
- system("gem build hoalife")
30
+ system('gem build hoalife')
30
31
 
31
- puts "OTP Code:"
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
 
@@ -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["association_name"] }.uniq
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: 1,
4
- title: "Exterior Maintenance",
5
+ article: 1,
6
+ title: 'Exterior Maintenance',
5
7
  violation_types_attributes: [
6
8
  {
7
- title: "Mildew on home",
8
- resolution_step: "Please pressure wash your home in the next 20 days",
9
- days_to_cure: 20
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: "Faded shutters",
13
- resolution_step: "Please paint your shutters in the next 20 days",
14
- days_to_cure: 20
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: "Siding damaged",
18
- resolution_step: "Please repair/replace the damaged siding in the next 20 day",
19
- days_to_cure: 20
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: "Shutter(s) missing/damaged",
23
- resolution_step: "Please repair/replace the missing/damaged shutter(s) in the next 20 days",
24
- days_to_cure: 20
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: "Mailbox is damaged",
28
- resolution_step: "Please repair/replace the damaged mailbox in the next 20 days",
29
- days_to_cure: 20
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: "Mailbox needs to be painted",
33
- resolution_step: "Please paint your mailbox in the next 20 days",
34
- days_to_cure: 20
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: "Garage door damaged",
38
- resolution_step: "Please repair/replace the garage door in the next 20 days",
39
- days_to_cure: 20
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: "Fence damaged",
43
- resolution_step: "Please repair the damaged fence in the next 20 days",
44
- days_to_cure: 20
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: "Trim on home needs to be painted",
48
- resolution_step: "Please paint the trim on your home in the next 20 days",
49
- days_to_cure: 20
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: 2,
55
- title: "ARC",
56
+ article: 2,
57
+ title: 'ARC',
56
58
  violation_types_attributes: [
57
59
  {
58
- title: "Unapproved structure",
59
- resolution_step: "Please submit an ARC form in the next 10 days",
60
- days_to_cure: 10
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: 3,
66
- title: "Improper Storage",
67
+ article: 3,
68
+ title: 'Improper Storage',
67
69
  violation_types_attributes: [
68
70
  {
69
- title: "Basketball goal",
70
- resolution_step: "Please properly store your basketball goal when not in use",
71
- days_to_cure: nil
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: "Garbage can(s) in view from street",
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: nil
79
+ days_to_cure: nil
78
80
  },
79
81
  {
80
- title: "Improperly stored item(s) around home",
81
- resolution_step: "Please properly store all item(s) in the next 5 days",
82
- days_to_cure: 5
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: 4,
88
- title: "Vehicles",
89
+ article: 4,
90
+ title: 'Vehicles',
89
91
  violation_types_attributes: [
90
92
  {
91
- title: "Vehicle(s) parked in grass",
92
- resolution_step: "Please refrain from parking in the grassy areas of the community",
93
- days_to_cure: nil
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: "Inoperable vehicle at residence",
97
- resolution_step: "Please repair/properly register your vehicle in the next 10 days",
98
- days_to_cure: 10
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: "Trailer at residence",
102
- resolution_step: "Please remove the trailer from the community in the next 5 days",
103
- days_to_cure: 5
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: "Boat at residence",
107
- resolution_step: "Please remove the boat from the community in the next 5 days",
108
- days_to_cure: 5
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: 5,
114
- title: "Lawn Maintenance",
115
+ article: 5,
116
+ title: 'Lawn Maintenance',
115
117
  violation_types_attributes: [
116
118
  {
117
- title: "High grass",
118
- resolution_step: "Please mow your lawn in the next 7 days",
119
- days_to_cure: 7
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: "Weeds in lawn",
123
- resolution_step: "Please treat the weeds in your lawn in the next 15 days",
124
- days_to_cure: 15
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: "Weeds in landscaping bed(s)",
128
- resolution_step: "Please treat the weeds in your landscaping bed(s) in the next 15 days",
129
- days_to_cure: 15
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: "Bare spot(s) in lawn",
133
- resolution_step: "Please treat the bare spot(s) in your lawn in the next 15 days",
134
- days_to_cure: 15
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: "Rut in lawn",
138
- resolution_step: "Please fill in the rut in your lawn in the next 15 days",
139
- days_to_cure: 15
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: "Overgrown Shrub(s)",
143
- resolution_step: "Please trim your shrub(s) in the next 10 days",
144
- days_to_cure: 10
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: "Article & VT test", parent_id: parent.id)
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: "Description here!",
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 |vt, i|
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
@@ -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["association_name"])
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["phone_numbers"].split("|"),
40
- emails: row["emails"].split("|"),
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["external_id"])
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["external_id"] + "WithAChange"
56
+ new_external_id = row['external_id'] + 'WithAChange'
57
57
  found.external_id = new_external_id
58
58
  assert(found.save)
59
59
 
@@ -18,7 +18,7 @@ def assert(bool)
18
18
  print "\e[32m.\e[0m"
19
19
  else
20
20
  puts "\e[31m"
21
- puts "FAILED"
21
+ puts 'FAILED'
22
22
  puts caller
23
23
  print "\e[0m"
24
24
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HOALife
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
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.5
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-05-06 00:00:00.000000000 Z
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