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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7ae1adcb210a11987c89af85c6056d14f61ac9b7
4
- data.tar.gz: a6ee77ad5cabd5e9c3cecea6aca48eb0e640e3b9
2
+ SHA256:
3
+ metadata.gz: 457dadda4d6240e3a563b3727c1c7858a258405380762f3783204cb2d95b94a5
4
+ data.tar.gz: 19ad85c4923a1d1c5f2462a5596574d5a2a10d3b83657104fa134152777f1f2f
5
5
  SHA512:
6
- metadata.gz: db066fec049d40e28ad4bf0e60231175220e7855df95f3e7998b019e62bc27ec8cf225d72fa1268d0d855331ede97cb856378bb25bebeb79deefa6bad351e300
7
- data.tar.gz: e4139ee987a2a38ec94baea80a9683bd2d8a7911af9847c97badcf6f967dd93c180bcebe3bb4ec25fefcd326390ad798968265eb0a2b933855df93e16ec3d256
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
@@ -0,0 +1,5 @@
1
+ # 0.1.1 - 2022-02-15
2
+
3
+ - Switch from RuboCop to Standard Ruby
4
+ - Support Ruby 2.7-3.1 with `delegate` require
5
+ - Update all dependencies in gemspec
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
- [![Build Status](https://travis-ci.org/mlibrary/vizier.svg?branch=master)](https://travis-ci.org/mlibrary/vizier?branch=master)
2
- [![Coverage Status](https://coveralls.io/repos/github/mlibrary/vizier/badge.svg?branch=master)](https://coveralls.io/github/mlibrary/vizier?branch=master)
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")
@@ -12,7 +12,7 @@ module Vizier
12
12
 
13
13
  def initialize(policy, view, presenter_factory: PresenterFactory.new)
14
14
  @policy = policy
15
- @view = view
15
+ @view = view
16
16
  @presenter_factory = presenter_factory
17
17
  end
18
18
 
@@ -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 = type.to_s
11
+ @type_name = type.to_s
12
12
  @presenter_name = presenter.to_s
13
- @policy_name = policy.to_s
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
- presenter_map = {},
14
- config_type: PresenterConfig,
15
- default_config: DefaultPresenterConfig.new(config_type))
13
+ presenter_map = {},
14
+ config_type: PresenterConfig,
15
+ default_config: DefaultPresenterConfig.new(config_type)
16
+ )
16
17
 
17
- @config_type = config_type
18
+ @config_type = config_type
18
19
  @default_config = default_config
19
20
 
20
21
  @configs = Hash.new do |_configs, type|
@@ -8,7 +8,7 @@ module Vizier
8
8
  attr_reader :user, :resource
9
9
 
10
10
  def initialize(user, resource)
11
- @user = user
11
+ @user = user
12
12
  @resource = resource
13
13
  end
14
14
 
@@ -12,7 +12,7 @@ module Vizier
12
12
 
13
13
  def initialize(policy, view, presenter_factory: PresenterFactory.new)
14
14
  @policy = policy
15
- @view = view
15
+ @view = view
16
16
  @presenter_factory = presenter_factory
17
17
  __setobj__ policy.resource
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vizier
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/vizier.rb CHANGED
@@ -1,19 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'vizier/version'
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 'vizier/null_presenter'
11
- require 'vizier/read_only_policy'
11
+ require "vizier/null_presenter"
12
+ require "vizier/read_only_policy"
12
13
 
13
- require 'vizier/presenter_config'
14
- require 'vizier/caching_presenter_config'
15
- require 'vizier/default_presenter_config'
14
+ require "vizier/presenter_config"
15
+ require "vizier/caching_presenter_config"
16
+ require "vizier/default_presenter_config"
16
17
 
17
- require 'vizier/collection_presenter'
18
- require 'vizier/resource_presenter'
19
- require 'vizier/presenter_factory'
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 = "vizier"
8
+ spec.name = "vizier"
9
9
  spec.version = Vizier::VERSION
10
10
  spec.authors = ["Noah Botimer"]
11
- spec.email = ["botimer@umich.edu"]
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 = "exe"
31
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
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", "~> 1.16"
35
- spec.add_development_dependency "coveralls", "~> 0.8"
36
- spec.add_development_dependency "rake", "~> 10.0"
37
- spec.add_development_dependency "rspec", "~> 3.0"
38
- spec.add_development_dependency "rubocop", "~> 0.52"
39
- spec.add_development_dependency "rubocop-rails", "~> 1.1"
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.0
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: 2018-03-05 00:00:00.000000000 Z
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: '1.16'
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: '1.16'
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: coveralls
28
+ name: simplecov
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.8'
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.8'
40
+ version: '0.21'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: simplecov-lcov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
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: '3.0'
54
+ version: '0.8'
69
55
  - !ruby/object:Gem::Dependency
70
- name: rubocop
56
+ name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '0.52'
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.52'
68
+ version: '13.0'
83
69
  - !ruby/object:Gem::Dependency
84
- name: rubocop-rails
70
+ name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '1.1'
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: '1.1'
82
+ version: '3.11'
97
83
  - !ruby/object:Gem::Dependency
98
- name: rubocop-rspec
84
+ name: standard
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '1.16'
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.16'
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
- rubyforge_project:
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,