vizier 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +32 -0
- data/.standard.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +18 -2
- data/bin/standardrb +29 -0
- data/lib/vizier/collection_presenter.rb +1 -1
- data/lib/vizier/presenter_config.rb +2 -2
- data/lib/vizier/presenter_factory.rb +5 -4
- data/lib/vizier/read_only_policy.rb +1 -1
- data/lib/vizier/resource_presenter.rb +1 -1
- data/lib/vizier/version.rb +1 -1
- data/lib/vizier.rb +10 -9
- data/vizier.gemspec +10 -11
- metadata +24 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 457dadda4d6240e3a563b3727c1c7858a258405380762f3783204cb2d95b94a5
|
4
|
+
data.tar.gz: 19ad85c4923a1d1c5f2462a5596574d5a2a10d3b83657104fa134152777f1f2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a74bbe782580b67399134d51de9b44a911423ee4f61fafe86f52b573bed412c86d3a8b008612331863e0de521f5cbf2d299804db70206d45da18ac8d601c3bbe
|
7
|
+
data.tar.gz: 60b490e950a76140857362199c1b39d42a3ef72ca8afb995b13d0c3cdb560d38e0cfa02807653de6d69d2a2572f4bbab5a3f5442f9933fb212d9dee9e8634b9f
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
os: [ ubuntu-latest ]
|
14
|
+
ruby-version: [2.6, 2.7, 3.0, 3.1]
|
15
|
+
|
16
|
+
runs-on: ${{ matrix.os }}
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby-version }}
|
24
|
+
bundler-cache: true
|
25
|
+
- name: Run linter for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
26
|
+
run: bin/standardrb
|
27
|
+
- name: Run tests for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
28
|
+
run: bin/rspec
|
29
|
+
- name: Report to Coveralls
|
30
|
+
uses: coverallsapp/github-action@1.1.3
|
31
|
+
with:
|
32
|
+
github-token: ${{ secrets.github_token }}
|
data/.standard.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby_version: 3.0.0
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
[![
|
2
|
-
[![Coverage Status](https://coveralls.io/repos/github/mlibrary/
|
1
|
+
[![Tests](https://github.com/mlibrary/vizier/actions/workflows/test.yml/badge.svg)](https://github.com/mlibrary/vizier/actions/workflows/test.yml)
|
2
|
+
[![Coverage Status](https://coveralls.io/repos/github/mlibrary/keycard/badge.svg?branch=main)](https://coveralls.io/github/mlibrary/vizier?branch=main)
|
3
|
+
[![User Docs](https://img.shields.io/badge/user_docs-readthedocs-blue.svg)](https://vizier.readthedocs.io/en/latest)
|
4
|
+
[![API Docs](https://img.shields.io/badge/API_docs-rubydoc.info-blue.svg)](https://www.rubydoc.info/gems/vizier)
|
3
5
|
|
4
6
|
# Vizier
|
5
7
|
|
@@ -20,6 +22,20 @@ And then execute:
|
|
20
22
|
|
21
23
|
$ bundle
|
22
24
|
|
25
|
+
## Compatibility
|
26
|
+
|
27
|
+
Keycard is intended to be compatible with all community-supported Ruby branches (i.e., minor versions), currently:
|
28
|
+
|
29
|
+
- 2.6
|
30
|
+
- 2.7
|
31
|
+
- 3.0
|
32
|
+
- 3.1
|
33
|
+
|
34
|
+
We prefer the newest syntax and linting rules that preserve compatibility with the oldest branch in normal maintenance.
|
35
|
+
When the security maintenance for a branch expires, Keycard's compatibility should be considered unsupported.
|
36
|
+
|
37
|
+
See also, [Ruby's branch maintenance policy](https://www.ruby-lang.org/en/downloads/branches/).
|
38
|
+
|
23
39
|
## License
|
24
40
|
|
25
41
|
Vizier is licensed under the BSD-3-Clause license. See [LICENSE.md](LICENSE.md).
|
data/bin/standardrb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'standardrb' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("standard", "standardrb")
|
@@ -8,9 +8,9 @@ module Vizier
|
|
8
8
|
# be used in production.
|
9
9
|
class PresenterConfig
|
10
10
|
def initialize(type, presenter, policy)
|
11
|
-
@type_name
|
11
|
+
@type_name = type.to_s
|
12
12
|
@presenter_name = presenter.to_s
|
13
|
-
@policy_name
|
13
|
+
@policy_name = policy.to_s
|
14
14
|
end
|
15
15
|
|
16
16
|
def present(object, user, view)
|
@@ -10,11 +10,12 @@ module Vizier
|
|
10
10
|
# where the first item is the default presenter type, and the second is the
|
11
11
|
# default policy type.
|
12
12
|
def initialize(
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
presenter_map = {},
|
14
|
+
config_type: PresenterConfig,
|
15
|
+
default_config: DefaultPresenterConfig.new(config_type)
|
16
|
+
)
|
16
17
|
|
17
|
-
@config_type
|
18
|
+
@config_type = config_type
|
18
19
|
@default_config = default_config
|
19
20
|
|
20
21
|
@configs = Hash.new do |_configs, type|
|
data/lib/vizier/version.rb
CHANGED
data/lib/vizier.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "delegate"
|
4
|
+
require "vizier/version"
|
4
5
|
|
5
6
|
# Top level module for Vizier
|
6
7
|
module Vizier
|
7
8
|
# Just the constant for now
|
8
9
|
end
|
9
10
|
|
10
|
-
require
|
11
|
-
require
|
11
|
+
require "vizier/null_presenter"
|
12
|
+
require "vizier/read_only_policy"
|
12
13
|
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
14
|
+
require "vizier/presenter_config"
|
15
|
+
require "vizier/caching_presenter_config"
|
16
|
+
require "vizier/default_presenter_config"
|
16
17
|
|
17
|
-
require
|
18
|
-
require
|
19
|
-
require
|
18
|
+
require "vizier/collection_presenter"
|
19
|
+
require "vizier/resource_presenter"
|
20
|
+
require "vizier/presenter_factory"
|
data/vizier.gemspec
CHANGED
@@ -5,10 +5,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require "vizier/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
8
|
+
spec.name = "vizier"
|
9
9
|
spec.version = Vizier::VERSION
|
10
10
|
spec.authors = ["Noah Botimer"]
|
11
|
-
spec.email
|
11
|
+
spec.email = ["botimer@umich.edu"]
|
12
12
|
spec.license = "BSD-3-Clause"
|
13
13
|
|
14
14
|
spec.summary = <<~SUMMARY
|
@@ -27,15 +27,14 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
28
28
|
f.match(%r{^(test|spec|features)/})
|
29
29
|
end
|
30
|
-
spec.bindir
|
31
|
-
spec.executables
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_development_dependency "bundler", "~>
|
35
|
-
spec.add_development_dependency "
|
36
|
-
spec.add_development_dependency "
|
37
|
-
spec.add_development_dependency "
|
38
|
-
spec.add_development_dependency "
|
39
|
-
spec.add_development_dependency "
|
40
|
-
spec.add_development_dependency "rubocop-rspec", "~> 1.16"
|
34
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
35
|
+
spec.add_development_dependency "simplecov", "~> 0.21"
|
36
|
+
spec.add_development_dependency "simplecov-lcov", "~> 0.8"
|
37
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
38
|
+
spec.add_development_dependency "rspec", "~> 3.11"
|
39
|
+
spec.add_development_dependency "standard", "~> 1.7"
|
41
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vizier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Botimer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,98 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: simplecov
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.21'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.21'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: simplecov-lcov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.0'
|
47
|
+
version: '0.8'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '0.8'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: rake
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
61
|
+
version: '13.0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
68
|
+
version: '13.0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '3.11'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '3.11'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: standard
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
89
|
+
version: '1.7'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
96
|
+
version: '1.7'
|
111
97
|
description: |
|
112
98
|
Vizier helps you present the right information to your users. By using policies and configurable
|
113
99
|
defaults, it becomes easier to build presenters and be sure that model objects are wrapped in
|
@@ -119,10 +105,13 @@ extensions: []
|
|
119
105
|
extra_rdoc_files: []
|
120
106
|
files:
|
121
107
|
- ".envrc"
|
108
|
+
- ".github/workflows/test.yml"
|
122
109
|
- ".gitignore"
|
123
110
|
- ".rspec"
|
124
111
|
- ".rubocop.yml"
|
112
|
+
- ".standard.yml"
|
125
113
|
- ".travis.yml"
|
114
|
+
- CHANGELOG.md
|
126
115
|
- Gemfile
|
127
116
|
- LICENSE.md
|
128
117
|
- README.md
|
@@ -130,6 +119,7 @@ files:
|
|
130
119
|
- bin/console
|
131
120
|
- bin/rspec
|
132
121
|
- bin/setup
|
122
|
+
- bin/standardrb
|
133
123
|
- lib/vizier.rb
|
134
124
|
- lib/vizier/caching_presenter_config.rb
|
135
125
|
- lib/vizier/collection_presenter.rb
|
@@ -160,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
150
|
- !ruby/object:Gem::Version
|
161
151
|
version: '0'
|
162
152
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 2.6.13
|
153
|
+
rubygems_version: 3.1.6
|
165
154
|
signing_key:
|
166
155
|
specification_version: 4
|
167
156
|
summary: Vizier supports building policy-aware presenters for the view layer of applications,
|