statbank_denmark 0.1.0 → 0.1.2

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: 183b691efeb61af245aaaddb2f7e736c4509f7a99619447b46baec3c5b318dcb
4
- data.tar.gz: c1b14881d01331e323f354c7f809e03370b5bbb7e819dc8fc27ba9764a2a10e1
3
+ metadata.gz: dfa3f4cbf7d3ed27c9146a04bdda4648c52c533cfe37c5e374eb8391e7ebcaf1
4
+ data.tar.gz: 293070abc709de23b130299a7c576f666e8b458505ca300b66ca13cad429a893
5
5
  SHA512:
6
- metadata.gz: efccb6b847ccf3d941baa91107d3b02f9afc88ca98cf5cefd22460833f1eb9858eaa7ae34a84a95676d626662604855b4f572f15050a19bcde74861ade568223
7
- data.tar.gz: dd6d92d90f93ab9ade68bf709072984f827d1c885fb80523023cd6e6a4fbfd76415265c7ba44edc7e8994a10cbf4c11493b039e8d76d651f86819eab2f7f69e6
6
+ metadata.gz: 7aed05e5df3a553c990f23ebdd08c4a7d263ef94398c69634e91342c51e492770d23cd184aa49ee6772defd68181b804afa90058d452012331b74e114cf97285
7
+ data.tar.gz: b1c2d005b936466d2a32fda1df85b887119ea4221d25094c8db7e453b9f5c8b7fa2213ec2c878405a10320498b2bd97f92e582f3d3f57f47e8d9b1f4e30a54a0
data/CHANGELOG CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## 20260928
4
4
 
5
+ 0.1.2: + Rakefile
6
+
7
+ 1. + Rakefile
8
+ 2. ~ statbank_denmark.gemspec: + 'Rakefile' to spec.files; + rake
9
+ 3. ~ statbank_denmark.gemspec: + Gem::Specification#dependencies= and #development_dependencies=
10
+ 4. ~ statbank_denmark.gemspec: /Ruby/MIT/
11
+ 5. ~ README.md: /Ruby License/MIT License/
12
+ 6. ~ StatBankDenmark::VERSION: /0.1.1/0.1.2/
13
+
14
+ 0.1.1: alias_method :tableinfo, :table_info
15
+
16
+ 1. + StatBankDenmark.tableinfo
17
+ 2. + StatBankDenmark::Client#tableinfo
18
+ 3. ~ StatBankDenmark::VERSION: /0.1.0/0.1.1/
19
+
5
20
  0.1.0: + StatBankDenmark::Tables
6
21
 
7
22
  1. + StatBankDenmark::Tables: six crime and population tables and their dimensions, taken from table_info.
data/README.md CHANGED
@@ -58,6 +58,7 @@ StatBankDenmark.tables(include_inactive: true, subject: 4)
58
58
  StatBankDenmark.table_info('STRAF42') # implicitly format: 'json'
59
59
  StatBankDenmark.table_info('STRAF42', format: 'json') # explicitly format: 'json'
60
60
  StatBankDenmark.table_info('STRAF42', format: 'csv') # format: 'csv'
61
+ StatBankDenmark.tableinfo('STRAF42') # an alias, /tableinfo being the endpoint
61
62
 
62
63
  # Get data from a specific table
63
64
  StatBankDenmark.data('STRAF42') # implicitly format: 'csv'
@@ -155,4 +156,4 @@ being broken when it is the request that is wrong.
155
156
 
156
157
  ## License
157
158
 
158
- The gem is available as open source under the terms of the [Ruby License](https://opensource.org/licenses/MIT).
159
+ 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,30 @@
1
+ # Rakefile
2
+
3
+ require 'rake/testtask'
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << 'lib'
7
+ t.libs << 'test'
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ t.verbose = true
10
+ t.warning = false
11
+ end
12
+
13
+ task default: :test
14
+
15
+ desc "Run tests"
16
+ task :spec => :test
17
+
18
+ # test/integration_test.rb skips itself unless this is set, so it is in the
19
+ # default run and costs nothing there. This task is how it is asked for.
20
+ desc "Run the tests which call the live API"
21
+ task :integration do
22
+ ENV['RUN_INTEGRATION_TESTS'] = '1'
23
+ Rake::Task[:test].invoke
24
+ end
25
+
26
+ desc "Show version"
27
+ task :version do
28
+ require_relative './lib/StatBankDenmark/VERSION'
29
+ puts "statbank_denmark #{StatBankDenmark::VERSION}"
30
+ end
@@ -72,6 +72,9 @@ module StatBankDenmark
72
72
  )
73
73
  handle_response(response)
74
74
  end
75
+ # The endpoint is /tableinfo, which is how StatBank's own documentation names
76
+ # it, and the spelling anyone arriving from there reaches for first.
77
+ alias_method :tableinfo, :table_info
75
78
 
76
79
  def data(
77
80
  table_id,
@@ -2,5 +2,5 @@
2
2
  # StatBankDenmark::VERSION
3
3
 
4
4
  module StatBankDenmark
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.2'
6
6
  end
@@ -18,6 +18,9 @@ module StatBankDenmark
18
18
  def table_info(table_id, **options)
19
19
  client.table_info(table_id, **options)
20
20
  end
21
+ # The endpoint is /tableinfo, which is how StatBank's own documentation names
22
+ # it, and the spelling anyone arriving from there reaches for first.
23
+ alias_method :tableinfo, :table_info
21
24
 
22
25
  def data(table_id, **options)
23
26
  client.data(table_id, **options)
@@ -1,8 +1,19 @@
1
+ # statbank_denmark.gemspec
2
+
1
3
  require_relative './lib/StatBankDenmark/VERSION'
2
4
 
5
+ class Gem::Specification
6
+ def dependencies=(gems)
7
+ gems.each{|gem| add_dependency(*gem)}
8
+ end
9
+
10
+ def development_dependencies=(gems)
11
+ gems.each{|gem| add_development_dependency(*gem)}
12
+ end
13
+ end
14
+
3
15
  Gem::Specification.new do |spec|
4
16
  spec.name = 'statbank_denmark'
5
-
6
17
  spec.version = StatBankDenmark::VERSION
7
18
 
8
19
  spec.summary = "A Ruby client for the StatBank Denmark API."
@@ -11,26 +22,32 @@ Gem::Specification.new do |spec|
11
22
  spec.authors = 'thoran'
12
23
  spec.email = 'code@thoran.com'
13
24
  spec.homepage = 'https://github.com/thoran/statbank_denmark'
14
- spec.license = 'Ruby'
25
+ spec.license = 'MIT'
15
26
 
16
27
  spec.required_ruby_version = '>= 2.7'
28
+ spec.require_paths = ['lib']
17
29
 
18
30
  spec.files = [
31
+ 'statbank_denmark.gemspec',
32
+ Dir['lib/**/*.rb'],
33
+ Dir['test/**/*.rb'],
19
34
  'CHANGELOG',
20
35
  'Gemfile',
21
36
  'LICENSE',
37
+ 'Rakefile',
22
38
  'README.md',
23
- 'statbank_denmark.gemspec',
24
- Dir['lib/**/*.rb'],
25
- Dir['test/**/*.rb']
26
39
  ].flatten
27
- spec.require_paths = ['lib']
28
-
29
- spec.add_dependency('http.rb')
30
- spec.add_dependency('json')
31
40
 
32
- spec.add_development_dependency('minitest')
33
- spec.add_development_dependency('minitest-spec-context')
34
- spec.add_development_dependency('webmock')
35
- spec.add_development_dependency('vcr')
41
+ spec.dependencies = %w{
42
+ http.rb
43
+ json
44
+ }
45
+
46
+ spec.development_dependencies = %w{
47
+ rake
48
+ minitest
49
+ minitest-spec-context
50
+ webmock
51
+ vcr
52
+ }
36
53
  end
@@ -132,6 +132,11 @@ describe StatBankDenmark::Client do
132
132
  end
133
133
  end
134
134
 
135
+ it "answers to tableinfo, which is what the endpoint is called" do
136
+ _(client).must_respond_to(:tableinfo)
137
+ _(StatBankDenmark::Client.instance_method(:tableinfo).original_name).must_equal(:table_info)
138
+ end
139
+
135
140
  it "raises ArgumentError for nil table_id" do
136
141
  _(proc{client.table_info(nil)}).must_raise(ArgumentError)
137
142
  end
@@ -11,5 +11,10 @@ describe StatBankDenmark do
11
11
  _(StatBankDenmark).must_respond_to(:data)
12
12
  _(StatBankDenmark).must_respond_to(:search)
13
13
  end
14
+
15
+ it "answers to tableinfo, which is what the endpoint is called" do
16
+ _(StatBankDenmark).must_respond_to(:tableinfo)
17
+ _(StatBankDenmark.method(:tableinfo).original_name).must_equal(:table_info)
18
+ end
14
19
  end
15
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statbank_denmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rake
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
40
54
  - !ruby/object:Gem::Dependency
41
55
  name: minitest
42
56
  requirement: !ruby/object:Gem::Requirement
@@ -104,6 +118,7 @@ files:
104
118
  - Gemfile
105
119
  - LICENSE
106
120
  - README.md
121
+ - Rakefile
107
122
  - lib/Object/inQ.rb
108
123
  - lib/StatBankDenmark.rb
109
124
  - lib/StatBankDenmark/Client.rb
@@ -121,7 +136,7 @@ files:
121
136
  - test/integration_test.rb
122
137
  homepage: https://github.com/thoran/statbank_denmark
123
138
  licenses:
124
- - Ruby
139
+ - MIT
125
140
  metadata: {}
126
141
  rdoc_options: []
127
142
  require_paths: