parliamentarian 0.8.8 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8b5a3028c73a5863acb868b3f12ef9b945f484b3c69f590d4f25154a911a3fa
4
- data.tar.gz: 15f40db79771b83704c75c328503dd5686af7a6aaba4be5ea34af008788a43c2
3
+ metadata.gz: abc1c18e10a9b730253ef89418b8a41f23a536abb4cc71bf92994cd3ee00b036
4
+ data.tar.gz: a0ab9f0d96adcb030c7bdd137d055b3445767f46c5945c9778fca790ba55b00d
5
5
  SHA512:
6
- metadata.gz: 8f1d8013a232ea47b941e881c0a8df3f2eeb0dbcc87342978aec8b3b33841c1ec0214f25403af7dc797cac1ad3391cdabd4df2a2cd07ee12fb95e61467be3c2e
7
- data.tar.gz: a2ab3ac29a7cf2469da5b483bcd383cdc3f396d50cb25a2fcbdc5374986dc9897231a2ac853241694708f1e73d16c26bbccaaf87af5f9c6cb4963ec3f1b09e0a
6
+ metadata.gz: eefa05d120b1e295ed88ef26a9890d95506bacb6b0d7bd4c50ad3cdd13addb8bc0aab8b640641de8edcb44ed42027591a8ee13a10241c03ac3826d18e5e29eae
7
+ data.tar.gz: 9263f573247b1ab11f0c21c7b8aa8c5c8dc37ac98a4015cde228d92e1d336f1367d2f091b2057e1a0ab832ee5cd30bc36fdd61b64d8695e05eee8f734c5bf017
data/CHANGELOG ADDED
@@ -0,0 +1,38 @@
1
+ # CHANGELOG
2
+
3
+ ## 20260913
4
+
5
+ 0.9.0: + README.md, CHANGELOG, Rakefile.
6
+
7
+ 1. + README.md: what the library does, the two parliaments it covers, the method per chamber, and that a row's attributes are the CSV's own headings underscored. 31 of the 32 gems here carry one and this was the exception.
8
+ 2. + CHANGELOG: this file. The commit subjects name a version from 0.8.6 back; before that the history is the import of 20210408 and says nothing about releases.
9
+ 3. + Rakefile: a rake/testtask naming test/Parliamentarian/**/*.rb. The tests carry no _test suffix, so the usual glob finds nothing, and they are named directly rather than through test/Parliamentarian.rb: that runner shares its name with the library, so requiring it under rake's loader makes `require 'Parliamentarian'` from within a test resolve back to the runner which is still loading, and the constant is never defined.
10
+ 4. ~ parliamentarian.gemspec: + 'CHANGELOG', 'README.md' and 'Rakefile' to spec.files, without which the three sit in the repository and the gem does not carry them; and the list reordered, the gemspec first and then the globs and the rest alphabetically, which is how the estate writes it.
11
+ 5. ~ Parliamentarian::VERSION: /0.8.8/0.9.0/
12
+
13
+ 0.8.8: ~ test/Parliamentarian/Australia/Victoria.rb: the council stub returned the assembly's rows.
14
+
15
+
16
+ ## 20260911
17
+
18
+ 0.8.7: ~ lib/Parliamentarian.rb: + require of Parliamentarian/VERSION; ~ VERSION.rb: /class/module/, the library declaring a module; + test/Parliamentarian/VERSION.rb
19
+
20
+
21
+ ## 20260822
22
+
23
+ 0.8.6: + LICENSE, and the gemspec: /Ruby/MIT/, - spec.date.
24
+
25
+ 1. ~ parliamentarian.gemspec: /Ruby/MIT/, it having named a licence the repository never carried; - spec.date, which rubygems sets from the build.
26
+ 2. + .gitignore, for .DS_Store and *.gem, and - lib/.DS_Store and the four under test/. Both 20210409, the day after 0.8.5, and recorded here as the first versioned commit after them.
27
+ 3. ~ Parliamentarian::VERSION: /0.8.5/0.8.6/
28
+
29
+
30
+ ## 20210408
31
+
32
+ 0.8.5: + VERSION, the gemspec, and the required lib files; ~ Gemfile: + webmock.
33
+
34
+ 1. + VERSION file.
35
+ 2. + parliamentarian.gemspec.
36
+ 3. ~ Gemfile to include webmock.
37
+ 4. + required lib files, to be broken out later.
38
+ 5. Taken from lib/parliamentarian.rb's in-source change log, items 10 to 13 under its 4/5 marker.
data/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # Parliamentarian
2
+
3
+ ## Description
4
+
5
+ Download and parse the current list of members of parliament, and their contact
6
+ details, from the parliaments which publish one as a CSV.
7
+
8
+ Two are covered so far: the federal parliament of Australia, and the parliament of
9
+ the State of Victoria. Each chamber is a method, and each row comes back as an
10
+ object whose attributes are the column headings underscored, so a CSV which gains
11
+ a column gains an attribute without anything here being changed.
12
+
13
+ ## Installation
14
+
15
+ ### 0. Have a recent version of Ruby installed
16
+
17
+ ### 1. Via RubyGems
18
+
19
+ ```shell
20
+ $ gem install parliamentarian
21
+ ```
22
+
23
+ Or in a Gemfile:
24
+
25
+ ```ruby
26
+ gem 'parliamentarian'
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ### Australia, federally
32
+
33
+ ```ruby
34
+ require 'parliamentarian'
35
+
36
+ Parliamentarian::Australia::Federal.senators
37
+ # => [#<Parliamentarian::Australia::Federal>, ...], the Senate
38
+
39
+ Parliamentarian::Australia::Federal.members
40
+ # => [#<Parliamentarian::Australia::Federal>, ...], the House of Representatives
41
+
42
+ Parliamentarian::Australia::Federal.all
43
+ # => both chambers together
44
+ ```
45
+
46
+ ### Victoria
47
+
48
+ ```ruby
49
+ Parliamentarian::Australia::Victoria.legislative_councillors
50
+ # => [#<Parliamentarian::Australia::Victoria>, ...], the upper house
51
+
52
+ Parliamentarian::Australia::Victoria.legislative_assemblymembers
53
+ # => [#<Parliamentarian::Australia::Victoria>, ...], the lower house
54
+
55
+ Parliamentarian::Australia::Victoria.all
56
+ # => both houses together
57
+ ```
58
+
59
+ ### A member
60
+
61
+ The attributes are the CSV's own column headings, underscored:
62
+
63
+ ```ruby
64
+ member = Parliamentarian::Australia::Victoria.legislative_councillors.first
65
+
66
+ member.last_name # => "Smith"
67
+ member.preferred_name # => "Jane"
68
+ member.electorate # => "Southern Metropolitan"
69
+ member.party # => "Australian Labor Party"
70
+ member.eo_postcode # => "3000", taken from the electorate office address
71
+ ```
72
+
73
+ `first_name`, `firstname`, `lastname` and `surname` are aliases, the two
74
+ parliaments not agreeing on which of them to publish.
75
+
76
+ ### Reading from a file rather than the web
77
+
78
+ Each method takes a path, which is what the tests use and what a cached copy
79
+ wants:
80
+
81
+ ```ruby
82
+ Parliamentarian::Australia::Victoria.legislative_councillors('councilmembers.csv')
83
+ Parliamentarian::Australia::Victoria.all('councilmembers.csv', 'assemblymembers.csv')
84
+ ```
85
+
86
+ A path is read from disk and anything with an `http` or `https` scheme is
87
+ fetched, so the same method serves both.
88
+
89
+ ## Contributing
90
+
91
+ 1. Fork it: `https://github.com/thoran/Parliamentarian/fork`
92
+ 2. Create your feature branch: `git checkout -b my-new-feature`
93
+ 3. Commit your changes: `git commit -am 'Add some feature'`
94
+ 4. Push to the branch: `git push origin my-new-feature`
95
+ 5. Create a new pull request
96
+
97
+ ## License
98
+
99
+ MIT
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # Rakefile
2
+
3
+ require 'rake/testtask'
4
+
5
+ # The tests carry no _test suffix, so the usual glob finds nothing, and they are
6
+ # named directly rather than through test/Parliamentarian.rb: that runner shares
7
+ # its name with the library, so requiring it under rake's loader makes
8
+ # `require 'Parliamentarian'` from within a test resolve back to the runner which
9
+ # is still loading. Each test puts lib on the load path for itself.
10
+ Rake::TestTask.new(:test) do |t|
11
+ t.test_files = FileList['test/Parliamentarian/**/*.rb']
12
+ end
13
+
14
+ task default: :test
@@ -1,5 +1,5 @@
1
1
  module Parliamentarian
2
2
 
3
- VERSION = '0.8.8'
3
+ VERSION = '0.9.0'
4
4
 
5
5
  end
@@ -14,11 +14,14 @@ Gem::Specification.new do |spec|
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = [
17
+ 'parliamentarian.gemspec',
17
18
  Dir['lib/**/*.rb'],
18
19
  Dir['test/**/*.rb'],
20
+ 'CHANGELOG',
19
21
  'Gemfile',
20
22
  'LICENSE',
21
- 'parliamentarian.gemspec',
23
+ 'README.md',
24
+ 'Rakefile',
22
25
  ].flatten
23
26
  spec.required_ruby_version = '>= 2.5'
24
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliamentarian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -59,8 +59,11 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - CHANGELOG
62
63
  - Gemfile
63
64
  - LICENSE
65
+ - README.md
66
+ - Rakefile
64
67
  - lib/Array/blankQ.rb
65
68
  - lib/Array/extract_optionsX.rb
66
69
  - lib/Array/peek_options.rb