caselaw 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,37 @@
1
+ require "bundler/setup"
2
+ require 'webmock'
3
+ require 'webmock/rspec'
4
+ require "caselaw"
5
+
6
+ RSpec.configure do |config|
7
+ # Enable flags like --only-failures and --next-failure
8
+ config.example_status_persistence_file_path = ".rspec_status"
9
+ config.expose_dsl_globally = true
10
+
11
+ # Disable RSpec exposing methods globally on `Module` and `main`
12
+ config.disable_monkey_patching!
13
+
14
+ config.expect_with :rspec do |c|
15
+ c.syntax = :expect
16
+ end
17
+ end
18
+
19
+ def stub(path, fixture_name)
20
+ root = "https://api.case.law/v1/"
21
+ path = root + path
22
+ stub_request(:get, path).
23
+ with(
24
+ headers: {
25
+ 'Authorization'=>'Token SECRET_KEY'
26
+ })
27
+ .to_return(status: 200, body: fixture(fixture_name), headers: {"Content-Type"=> "application/json"})
28
+ end
29
+
30
+ def fixture_path(file = nil)
31
+ path = File.expand_path("../fixtures", __FILE__)
32
+ file.nil? ? path : File.join(path, file)
33
+ end
34
+
35
+ def fixture(file)
36
+ file = File.read(fixture_path(file))
37
+ end
metadata ADDED
@@ -0,0 +1,166 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: caselaw
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - tombonan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-31 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.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
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: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
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.16.3
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.16.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: hashie
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.6'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.6'
97
+ description: Wrapper for the Caselaw Access Project API
98
+ email:
99
+ - tombonan27@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - caselaw.gemspec
112
+ - docs/README.md
113
+ - examples/README.md
114
+ - examples/jurisdictions.rb
115
+ - examples/witchcraft.rb
116
+ - lib/caselaw.rb
117
+ - lib/caselaw/client.rb
118
+ - lib/caselaw/client/cases.rb
119
+ - lib/caselaw/client/citations.rb
120
+ - lib/caselaw/client/courts.rb
121
+ - lib/caselaw/client/jurisdictions.rb
122
+ - lib/caselaw/client/reporters.rb
123
+ - lib/caselaw/client/volumes.rb
124
+ - lib/caselaw/errors.rb
125
+ - lib/caselaw/jurisdiction.rb
126
+ - lib/caselaw/request.rb
127
+ - lib/caselaw/version.rb
128
+ - spec/caselaw_spec.rb
129
+ - spec/client_spec.rb
130
+ - spec/fixtures/case.json
131
+ - spec/fixtures/full_case.json
132
+ - spec/fixtures/jurisdiction_colo.json
133
+ - spec/fixtures/jurisdictions.json
134
+ - spec/spec_helper.rb
135
+ homepage: https://github.com/tombonan/caselaw
136
+ licenses:
137
+ - MIT
138
+ metadata: {}
139
+ post_install_message: Welcome to the Case Law party!
140
+ rdoc_options: []
141
+ require_paths:
142
+ - lib
143
+ required_ruby_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ requirements: []
154
+ rubyforge_project:
155
+ rubygems_version: 2.4.5
156
+ signing_key:
157
+ specification_version: 4
158
+ summary: Case.law API wrapper
159
+ test_files:
160
+ - spec/caselaw_spec.rb
161
+ - spec/client_spec.rb
162
+ - spec/fixtures/case.json
163
+ - spec/fixtures/full_case.json
164
+ - spec/fixtures/jurisdiction_colo.json
165
+ - spec/fixtures/jurisdictions.json
166
+ - spec/spec_helper.rb