green-button-data 0.1.0

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.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +11 -0
  5. data/Guardfile +50 -0
  6. data/LICENSE.txt +26 -0
  7. data/README.md +72 -0
  8. data/Rakefile +5 -0
  9. data/green-button-data.gemspec +24 -0
  10. data/lib/green-button-data/core_ext/date.rb +9 -0
  11. data/lib/green-button-data/core_ext/fixnum.rb +10 -0
  12. data/lib/green-button-data/core_ext.rb +2 -0
  13. data/lib/green-button-data/dst.rb +49 -0
  14. data/lib/green-button-data/enumerations.rb +523 -0
  15. data/lib/green-button-data/feed.rb +7 -0
  16. data/lib/green-button-data/parser/application_information.rb +180 -0
  17. data/lib/green-button-data/parser/authorization.rb +45 -0
  18. data/lib/green-button-data/parser/content.rb +36 -0
  19. data/lib/green-button-data/parser/entry.rb +47 -0
  20. data/lib/green-button-data/parser/feed.rb +47 -0
  21. data/lib/green-button-data/parser/interval.rb +32 -0
  22. data/lib/green-button-data/parser/interval_block.rb +32 -0
  23. data/lib/green-button-data/parser/interval_reading.rb +30 -0
  24. data/lib/green-button-data/parser/local_time_parameters.rb +105 -0
  25. data/lib/green-button-data/parser/rational_number.rb +22 -0
  26. data/lib/green-button-data/parser/reading_type.rb +134 -0
  27. data/lib/green-button-data/parser/service_category.rb +17 -0
  28. data/lib/green-button-data/parser/usage_point.rb +20 -0
  29. data/lib/green-button-data/parser.rb +2 -0
  30. data/lib/green-button-data/utilities.rb +106 -0
  31. data/lib/green-button-data/version.rb +3 -0
  32. data/lib/green-button-data.rb +24 -0
  33. data/spec/fixtures/ESPIApplicationInformation.xml +49 -0
  34. data/spec/fixtures/ESPIAuthorization.xml +25 -0
  35. data/spec/fixtures/ESPIIntervalBlock.xml +3814 -0
  36. data/spec/fixtures/ESPILocalTimeParameters.xml +16 -0
  37. data/spec/fixtures/ESPIReadingType.xml +535 -0
  38. data/spec/fixtures/ESPIUsagePoint.xml +18 -0
  39. data/spec/fixtures.rb +22 -0
  40. data/spec/green-button-data/core_ext/date_spec.rb +18 -0
  41. data/spec/green-button-data/core_ext/fixnum_spec.rb +13 -0
  42. data/spec/green-button-data/parser/application_information_spec.rb +154 -0
  43. data/spec/green-button-data/parser/authorization_spec.rb +52 -0
  44. data/spec/green-button-data/parser/interval_block_spec.rb +39 -0
  45. data/spec/green-button-data/parser/local_time_parameter_spec.rb +56 -0
  46. data/spec/green-button-data/parser/reading_type_spec.rb +76 -0
  47. data/spec/green-button-data/parser/usage_point_spec.rb +22 -0
  48. data/spec/green-button-data/utilities_spec.rb +63 -0
  49. data/spec/spec_helper.rb +20 -0
  50. data/spec/support/custom_expectations/warn_expectation.rb +31 -0
  51. metadata +148 -0
@@ -0,0 +1,24 @@
1
+ require 'sax-machine'
2
+
3
+ require 'green-button-data/core_ext'
4
+ require 'green-button-data/dst'
5
+ require 'green-button-data/enumerations'
6
+ require 'green-button-data/utilities'
7
+ require 'green-button-data/parser'
8
+ require 'green-button-data/parser/rational_number'
9
+ require 'green-button-data/parser/interval'
10
+ require 'green-button-data/parser/interval_reading'
11
+ require 'green-button-data/parser/interval_block'
12
+ require 'green-button-data/parser/authorization'
13
+ require 'green-button-data/parser/application_information'
14
+ require 'green-button-data/parser/service_category'
15
+ require 'green-button-data/parser/local_time_parameters'
16
+ require 'green-button-data/parser/reading_type'
17
+ require 'green-button-data/parser/usage_point'
18
+ require 'green-button-data/parser/content'
19
+ require 'green-button-data/parser/entry'
20
+ require 'green-button-data/parser/feed'
21
+ require 'green-button-data/feed'
22
+
23
+ module GreenButtonData
24
+ end
@@ -0,0 +1,49 @@
1
+ <entry xmlns:espi="http://naesb.org/espi" xmlns="http://www.w3.org/2005/Atom">
2
+ <id>urn:uuid:af6e8b03-0299-467e-972a-a883ecdcc575</id>
3
+ <link href="https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/ApplicationInformation" rel="up"/>
4
+ <link href="https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/ApplicationInformation/2" rel="self"/>
5
+ <title>GreenButtonData.org ThirdParty Application</title>
6
+ <content>
7
+ <espi:ApplicationInformation>
8
+ <espi:dataCustodianId>data_custodian</espi:dataCustodianId>
9
+ <espi:dataCustodianApplicationStatus>1</espi:dataCustodianApplicationStatus>
10
+ <espi:thirdPartyApplicationDescription>EnergyOS OpenESPI Example Third Party</espi:thirdPartyApplicationDescription>
11
+ <espi:thirdPartyApplicationStatus>1</espi:thirdPartyApplicationStatus>
12
+ <espi:thirdPartyApplicationType>1</espi:thirdPartyApplicationType>
13
+ <espi:thirdPartyApplicationUse>1</espi:thirdPartyApplicationUse>
14
+ <espi:authorizationServerUri>https://services.greenbuttondata.org//DataCustodian/</espi:authorizationServerUri>
15
+ <espi:thirdPartyNotifyUri>https://services.greenbuttondata.org/ThirdParty/espi/1_1/Notification</espi:thirdPartyNotifyUri>
16
+ <espi:authorizationServerAuthorizationEndpoint>https://services.greenbuttondata.org//DataCustodian/oauth/authorize</espi:authorizationServerAuthorizationEndpoint>
17
+ <espi:authorizationServerRegistrationEndpoint>https://services.greenbuttondata.org//DataCustodian/espi/1_1/register</espi:authorizationServerRegistrationEndpoint>
18
+ <espi:authorizationServerTokenEndpoint>https://services.greenbuttondata.org//DataCustodian/oauth/token</espi:authorizationServerTokenEndpoint>
19
+ <espi:dataCustodianBulkRequestURI>https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/Batch/Bulk</espi:dataCustodianBulkRequestURI>
20
+ <espi:dataCustodianResourceEndpoint>https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource</espi:dataCustodianResourceEndpoint>
21
+ <espi:thirdPartyScopeSelectionScreenURI>https://services.greenbuttondata.org/ThirdParty/RetailCustomer/ScopeSelection</espi:thirdPartyScopeSelectionScreenURI>
22
+ <espi:thirdPartyUserPortalScreenURI>https://services.greenbuttondata.org/ThirdParty</espi:thirdPartyUserPortalScreenURI>
23
+ <espi:client_secret>secret</espi:client_secret>
24
+ <espi:logo_uri>https://services.greenbuttondata.org/ThirdParty/resources/ico/favicon.png</espi:logo_uri>
25
+ <espi:client_name>Green Button Third Party</espi:client_name>
26
+ <espi:client_uri>https://services.greenbuttondata.org/ThirdParty</espi:client_uri>
27
+ <espi:redirect_uri>https://services.greenbuttondata.org/ThirdParty/espi/1_1/OAuthCallBack</espi:redirect_uri>
28
+ <espi:client_id>third_party</espi:client_id>
29
+ <espi:software_id>EnergyOS OpenESPI Example Third Party</espi:software_id>
30
+ <espi:software_version>1.2</espi:software_version>
31
+ <espi:client_id_issued_at>1403190000</espi:client_id_issued_at>
32
+ <espi:client_secret_expires_at>0</espi:client_secret_expires_at>
33
+ <espi:contacts>john.teeter@energyos.org,martin.burns@nist.gov,donald.coffin@reminetworks.com</espi:contacts>
34
+ <espi:token_endpoint_auth_method>client_secret_basic</espi:token_endpoint_auth_method>
35
+ <espi:scope>FB=1_3_4_5_13_14_39;IntervalDuration=3600;BlockDuration=monthly;HistoryLength=13</espi:scope>
36
+ <espi:scope>FB=1_3_4_5_13_14_15_39;IntervalDuration=900;BlockDuration=monthly;HistoryLength=13</espi:scope>
37
+ <espi:scope>FB=1_3_4_5_6_7_8_9_10_11_29_12_13_14_15_16_17_18_19_27_28_32_33_34_35_37_38_39_40_41_44;IntervalDuration=3600;BlockDuration=monthly;HistoryLength=13</espi:scope>
38
+ <espi:grant_types>authorization_code</espi:grant_types>
39
+ <espi:grant_types>client_credentials</espi:grant_types>
40
+ <espi:grant_types>refresh_token</espi:grant_types>
41
+ <espi:response_types>token</espi:response_types>
42
+ <espi:registration_client_uri>https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/ApplicationInformation/2</espi:registration_client_uri>
43
+ <espi:registration_access_token>d89bb056-0f02-4d47-9fd2-ec6a19ba8d0c</espi:registration_access_token>
44
+ <espi:dataCustodianScopeSelectionScreenURI>https://services.greenbuttondata.org//DataCustodian/RetailCustomer/ScopeSelectionList?ThirdPartyID=third_party</espi:dataCustodianScopeSelectionScreenURI>
45
+ </espi:ApplicationInformation>
46
+ </content>
47
+ <published>2014-01-02T10:00:00Z</published>
48
+ <updated>2014-01-02T10:00:00Z</updated>
49
+ </entry>
@@ -0,0 +1,25 @@
1
+ <entry xmlns:espi="http://naesb.org/espi" xmlns="http://www.w3.org/2005/Atom">
2
+ <id>urn:uuid:403cba0c-46f5-4e64-816c-5d11c06deb7a</id>
3
+ <link href="https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/Authorization" rel="up"/>
4
+ <link href="https://services.greenbuttondata.org//DataCustodian/espi/1_1/resource/Authorization/4" rel="self"/>
5
+ <content>
6
+ <espi:Authorization>
7
+ <espi:authorizedPeriod>
8
+ <espi:duration>0</espi:duration>
9
+ <espi:start>0</espi:start>
10
+ </espi:authorizedPeriod>
11
+ <espi:publishedPeriod>
12
+ <espi:duration>0</espi:duration>
13
+ <espi:start>0</espi:start>
14
+ </espi:publishedPeriod>
15
+ <espi:status>1</espi:status>
16
+ <espi:expires_at>1747076581</espi:expires_at>
17
+ <espi:scope>FB=36_40</espi:scope>
18
+ <espi:token_type>Bearer</espi:token_type>
19
+ <espi:resourceURI>https://services.greenbuttondata.org/DataCustodian/espi/1_1/resource/ApplicationInformation/2</espi:resourceURI>
20
+ <espi:authorizationURI>https://services.greenbuttondata.org/DataCustodian/espi/1_1/resource/Authorization/4</espi:authorizationURI>
21
+ </espi:Authorization>
22
+ </content>
23
+ <published>2015-05-15T19:03:02Z</published>
24
+ <updated>2015-05-15T19:03:02Z</updated>
25
+ </entry>