legistar 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2b81238ef90e9f6ad5449481deabe442229c15487001728050f9f14cd722a3dc
4
+ data.tar.gz: b1c2e16056f0a34806ec5ce02486f6faaee60acfa6a48d80ca2dbccb499940c1
5
+ SHA512:
6
+ metadata.gz: 6f701de397e728f0e4fdfb786bd08d5bea40b484365575f80862ea13fa677e315c45b36fe69c97301fa504e1fc8e94171d79f940ed399a67dc4717c39addbbd5
7
+ data.tar.gz: f5b8a4a19850e28dae356f143a6346407c3c2acde12e3c826d70538ae7639ae38f7b7b9f013c6df2dd85d29c14fa5d6d22946ec40b61eb684d206d59a7f39615
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in legistar.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ legistar (0.0.1)
5
+ httparty
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ httparty (0.16.3)
13
+ mime-types (~> 3.0)
14
+ multi_xml (>= 0.5.2)
15
+ method_source (0.9.2)
16
+ mime-types (3.2.2)
17
+ mime-types-data (~> 3.2015)
18
+ mime-types-data (3.2018.0812)
19
+ multi_xml (0.6.0)
20
+ pry (0.12.2)
21
+ coderay (~> 1.1.0)
22
+ method_source (~> 0.9.0)
23
+ rake (10.5.0)
24
+ rspec (3.8.0)
25
+ rspec-core (~> 3.8.0)
26
+ rspec-expectations (~> 3.8.0)
27
+ rspec-mocks (~> 3.8.0)
28
+ rspec-core (3.8.0)
29
+ rspec-support (~> 3.8.0)
30
+ rspec-expectations (3.8.2)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.8.0)
33
+ rspec-mocks (3.8.0)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-support (3.8.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ bundler (~> 1.16)
43
+ legistar!
44
+ pry
45
+ rake (~> 10.0)
46
+ rspec (~> 3.0)
47
+
48
+ BUNDLED WITH
49
+ 1.16.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Ryan Wold
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # Legistar
2
+
3
+ This .gem is for interacting with the [Legistar API](https://webapi.legistar.com/Help).
4
+
5
+ ## Installation
6
+
7
+ To install the `legistar` .gem, add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'legistar'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install legistar
20
+
21
+ ## Usage
22
+
23
+ See [/specs](/spec/legistar/bodies_spec.rb) for examples, like:
24
+
25
+ ```ruby
26
+ client = Legistar::Bodies.new(host: "mesa")
27
+ client.get("362") # => returns a specific Governing Body from Mesa
28
+ ```
29
+
30
+ ## Development
31
+
32
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
+
34
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
35
+
36
+ #### Publishing the gem
37
+
38
+ Assumptions:
39
+
40
+ * VERSION.rb has been updated
41
+ * User has access to Rubygems, if publishing.
42
+
43
+ 1. Run `gem build legistar.gemspec` to build `legistar-0.x.x.gem`
44
+ 1. Run `gem push legistar-0.x.x.gem` to publish the .gem to [Rubygems](https://wwww.rubygems.org)
45
+
46
+ ## Contributing
47
+
48
+ Bug reports and pull requests (with tests/specs) are welcome on GitHub at https://github.com/afomi/legistar.
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "legistar"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/legistar.gemspec ADDED
@@ -0,0 +1,44 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "legistar/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "legistar"
8
+ spec.version = Legistar::VERSION
9
+ spec.authors = ["Ryan Wold"]
10
+ spec.email = ["wold@afomi.com"]
11
+
12
+ spec.summary = "A .gem to interact with the Legistar WebApi"
13
+ spec.description = "A .gem to interact with the Legistar WebApi"
14
+ spec.homepage = "https://github.com/afomi/legistar"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ spec.metadata["source_code_uri"] = "https://github.com/afomi/legistar"
24
+ spec.metadata["changelog_uri"] = "https://github.com/afomi/legistar"
25
+ else
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
+ end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ spec.bindir = "exe"
36
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.require_paths = ["lib"]
38
+
39
+ spec.add_development_dependency "bundler", "~> 1.16"
40
+ spec.add_development_dependency "rake", "~> 10.0"
41
+ spec.add_development_dependency "rspec", "~> 3.0"
42
+ spec.add_development_dependency "pry"
43
+ spec.add_dependency "httparty"
44
+ end
data/lib/legistar.rb ADDED
@@ -0,0 +1,81 @@
1
+ require "httparty"
2
+ require "legistar/version"
3
+ require "legistar/actions"
4
+ require "legistar/bodies"
5
+ # require "pry" # Note: Helpful during development
6
+
7
+ module Legistar
8
+ include HTTParty
9
+ base_uri 'webapi.legistar.com'
10
+
11
+ attr_accessor :host
12
+
13
+ class WebApi
14
+ def initialize(host:)
15
+ @host = host
16
+ end
17
+ end
18
+
19
+ class BodyTypes
20
+ end
21
+
22
+ class CodeSections
23
+ end
24
+
25
+ class EventItems
26
+ end
27
+
28
+ class Events
29
+ end
30
+
31
+ class Indexes
32
+ end
33
+
34
+ class MatterAttachments
35
+ end
36
+
37
+ class MatterCodeSections
38
+ end
39
+
40
+ class MatterHistories
41
+ end
42
+
43
+ class MatterIndexes
44
+ end
45
+
46
+ class MatterRelations
47
+ end
48
+
49
+ class MatterRequesters
50
+ end
51
+
52
+ class Matters
53
+ end
54
+
55
+ class MatterSponsors
56
+ end
57
+
58
+ class MatterStatuses
59
+ end
60
+
61
+ class MatterTexts
62
+ end
63
+
64
+ class MatterTypes
65
+ end
66
+
67
+ class OfficeRecords
68
+ end
69
+
70
+ class Persons
71
+ end
72
+
73
+ class RollCalls
74
+ end
75
+
76
+ class Votes
77
+ end
78
+
79
+ class VoteTypes
80
+ end
81
+ end
@@ -0,0 +1,44 @@
1
+ module Legistar
2
+ class Actions
3
+ include HTTParty
4
+ base_uri 'https://webapi.legistar.com'
5
+
6
+ def initialize(host:)
7
+ @host = host
8
+ end
9
+
10
+ # Example Response
11
+ #
12
+ # {
13
+ # "ActionId"=>367,
14
+ # "ActionGuid"=>nil,
15
+ # "ActionLastModifiedUtc"=>"2014-05-24T04:15:17.893",
16
+ # "ActionRowVersion"=>"AAAAAAAeM4E=",
17
+ # "ActionName"=>"Adopted As Amended",
18
+ # "ActionActiveFlag"=>1,
19
+ # "ActionUsedFlag"=>0
20
+ # }
21
+ #
22
+ def index
23
+ response = self.class.get("/v1/#{@host}/Actions")
24
+ actions = response.to_a
25
+ end
26
+
27
+ def get(id)
28
+ response = self.class.get("/v1/#{@host}/Actions/#{id}")
29
+ response.to_h
30
+ end
31
+
32
+ def create(options = {})
33
+ response = self.class.post("/v1/#{@host}/Actions/", options)
34
+ end
35
+
36
+ def update(id, options = {})
37
+ response = self.class.put("/v1/#{@host}/Actions/#{id}", options)
38
+ end
39
+
40
+ def destroy(id)
41
+ response = self.class.delete("/v1/#{@host}/Actions/#{id}")
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,57 @@
1
+ module Legistar
2
+ class Bodies
3
+ include HTTParty
4
+ base_uri 'https://webapi.legistar.com'
5
+
6
+ def initialize(host:)
7
+ @host = host
8
+ end
9
+
10
+ # Example Response
11
+ #
12
+ # {
13
+ # "BodyId"=>138,
14
+ # "BodyGuid"=>"C41C40DF-D8C2-444E-B2A8-4FC7D4B1A9F8",
15
+ # "BodyLastModifiedUtc"=>"2014-05-24T04:15:17.663",
16
+ # "BodyRowVersion"=>"AAAAAAAmn0Y=",
17
+ # "BodyName"=>"City Council",
18
+ # "BodyTypeId"=>42,
19
+ # "BodyTypeName"=>"City Council",
20
+ # "BodyMeetFlag"=>1,
21
+ # "BodyActiveFlag"=>1,
22
+ # "BodySort"=>999,
23
+ # "BodyDescription"=>"",
24
+ # "BodyContactNameId"=>nil,
25
+ # "BodyContactFullName"=>nil,
26
+ # "BodyContactPhone"=>nil,
27
+ # "BodyContactEmail"=>nil,
28
+ # "BodyUsedControlFlag"=>0,
29
+ # "BodyNumberOfMembers"=>0,
30
+ # "BodyUsedActingFlag"=>0,
31
+ # "BodyUsedTargetFlag"=>0,
32
+ # "BodyUsedSponsorFlag"=>0
33
+ # }
34
+ #
35
+ def index
36
+ response = self.class.get("/v1/#{@host}/Bodies")
37
+ actions = response.to_a
38
+ end
39
+
40
+ def get(id)
41
+ response = self.class.get("/v1/#{@host}/Bodies/#{id}")
42
+ response.to_h
43
+ end
44
+
45
+ def create(options = {})
46
+ response = self.class.post("/v1/#{@host}/Bodies/", options)
47
+ end
48
+
49
+ def update(id, options = {})
50
+ response = self.class.put("/v1/#{@host}/Bodies/#{id}", options)
51
+ end
52
+
53
+ def destroy(id)
54
+ response = self.class.delete("/v1/#{@host}/Bodies/#{id}")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,3 @@
1
+ module Legistar
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: legistar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Wold
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-12-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: httparty
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: A .gem to interact with the Legistar WebApi
84
+ email:
85
+ - wold@afomi.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - bin/console
98
+ - bin/setup
99
+ - legistar.gemspec
100
+ - lib/legistar.rb
101
+ - lib/legistar/actions.rb
102
+ - lib/legistar/bodies.rb
103
+ - lib/legistar/version.rb
104
+ homepage: https://github.com/afomi/legistar
105
+ licenses:
106
+ - MIT
107
+ metadata:
108
+ allowed_push_host: https://rubygems.org
109
+ homepage_uri: https://github.com/afomi/legistar
110
+ source_code_uri: https://github.com/afomi/legistar
111
+ changelog_uri: https://github.com/afomi/legistar
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.7.7
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: A .gem to interact with the Legistar WebApi
132
+ test_files: []