pears 0.3.1 → 0.3.4

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
2
  SHA256:
3
- metadata.gz: 10cdea0d2eb59b303dab2dac91edbe3a3f37d6bb833fcbccaf7176ab28cc6813
4
- data.tar.gz: aef9803cf0c1c022fdb21615c0d76c228c3eabbaf160bd5742d6fee244315301
3
+ metadata.gz: a5665cb791b87669d5190e53e7b8c0eebc760b4a24a3a8f7f2c299d6f03c624c
4
+ data.tar.gz: c1b5a281c5d95a26b7efff7dfb1dca21aad77de333537aad824f47a27ce42ce9
5
5
  SHA512:
6
- metadata.gz: 12365453b2bbdb8fc612180dd3d7723811ff3068c8c78d46c2b957824ce44cc477438d76d5a2086d7c252772a2d3ea11101fbef44e0df56e70222c0e3e3adb2f
7
- data.tar.gz: aefbc749ea3806cec18b20c948cf93253ac9d87c1de579c06a2ea757bbd8ddd8e1b0d483222e5dfe7e78160c264b735cb05387606c2687d9ddedab280fa9308c
6
+ metadata.gz: 256e2ba258745889c73b0325640fa7c4f68920006f438fdca51386fcfe1f854063ef4f7be4e748144be95428c9199acd71853cb2a5b30e82495bd440ab499dfe
7
+ data.tar.gz: 768d16f400aad30e2b3b0d1091cb83b65581f27771c476cefd286384df80b30254ebbb27efced3e156a93f1b78fcbd5af365f5c5b0e3ddc8b96cd187626a0823
data/Gemfile.lock CHANGED
@@ -1,60 +1,66 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pears (0.3.1)
5
- activesupport
6
- dry-configurable (>= 0.13.0)
7
- redis
4
+ pears (0.3.4)
5
+ activesupport (~> 7.0)
6
+ dry-configurable (~> 1.0)
7
+ redis (~> 4.8)
8
+ roda (~> 3.60)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- activesupport (7.0.3.1)
13
+ activesupport (7.0.4.2)
13
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
15
  i18n (>= 1.6, < 2)
15
16
  minitest (>= 5.1)
16
17
  tzinfo (~> 2.0)
17
18
  byebug (11.1.3)
18
- concurrent-ruby (1.1.10)
19
- diff-lcs (1.4.4)
20
- dry-configurable (0.15.0)
21
- concurrent-ruby (~> 1.0)
22
- dry-core (~> 0.6)
23
- dry-core (0.8.0)
19
+ concurrent-ruby (1.2.0)
20
+ diff-lcs (1.5.0)
21
+ dry-configurable (1.0.1)
22
+ dry-core (~> 1.0, < 2)
23
+ zeitwerk (~> 2.6)
24
+ dry-core (1.0.0)
24
25
  concurrent-ruby (~> 1.0)
26
+ zeitwerk (~> 2.6)
25
27
  i18n (1.12.0)
26
28
  concurrent-ruby (~> 1.0)
27
- minitest (5.16.2)
29
+ minitest (5.17.0)
30
+ rack (3.0.4.1)
28
31
  rake (13.0.6)
29
- redis (4.7.1)
30
- rspec (3.10.0)
31
- rspec-core (~> 3.10.0)
32
- rspec-expectations (~> 3.10.0)
33
- rspec-mocks (~> 3.10.0)
32
+ redis (4.8.0)
33
+ roda (3.64.0)
34
+ rack
35
+ rspec (3.12.0)
36
+ rspec-core (~> 3.12.0)
37
+ rspec-expectations (~> 3.12.0)
38
+ rspec-mocks (~> 3.12.0)
34
39
  rspec-collection_matchers (1.2.0)
35
40
  rspec-expectations (>= 2.99.0.beta1)
36
- rspec-core (3.10.1)
37
- rspec-support (~> 3.10.0)
38
- rspec-expectations (3.10.1)
41
+ rspec-core (3.12.0)
42
+ rspec-support (~> 3.12.0)
43
+ rspec-expectations (3.12.2)
39
44
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.10.0)
41
- rspec-mocks (3.10.2)
45
+ rspec-support (~> 3.12.0)
46
+ rspec-mocks (3.12.3)
42
47
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.10.0)
44
- rspec-support (3.10.3)
48
+ rspec-support (~> 3.12.0)
49
+ rspec-support (3.12.0)
45
50
  tzinfo (2.0.5)
46
51
  concurrent-ruby (~> 1.0)
52
+ zeitwerk (2.6.6)
47
53
 
48
54
  PLATFORMS
49
55
  arm64-darwin-20
50
56
  ruby
51
57
 
52
58
  DEPENDENCIES
53
- byebug
59
+ byebug (~> 11.1)
54
60
  pears!
55
61
  rake (~> 13.0)
56
62
  rspec (~> 3.0)
57
63
  rspec-collection_matchers
58
64
 
59
65
  BUNDLED WITH
60
- 2.3.5
66
+ 2.3.22
@@ -26,7 +26,10 @@ module Pears
26
26
  private
27
27
 
28
28
  def parse_yaml(yaml_string)
29
- yaml_data = YAML.load(yaml_string)
29
+ yaml_data = YAML.load(
30
+ yaml_string,
31
+ permitted_classes: [ActiveSupport::HashWithIndifferentAccess, Hash]
32
+ )
30
33
 
31
34
  unless yaml_data.respond_to? :with_indifferent_access
32
35
  raise Pears::InvalidProviderData
data/lib/pears/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pears
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.4"
5
5
  end
@@ -0,0 +1,23 @@
1
+ <html>
2
+ <head>
3
+ <style><%=render('style')%></style>
4
+ </head>
5
+ <body>
6
+ <header>
7
+ <h1> Pears::Subjects </h1>
8
+ </header>
9
+ <main>
10
+ <nav>
11
+ <% @subjects.each do |subject| %>
12
+ <p> <a href=<%="./subjects/#{subject.name}"%>><%= subject.name %></a> </p>
13
+ <% end %>
14
+ </nav>
15
+ <section>
16
+ <p> No subject selected </p>
17
+ </section>
18
+ </main>
19
+
20
+ <footer>
21
+ <p class='p--footer' > Pears web-interface </p>
22
+ </footer>
23
+ </body>
@@ -0,0 +1,23 @@
1
+ <html>
2
+ <head>
3
+ <style><%=render('style')%></style>
4
+ </head>
5
+ <body>
6
+ <header>
7
+ <h1> Pears::Subjects </h1>
8
+ <form method="post">
9
+ <input type='submit' value='Reboot <%= @subject.name.to_s.humanize %>' name="reboot-<%=@subject.name%>}">
10
+ </form>
11
+ </header>
12
+ <main>
13
+ <nav>
14
+ <% @subjects.each do |subject| %>
15
+ <p> <a href=<%=subject.name%>><%= subject.name.to_s.humanize.capitalize %></a> </p>
16
+ <% end %>
17
+ </nav>
18
+ <section>
19
+ <h3><%= @subject.name.capitalize %></h3>
20
+ <div class='serialization'><%= JSON.pretty_generate(@subject.project) %></div>
21
+ </section>
22
+ </main>
23
+ </body>
@@ -0,0 +1,58 @@
1
+ body {
2
+ font-family: "Avenir", "Arial", sans-serif;
3
+ color: 222;padding: 0px 30px 10px 30px;
4
+ margin: 0;
5
+ background-color: FFF;
6
+ }
7
+
8
+ header {
9
+ padding-top: 4px;
10
+ height: 60px;
11
+ display: flex;
12
+ justify-content: space-between;
13
+ align-items: center;
14
+ }
15
+
16
+ main {
17
+ height: calc(100vh - 160px);
18
+ display: flex;
19
+ }
20
+
21
+ footer {
22
+ margin: 20px 20px 10px 20px;
23
+ height: 20px;
24
+ }
25
+
26
+ .p--footer {
27
+ width: 100%;
28
+ text-align: right;
29
+ }
30
+
31
+ nav {
32
+ padding: 0px 10px 10px 0;
33
+ display: block;
34
+ border-right: 1px solid #CCC;
35
+ min-width: 15%;
36
+ min-height: 100%;
37
+ }
38
+
39
+ section {
40
+ padding: 0px 10px 10px 20px;
41
+ width: 85%;
42
+ min-height: 100%;
43
+ }
44
+
45
+ .serialization {
46
+ font-family: 'SF mono', 'Courier', monospace;
47
+ white-space: pre;
48
+ background-color: eeeeee;
49
+ border-radius: 11px;
50
+ padding: 15px;
51
+ }
52
+
53
+ input[type=submit]{
54
+ padding: 10px 22px;
55
+ background-color: fff;
56
+ border-radius: 6px;
57
+ border: 1px solid #666;
58
+ }
data/lib/pears/web.rb ADDED
@@ -0,0 +1,38 @@
1
+ require 'roda'
2
+ require 'json'
3
+
4
+ module Pears
5
+ class Web < Roda
6
+ plugin :render, views: "#{__FILE__}/../web/views"
7
+
8
+ route do |r|
9
+ r.root do
10
+ r.redirect "#{request.path}index"
11
+ end
12
+
13
+ r.get "index" do
14
+ @subjects = Pears.subjects
15
+ render('index')
16
+ end
17
+
18
+ r.on "subjects" do
19
+ r.is do
20
+ r.redirect "#{request.path.delete_suffix('/subjects')}/index"
21
+ end
22
+
23
+ r.get String do |subject|
24
+ @subjects = Pears.subjects
25
+ @subject = Pears[subject.to_sym]
26
+ render('show')
27
+ end
28
+
29
+ r.post String do |subject|
30
+ @subjects = Pears.subjects
31
+ @subject = Pears[subject.to_sym]
32
+ @subject.reboot
33
+ render('show')
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
data/pears.gemspec CHANGED
@@ -1,35 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/pears/version"
3
+ require_relative 'lib/pears/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "pears"
6
+ spec.name = 'pears'
7
7
  spec.version = Pears::VERSION
8
- spec.authors = ["Steven Kemp"]
9
- spec.email = ["steven@remarkgroup.com"]
8
+ spec.authors = ['Steven Kemp', 'Nick Rockx']
9
+ spec.email = ['nick.rockx@remarkgroup.com']
10
10
 
11
- spec.summary = "An overly complicated library for juggling configuration data."
12
- spec.homepage = "https://bitbucket.org/ivaldi/rubygems-pears/src/master/"
13
- spec.license = "MIT"
14
- spec.required_ruby_version = ">= 2.7.4"
11
+ spec.summary = 'An overly complicated library for juggling configuration data.'
12
+ spec.homepage = 'https://bitbucket.org/ivaldi/rubygems-pears/src/master/'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = '>= 2.7.4'
15
15
 
16
- spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata['homepage_uri'] = spec.homepage
17
+ spec.metadata['rubygems_mfa_required'] = 'true'
17
18
 
18
19
  # Specify which files should be added to the gem when it is released.
19
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
21
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
22
23
  end
23
- spec.bindir = "exe"
24
+ spec.bindir = 'exe'
24
25
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
25
- spec.require_paths = ["lib"]
26
+ spec.require_paths = ['lib']
26
27
 
27
28
  # Uncomment to register a new dependency of your gem
28
- spec.add_dependency 'dry-configurable', '>= 0.13.0'
29
- spec.add_dependency 'activesupport'
30
- spec.add_dependency 'redis'
29
+ spec.add_dependency 'activesupport', '~> 7.0'
30
+ spec.add_dependency 'dry-configurable', '~> 1.0'
31
+ spec.add_dependency 'redis', '~> 4.8'
32
+ spec.add_dependency 'roda', '~> 3.60'
31
33
 
32
- spec.add_development_dependency 'byebug'
34
+ spec.add_development_dependency 'byebug', '~> 11.1'
33
35
  # For more information and examples about making a new gem, checkout our
34
36
  # guide at: https://bundler.io/guides/creating_gem.html
35
37
  end
metadata CHANGED
@@ -1,74 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Kemp
8
+ - Nick Rockx
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2022-07-22 00:00:00.000000000 Z
12
+ date: 2023-01-25 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- name: dry-configurable
15
+ name: activesupport
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - ">="
18
+ - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: 0.13.0
20
+ version: '7.0'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - ">="
25
+ - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: 0.13.0
27
+ version: '7.0'
27
28
  - !ruby/object:Gem::Dependency
28
- name: activesupport
29
+ name: dry-configurable
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - ">="
32
+ - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '0'
34
+ version: '1.0'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - ">="
39
+ - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '0'
41
+ version: '1.0'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: redis
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - ">="
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '4.8'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '4.8'
56
+ - !ruby/object:Gem::Dependency
57
+ name: roda
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
46
61
  - !ruby/object:Gem::Version
47
- version: '0'
62
+ version: '3.60'
48
63
  type: :runtime
49
64
  prerelease: false
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
52
- - - ">="
67
+ - - "~>"
53
68
  - !ruby/object:Gem::Version
54
- version: '0'
69
+ version: '3.60'
55
70
  - !ruby/object:Gem::Dependency
56
71
  name: byebug
57
72
  requirement: !ruby/object:Gem::Requirement
58
73
  requirements:
59
- - - ">="
74
+ - - "~>"
60
75
  - !ruby/object:Gem::Version
61
- version: '0'
76
+ version: '11.1'
62
77
  type: :development
63
78
  prerelease: false
64
79
  version_requirements: !ruby/object:Gem::Requirement
65
80
  requirements:
66
- - - ">="
81
+ - - "~>"
67
82
  - !ruby/object:Gem::Version
68
- version: '0'
83
+ version: '11.1'
69
84
  description:
70
85
  email:
71
- - steven@remarkgroup.com
86
+ - nick.rockx@remarkgroup.com
72
87
  executables: []
73
88
  extensions: []
74
89
  extra_rdoc_files: []
@@ -101,12 +116,17 @@ files:
101
116
  - lib/pears/testing.rb
102
117
  - lib/pears/testing/subject.rb
103
118
  - lib/pears/version.rb
119
+ - lib/pears/web.rb
120
+ - lib/pears/web/views/index.erb
121
+ - lib/pears/web/views/show.erb
122
+ - lib/pears/web/views/style.erb
104
123
  - pears.gemspec
105
124
  homepage: https://bitbucket.org/ivaldi/rubygems-pears/src/master/
106
125
  licenses:
107
126
  - MIT
108
127
  metadata:
109
128
  homepage_uri: https://bitbucket.org/ivaldi/rubygems-pears/src/master/
129
+ rubygems_mfa_required: 'true'
110
130
  post_install_message:
111
131
  rdoc_options: []
112
132
  require_paths:
@@ -122,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
142
  - !ruby/object:Gem::Version
123
143
  version: '0'
124
144
  requirements: []
125
- rubygems_version: 3.2.22
145
+ rubygems_version: 3.2.33
126
146
  signing_key:
127
147
  specification_version: 4
128
148
  summary: An overly complicated library for juggling configuration data.