pvoutput 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/gem-push.yaml +29 -0
- data/.github/workflows/ruby.yml +30 -0
- data/.rubocop.yml +14 -5
- data/CHANGELOG.md +8 -0
- data/Gemfile +2 -0
- data/README.md +2 -2
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/pvoutput.rb +2 -0
- data/lib/pvoutput/client.rb +7 -7
- data/lib/pvoutput/version.rb +3 -1
- data/pvoutput.gemspec +10 -7
- metadata +17 -15
- data/circle.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 335a39d8597c2d72545424953282c5325c677ba7c8c8529ef58a66157088e9b1
|
4
|
+
data.tar.gz: a7eb5913ea1960036f4c8bdb3f3c4523674c69e1bccb23756c4b037d48a866ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d5a1e4180ba44bec0fb0e3aed3facf13d40d959a55b13104852b9b070336935228e7dec82bded26ac0989abb72b35d6798325dc99fdc884d6e35920290aa444
|
7
|
+
data.tar.gz: e93c15e6e04f3421b4bc50b47e2ee2e30b846b5f11f333ff2b4d2866b811c2d06de83434ab9daaac25db764be7bbc00a5c09c4a7c5139131074db29a8f109864
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Set update schedule for GitHub Actions
|
2
|
+
version: 2
|
3
|
+
updates:
|
4
|
+
- package-ecosystem: "github-actions"
|
5
|
+
directory: "/"
|
6
|
+
schedule:
|
7
|
+
interval: "weekly"
|
8
|
+
day: "saturday"
|
9
|
+
|
10
|
+
- package-ecosystem: "bundler"
|
11
|
+
directory: "/"
|
12
|
+
schedule:
|
13
|
+
interval: "weekly"
|
14
|
+
day: "saturday"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [ published ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.6
|
15
|
+
uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: 2.6
|
18
|
+
|
19
|
+
- name: Install dependencies
|
20
|
+
run: bundle install
|
21
|
+
- name: Publish to RubyGems
|
22
|
+
run: |
|
23
|
+
mkdir -p $HOME/.gem
|
24
|
+
touch $HOME/.gem/credentials
|
25
|
+
chmod 0600 $HOME/.gem/credentials
|
26
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
27
|
+
rake release
|
28
|
+
env:
|
29
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
schedule:
|
9
|
+
- cron: '0 1 * * SUN'
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby-version: [ '2.5', '2.6', '2.7', '3.0', 'ruby-head' ]
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Setup ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby-version }}
|
24
|
+
bundler-cache: true
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Lint files
|
28
|
+
run: bundle exec rubocop
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require: rubocop-rspec
|
2
2
|
|
3
|
-
|
3
|
+
AllCops:
|
4
|
+
NewCops: enable
|
5
|
+
|
6
|
+
Style/HashSyntax:
|
4
7
|
EnforcedStyle: hash_rockets
|
5
8
|
|
6
9
|
Style/Documentation:
|
@@ -9,13 +12,16 @@ Style/Documentation:
|
|
9
12
|
Style/Lambda:
|
10
13
|
Enabled: false
|
11
14
|
|
12
|
-
Style/
|
13
|
-
EnforcedStyleForMultiline:
|
15
|
+
Style/TrailingCommaInArrayLiteral:
|
16
|
+
EnforcedStyleForMultiline: consistent_comma
|
17
|
+
|
18
|
+
Style/TrailingCommaInHashLiteral:
|
19
|
+
EnforcedStyleForMultiline: consistent_comma
|
14
20
|
|
15
21
|
Metrics/MethodLength:
|
16
22
|
Max: 20
|
17
23
|
|
18
|
-
|
24
|
+
Layout/LineLength:
|
19
25
|
Max: 120
|
20
26
|
|
21
27
|
RSpec/ExampleLength:
|
@@ -24,5 +30,8 @@ RSpec/ExampleLength:
|
|
24
30
|
Style/ModuleFunction:
|
25
31
|
Enabled: false
|
26
32
|
|
27
|
-
|
33
|
+
Layout/HashAlignment:
|
28
34
|
EnforcedHashRocketStyle: table
|
35
|
+
|
36
|
+
Style/OptionalBooleanParameter:
|
37
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 0.6.0 (2021-02-06)
|
4
|
+
|
5
|
+
This test has no code changes but tests the new release process.
|
6
|
+
|
7
|
+
* Move tests from CircleCI to GitHub Actions (@johnf)
|
8
|
+
* Keep an eye on dependencies with Dependabot (@jwillemsen)
|
9
|
+
* Schedule regular tests against multiple rubys (@jwillemsen)
|
10
|
+
|
3
11
|
# 0.5.0 (2020-09-20)
|
4
12
|
|
5
13
|
* Add more detail to error messages (@jwillemsen)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PVOutput
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Actions Status](https://github.com/johnf/pvoutput/workflows/Test/badge.svg)](https://github.com/johnf/pvoutput/actions)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/johnf/pvoutput/badge.svg?branch=master&service=github)](https://coveralls.io/github/johnf/pvoutput?branch=master)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/pvoutput.svg)](http://badge.fury.io/rb/pvoutput)
|
6
6
|
|
@@ -151,7 +151,7 @@ client.add_output(
|
|
151
151
|
|
152
152
|
## Debugging
|
153
153
|
|
154
|
-
You can
|
154
|
+
You can enable HTTParty debugging to see the requests by setting `PVOUTPUT_DEBUG=true`
|
155
155
|
|
156
156
|
## Development
|
157
157
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/lib/pvoutput.rb
CHANGED
data/lib/pvoutput/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'httparty'
|
2
4
|
|
3
5
|
module PVOutput
|
@@ -84,18 +86,17 @@ module PVOutput
|
|
84
86
|
end
|
85
87
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
86
88
|
|
87
|
-
# rubocop:disable Metrics/AbcSize
|
88
89
|
def add_batch_output(options)
|
89
|
-
keys = %i
|
90
|
-
keys += %i
|
91
|
-
keys += %i
|
92
|
-
keys += %i
|
90
|
+
keys = %i[energy_generated energy_export energy_used]
|
91
|
+
keys += %i[peak_power peak_time condition min_temp]
|
92
|
+
keys += %i[max_temp comments import_peak import_off_peak]
|
93
|
+
keys += %i[import_shoulder]
|
93
94
|
|
94
95
|
options.to_a.each_slice(@batch_size) do |slice|
|
95
96
|
data = ''
|
96
97
|
slice.each do |entry|
|
97
98
|
date, values = entry
|
98
|
-
data += "#{date}
|
99
|
+
data += "#{date},#{keys.map { |key| values[key] }.join(',')};"
|
99
100
|
end
|
100
101
|
|
101
102
|
params = {
|
@@ -105,6 +106,5 @@ module PVOutput
|
|
105
106
|
post_request('/service/r2/addbatchoutput.jsp', :body => params)
|
106
107
|
end
|
107
108
|
end
|
108
|
-
# rubocop:enable Metrics/AbcSize
|
109
109
|
end
|
110
110
|
end
|
data/lib/pvoutput/version.rb
CHANGED
data/pvoutput.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'pvoutput/version'
|
5
6
|
|
@@ -18,16 +19,18 @@ Gem::Specification.new do |spec|
|
|
18
19
|
spec.require_paths = ['lib']
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
21
|
|
22
|
+
spec.required_ruby_version = '>= 2.4'
|
23
|
+
|
21
24
|
spec.add_dependency 'httparty'
|
22
25
|
|
23
26
|
spec.add_development_dependency 'bundler', '>= 2.1'
|
24
|
-
spec.add_development_dependency '
|
27
|
+
spec.add_development_dependency 'coveralls'
|
25
28
|
spec.add_development_dependency 'pry'
|
29
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
26
30
|
spec.add_development_dependency 'rspec'
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency 'timecop'
|
31
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
29
32
|
spec.add_development_dependency 'rubocop'
|
30
33
|
spec.add_development_dependency 'rubocop-rspec'
|
31
|
-
spec.add_development_dependency '
|
32
|
-
spec.add_development_dependency '
|
34
|
+
spec.add_development_dependency 'timecop'
|
35
|
+
spec.add_development_dependency 'webmock'
|
33
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pvoutput
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ferlito
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,21 +67,21 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 12.3.3
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 12.3.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rspec_junit_formatter
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: timecop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: webmock
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
@@ -171,6 +171,9 @@ executables: []
|
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
|
+
- ".github/dependabot.yml"
|
175
|
+
- ".github/workflows/gem-push.yaml"
|
176
|
+
- ".github/workflows/ruby.yml"
|
174
177
|
- ".gitignore"
|
175
178
|
- ".rspec"
|
176
179
|
- ".rubocop.yml"
|
@@ -182,7 +185,6 @@ files:
|
|
182
185
|
- Rakefile
|
183
186
|
- bin/console
|
184
187
|
- bin/setup
|
185
|
-
- circle.yml
|
186
188
|
- lib/pvoutput.rb
|
187
189
|
- lib/pvoutput/client.rb
|
188
190
|
- lib/pvoutput/version.rb
|
@@ -199,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
199
201
|
requirements:
|
200
202
|
- - ">="
|
201
203
|
- !ruby/object:Gem::Version
|
202
|
-
version: '
|
204
|
+
version: '2.4'
|
203
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
206
|
requirements:
|
205
207
|
- - ">="
|
206
208
|
- !ruby/object:Gem::Version
|
207
209
|
version: '0'
|
208
210
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.0.3
|
210
212
|
signing_key:
|
211
213
|
specification_version: 4
|
212
214
|
summary: Library to speak to the PVOutput API
|