stones 1.2.4 → 1.3.1

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: c345baf7bb8e2028cb8169be17cdca5a209e7394a07d1be6dd68fab67df0c8ec
4
- data.tar.gz: 1c3f9e8b56afbe1dd0d58874110f7e92c0e8e35ef4c73768741f8beec237e47c
3
+ metadata.gz: 6ece3ae88ecdb0fc34d65fb38b7d780df2383c92ee54d809a55d5ed1a49a26a5
4
+ data.tar.gz: 2303da40505b0ac5f6259e15594bc69631c7c64790db6bfbcefd5159e3c40d61
5
5
  SHA512:
6
- metadata.gz: c79e0733f0bbb0e9a5898fd6921299d618748c1e32eabba45834ed0d0cfb54eea778508ecd1f3b1bcdbafcb689762c735b2ca028ba90bd8be8377e3b1f97b2ab
7
- data.tar.gz: ed9c1617a920a62335afc3c9e66470420ede5290a36105e1064da8a6a4dd4094696349e779a9e4453f57838f1281236eb5806d98c5b88ccb2a6154dcc82ddee1
6
+ metadata.gz: 4ac6e38a839eacfc5b300c0d150773046cf12579517e47fabe9b1a1dcd1bbe4e9b4d40fa886dc6c8c359072d63f0baaa03fc691c26644c3a6689accee1fb30cb
7
+ data.tar.gz: eefba761d244bd4618fe910a8378ed41c143e2e71bf2454c31718cc093b7925fb8609cf32437fbd9a14173c520e43c96c3681a81dfd93191a78a05aa67801761
data/MIT-LICENSE CHANGED
@@ -1,6 +1,4 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2012-2023 Dittmar Krall (www.matiq.com)
1
+ Copyright (c) 2012-2024 Dittmar Krall (www.matiq.com)
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining
6
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Stones
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/stones.png)](http://badge.fury.io/rb/stones)
3
+ [![Gem Version](https://badge.fury.io/rb/stones.svg)](http://badge.fury.io/rb/stones)
4
4
  [![GEM Downloads](https://img.shields.io/gem/dt/stones?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/stones)
5
+ [![rake](https://github.com/matique/stones/actions/workflows/rake.yml/badge.svg)](https://github.com/matique/stones/actions/workflows/rake.yml)
6
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)
5
8
 
6
9
  Each time I created a new Rails project these files are required.
7
10
  I got tired of it and collected them in a gem.
@@ -14,10 +17,12 @@ Files:
14
17
  app/assets/images/facebook_32.png
15
18
  app/assets/images/github_32.png
16
19
  app/assets/images/google_32.png
17
- app/assets/images/matique.ico
20
+ app/assets/images/matiq.ico
18
21
  app/assets/images/twitter_32.png
19
22
  app/assets/stylesheets/print.css
20
23
  app/assets/stylesheets/reset.css
24
+ app/components/about_component.rb
25
+ app/components/flash_component.rb
21
26
  app/views/layouts/application.html.erb
22
27
  app/views/layouts/_body.slim
23
28
  app/views/layouts/_flash.slim
@@ -40,8 +45,8 @@ and run "bundle install".
40
45
  ## Recommended
41
46
 
42
47
  - rvm
43
- - ruby 3.1+
44
- - rails 7.0+
48
+ - ruby 3.3+
49
+ - rails 7.2+
45
50
 
46
51
  Dropped/cleaned files (still available in version 0.2.5):
47
52
 
@@ -49,11 +54,31 @@ Dropped/cleaned files (still available in version 0.2.5):
49
54
  - .watchr
50
55
  - lib/tasks/backup.rake
51
56
 
57
+ ## AboutComponent
58
+
59
+ ### Usage
60
+ ```ruby
61
+ ...
62
+ render AboutComponent(title: "My App", text: "Does something")
63
+ ...
64
+ ```
65
+
66
+ ## FlashComponent
67
+
68
+ ### Usage
69
+ ```ruby
70
+ ...
71
+ flash[:error] = "Something failed"
72
+ ...
73
+ render FlashComponent.new(flash)
74
+ ...
75
+ ```
76
+
52
77
  ## Rails
53
78
 
54
79
  "stones" takes care of a tag-head change introduced by Rails 7.x.
55
80
 
56
81
  ## Miscellaneous
57
82
 
58
- Copyright (c) 2012-2023 Dittmar Krall (www.matiq.com),
83
+ Copyright (c) 2012-2024 Dittmar Krall (www.matiq.com),
59
84
  released under the [MIT license](https://opensource.org/licenses/MIT).
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AboutComponent < ViewComponent::Base
4
+ def initialize(text: "", title: nil, system_text: nil)
5
+ @title = title
6
+ arr = text.split("\n")
7
+
8
+ arr += system_text ? system_text.split("\n") : system_default
9
+ arr << "Time #{Time.now.localtime}"
10
+ @lines = arr.flatten
11
+ end
12
+
13
+ slim_template <<~HEREDOC
14
+ css:
15
+ div.about {
16
+ height: 70%;
17
+ margin: 1em 0;
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ font-size: 1.2em;
22
+ font-weight: bold;
23
+ }
24
+ div.about div.rounded-box {
25
+ border: 1px solid grey;
26
+ border-radius: 0.3em;
27
+ padding: 5px 8px;
28
+ }
29
+
30
+ .about
31
+ .rounded-box
32
+ - if @title
33
+ h1 = @title
34
+ hr
35
+ - @lines.each do |line|
36
+ p = line
37
+ HEREDOC
38
+
39
+ private
40
+
41
+ def system_default
42
+ arr = []
43
+ str = "Ruby #{RUBY_VERSION}"
44
+ str += "-p#{RUBY_PATCHLEVEL}" unless Rails.env.production?
45
+ arr << str
46
+ str = "Rails #{Rails.version}"
47
+ str += " (#{Rails.env})" unless Rails.env.production?
48
+ arr << str
49
+ end
50
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ class FlashComponent < ViewComponent::Base
4
+ def initialize(flash = {})
5
+ @flash = flash
6
+ end
7
+
8
+ slim_template <<~HEREDOC
9
+ css:
10
+ .flash_notice {
11
+ animation: animate_notice 5s linear 2s forwards;
12
+ }
13
+ @keyframes animate_notice {
14
+ from { opacity: 1; }
15
+ to { opacity: 0; }
16
+ }
17
+
18
+ - @flash.each do |key, value|
19
+ p class="flash_#\{key}" = sanitize(value)
20
+ HEREDOC
21
+ end
@@ -1,21 +1,22 @@
1
1
  # frozen_string_literal: true
2
- # rubocop: disable all
3
2
 
4
3
  module Stones
5
- VERSION = '1.2.4' # 2023-12-13
6
- # VERSION = '1.2.3' # 2023-07-19
7
- # VERSION = '1.2.2' # 2023-04-15
8
- # VERSION = '1.2.1' # 2022-09-29
9
- # VERSION = '1.2.0' # 2022-02-12
10
- # VERSION = '1.1.3' # 2021-06-23
11
- # VERSION = '1.1.2' # 2020-04-27
12
- # VERSION = '1.1.1' # 2020-03-22
13
- # VERSION = '1.1.0' # 2020-03-02
14
- # VERSION = '1.0.10'# 2019-09-27
15
- # VERSION = '1.0.9' # 2018-11-11
16
- # VERSION = '1.0.7' # 2018-11-10
17
- # VERSION = '1.0.6' # 2018-10-29
18
- # VERSION = '1.0.5' # 2018-09-09
19
- # VERSION = '1.0.4' # 2018-08-06
20
- # VERSION = '1.0.3'
4
+ VERSION = "1.3.1" # 2024-10-21
5
+ # VERSION = "1.3.0" # 2024-04-20
6
+ # VERSION = "1.2.4" # 2023-12-13
7
+ # VERSION = "1.2.3" # 2023-07-19
8
+ # VERSION = "1.2.2" # 2023-04-15
9
+ # VERSION = "1.2.1" # 2022-09-29
10
+ # VERSION = "1.2.0" # 2022-02-12
11
+ # VERSION = "1.1.3" # 2021-06-23
12
+ # VERSION = "1.1.2" # 2020-04-27
13
+ # VERSION = "1.1.1" # 2020-03-22
14
+ # VERSION = "1.1.0" # 2020-03-02
15
+ # VERSION = "1.0.10"# 2019-09-27
16
+ # VERSION = "1.0.9" # 2018-11-11
17
+ # VERSION = "1.0.7" # 2018-11-10
18
+ # VERSION = "1.0.6" # 2018-10-29
19
+ # VERSION = "1.0.5" # 2018-09-09
20
+ # VERSION = "1.0.4" # 2018-08-06
21
+ # VERSION = "1.0.3"
21
22
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stones
4
+ VERSION = "1.3.0" # 2024-10-21
5
+ # VERSION = "1.3.0" # 2024-04-20
6
+ # VERSION = "1.2.4" # 2023-12-13
7
+ # VERSION = "1.2.3" # 2023-07-19
8
+ # VERSION = "1.2.2" # 2023-04-15
9
+ # VERSION = "1.2.1" # 2022-09-29
10
+ # VERSION = "1.2.0" # 2022-02-12
11
+ # VERSION = "1.1.3" # 2021-06-23
12
+ # VERSION = "1.1.2" # 2020-04-27
13
+ # VERSION = "1.1.1" # 2020-03-22
14
+ # VERSION = "1.1.0" # 2020-03-02
15
+ # VERSION = "1.0.10"# 2019-09-27
16
+ # VERSION = "1.0.9" # 2018-11-11
17
+ # VERSION = "1.0.7" # 2018-11-10
18
+ # VERSION = "1.0.6" # 2018-10-29
19
+ # VERSION = "1.0.5" # 2018-09-09
20
+ # VERSION = "1.0.4" # 2018-08-06
21
+ # VERSION = "1.0.3"
22
+ end
metadata CHANGED
@@ -1,36 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stones
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-13 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: combustion
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-spec-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
13
55
  description: A collection of, hopefully, useful files.
14
56
  email:
15
57
  - dittmar.krall@matiq.com
16
58
  executables: []
17
59
  extensions: []
18
- extra_rdoc_files: []
60
+ extra_rdoc_files:
61
+ - README.md
62
+ - MIT-LICENSE
19
63
  files:
20
- - ".gitignore"
21
- - ".ruby-gemset"
22
- - ".ruby-version"
23
- - Gemfile
24
64
  - MIT-LICENSE
25
65
  - README.md
26
- - Rakefile
27
66
  - app/assets/images/facebook_32.png
28
67
  - app/assets/images/github_32.png
29
68
  - app/assets/images/google_32.png
30
- - app/assets/images/matique.ico
69
+ - app/assets/images/matiq.ico
31
70
  - app/assets/images/twitter_32.png
32
71
  - app/assets/stylesheets/print.css
33
72
  - app/assets/stylesheets/reset.css
73
+ - app/components/about_component.rb
74
+ - app/components/flash_component.rb
34
75
  - app/views/layouts/_body.slim
35
76
  - app/views/layouts/_flash.slim
36
77
  - app/views/layouts/_footer.slim
@@ -43,12 +84,12 @@ files:
43
84
  - lib/stones.rb
44
85
  - lib/stones/engine.rb
45
86
  - lib/stones/version.rb
46
- - stones.gemspec
87
+ - lib/stones/version.rb.bak
47
88
  homepage: https://github.com/matique/stones
48
89
  licenses:
49
90
  - MIT
50
91
  metadata: {}
51
- post_install_message:
92
+ post_install_message:
52
93
  rdoc_options: []
53
94
  require_paths:
54
95
  - lib
@@ -63,8 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
104
  - !ruby/object:Gem::Version
64
105
  version: '0'
65
106
  requirements: []
66
- rubygems_version: 3.4.20
67
- signing_key:
107
+ rubygems_version: 3.5.20
108
+ signing_key:
68
109
  specification_version: 4
69
110
  summary: Stones contains some basic files.
70
111
  test_files: []
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- .bundle/
2
- coverage/
3
- .watchr
4
-
5
- *.gem
6
- *.log
7
- *.lock
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- rails-7.1
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-3.2.2
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
3
-
4
- gem "rails"
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- begin
2
- require "bundler"
3
- require "bundler/setup"
4
- rescue LoadError
5
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
6
- end
7
-
8
- Bundler::GemHelper.install_tasks
9
-
10
- desc "Clean automatically generated files"
11
- task :clean do
12
- FileUtils.rm_rf "pkg"
13
- end
data/stones.gemspec DELETED
@@ -1,18 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "stones/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "stones"
7
- s.version = Stones::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.summary = "Stones contains some basic files."
10
- s.description = "A collection of, hopefully, useful files."
11
- s.authors = ["Dittmar Krall"]
12
- s.email = ["dittmar.krall@matiq.com"]
13
- s.homepage = "https://github.com/matique/stones"
14
- s.license = "MIT"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.require_paths = ["lib"]
18
- end
File without changes