stac 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.
@@ -0,0 +1,28 @@
1
+ module STAC
2
+ class ObjectResolver
3
+ RESOLVABLES: Array[_STACObjectClass]
4
+
5
+ attr_writer self.default_http_client: _HTTPClient
6
+
7
+ def self.default_http_client: -> _HTTPClient
8
+
9
+ attr_reader http_client: _HTTPClient
10
+
11
+ def initialize: (?http_client: _HTTPClient) -> void
12
+
13
+ def resolve: (String url) -> (Catalog | Collection | Item)
14
+
15
+ private
16
+
17
+ def read: (String url) -> String
18
+ end
19
+
20
+ interface _STACObjectClass
21
+ def type: -> String
22
+ def from_hash: (Hash[String, untyped] hash) -> (Catalog | Collection | Item)
23
+ end
24
+
25
+ interface _HTTPClient
26
+ def get: (URI uri) -> String
27
+ end
28
+ end
@@ -0,0 +1,12 @@
1
+ module STAC
2
+ class Properties
3
+ def self.from_hash: (Hash[String, untyped] hash) -> Properties
4
+
5
+ attr_accessor datetime: Time?
6
+ attr_accessor extra: Hash[String, untyped]
7
+
8
+ def initialize: (datetime: Time?, **untyped) -> void
9
+
10
+ def to_h: -> Hash[String, untyped]
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module STAC
2
+ class Provider
3
+ def self.from_hash: (Hash[String, untyped] hash) -> Provider
4
+
5
+ attr_accessor name: String
6
+ attr_accessor description: String?
7
+ attr_accessor roles: Array[String]?
8
+ attr_accessor url: String?
9
+ attr_accessor extra: Hash[String, untyped]
10
+
11
+ def initialize: (name: String, ?description: String?, ?roles: Array[String]?, ?url: String?, **untyped) -> void
12
+
13
+ def to_h: -> Hash[String, untyped]
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module STAC
2
+ SPEC_VERSION: String
3
+ end
@@ -0,0 +1,28 @@
1
+ module STAC
2
+ class STACObject
3
+ attr_accessor self.type: String
4
+
5
+ def self.from_hash: (Hash[String, untyped]) -> STACObject
6
+
7
+ attr_accessor id: String
8
+ attr_accessor stac_extensions: Array[String]?
9
+ attr_accessor extra: Hash[String, untyped]
10
+ attr_reader links: Array[Link]
11
+
12
+ def initialize: (
13
+ id: String, links: Array[Link], ?stac_extensions: Array[String]?, **untyped
14
+ ) -> void
15
+
16
+ def type: -> String
17
+ def to_h: -> Hash[String, untyped]
18
+ def to_json: -> String
19
+ def add_link: (Link) -> Array[Link]
20
+ def self_href: -> String?
21
+ def self_href=: (String) -> void
22
+
23
+ private
24
+
25
+ def find_link: (rel: String) -> Link?
26
+ def remove_link: (rel: String) -> Array[Link]?
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module STAC
2
+ VERSION: String
3
+ end
data/sig/stac.rbs ADDED
@@ -0,0 +1,5 @@
1
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
2
+ module STAC
3
+ def self.from_file: (String path) -> (Catalog | Collection | Item)
4
+ %a{rbs:test:skip} def self.from_url: (String url, ?resolver: ObjectResolver) -> (Catalog | Collection | Item)
5
+ end
data/stac.gemspec ADDED
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/stac/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'stac'
7
+ spec.version = STAC::VERSION
8
+ spec.authors = ['Takahiro Miyoshi']
9
+ spec.email = ['takahiro-miyoshi@sankichi.net']
10
+
11
+ spec.summary = 'A library for working with SpatioTemporal Asset Catalog (STAC)'
12
+ spec.homepage = 'https://github.com/sankichi92/stac-ruby'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = '>= 3.0.0'
15
+
16
+ spec.metadata['homepage_uri'] = spec.homepage
17
+ spec.metadata['source_code_uri'] = 'https://github.com/sankichi92/stac-ruby'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/sankichi92/stac-ruby/blob/main/CHANGELOG.md'
19
+ spec.metadata['documentation_uri'] = 'https://sankichi92.github.io/stac-ruby/'
20
+ spec.metadata['github_repo'] = 'https://github.com/sankichi92/stac-ruby.git'
21
+
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(__dir__) do
27
+ `git ls-files -z`.split("\x0").reject do |f|
28
+ (f == __FILE__) || f.match(
29
+ %r{\A(?:(?:bin|spec|examples)/|\.(?:git|vscode|devcontainer)|stac-spec)},
30
+ )
31
+ end
32
+ end
33
+ spec.bindir = 'exe'
34
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ['lib']
36
+
37
+ # Uncomment to register a new dependency of your gem
38
+ # spec.add_dependency 'faraday', '~> 2.0'
39
+
40
+ # For more information and examples about making a new gem, check out our
41
+ # guide at: https://bundler.io/guides/creating_gem.html
42
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stac
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takahiro Miyoshi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-10-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - takahiro-miyoshi@sankichi.net
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - ".rubocop.yml"
22
+ - CHANGELOG.md
23
+ - CODE_OF_CONDUCT.md
24
+ - Gemfile
25
+ - Gemfile.lock
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - Steepfile
30
+ - lib/stac.rb
31
+ - lib/stac/asset.rb
32
+ - lib/stac/catalog.rb
33
+ - lib/stac/collection.rb
34
+ - lib/stac/default_http_client.rb
35
+ - lib/stac/errors.rb
36
+ - lib/stac/extent.rb
37
+ - lib/stac/item.rb
38
+ - lib/stac/link.rb
39
+ - lib/stac/object_resolver.rb
40
+ - lib/stac/properties.rb
41
+ - lib/stac/provider.rb
42
+ - lib/stac/spec_version.rb
43
+ - lib/stac/stac_object.rb
44
+ - lib/stac/version.rb
45
+ - sig/open-uri.rbs
46
+ - sig/stac.rbs
47
+ - sig/stac/asset.rbs
48
+ - sig/stac/catalog.rbs
49
+ - sig/stac/collection.rbs
50
+ - sig/stac/default_http_client.rbs
51
+ - sig/stac/errors.rbs
52
+ - sig/stac/extent.rbs
53
+ - sig/stac/item.rbs
54
+ - sig/stac/link.rbs
55
+ - sig/stac/object_resolver.rbs
56
+ - sig/stac/properties.rbs
57
+ - sig/stac/provider.rbs
58
+ - sig/stac/spec_version.rbs
59
+ - sig/stac/stac_object.rbs
60
+ - sig/stac/version.rbs
61
+ - stac.gemspec
62
+ homepage: https://github.com/sankichi92/stac-ruby
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ homepage_uri: https://github.com/sankichi92/stac-ruby
67
+ source_code_uri: https://github.com/sankichi92/stac-ruby
68
+ changelog_uri: https://github.com/sankichi92/stac-ruby/blob/main/CHANGELOG.md
69
+ documentation_uri: https://sankichi92.github.io/stac-ruby/
70
+ github_repo: https://github.com/sankichi92/stac-ruby.git
71
+ rubygems_mfa_required: 'true'
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 3.0.0
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubygems_version: 3.3.7
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: A library for working with SpatioTemporal Asset Catalog (STAC)
91
+ test_files: []