painting_gem 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4f988f6dab1e17d4c3046df63ba80e1e4ec32b3c24a042cd96b84d768eb63322
4
+ data.tar.gz: 6869c3d3ac10d9a4fe6f45a24c87d1e7db28ebb9e34ea989344203fddc1ec893
5
+ SHA512:
6
+ metadata.gz: af6def5c0637b8b10d5080535f32fb13fc18076501538049e3461f63661653bf8a4981d59f49a469a5688cd1ee77e231f0ba02dd97e90c7d48f9a5a7f8403c8c
7
+ data.tar.gz: bdbe1eef8261115b725ba1d1828582ddb199c0e18a45a97f198075600e562c1c0ca78d31d24a462a7fb5f7ff0c03c0ad5dd820ee7c55a2b0358727db71ba6bfb
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ /.idea
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.3
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+ # Specify your gem's dependencies in painting_gem.gemspec
8
+ gemspec
9
+
10
+ gem "rake", "~> 12.0"
11
+ gem "rspec", "~> 3.0"
12
+ gem 'rails'
data/Gemfile.lock ADDED
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ painting_gem (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.2.3)
10
+ actionpack (= 5.2.3)
11
+ nio4r (~> 2.0)
12
+ websocket-driver (>= 0.6.1)
13
+ actionmailer (5.2.3)
14
+ actionpack (= 5.2.3)
15
+ actionview (= 5.2.3)
16
+ activejob (= 5.2.3)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.2.3)
20
+ actionview (= 5.2.3)
21
+ activesupport (= 5.2.3)
22
+ rack (~> 2.0)
23
+ rack-test (>= 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.2.3)
27
+ activesupport (= 5.2.3)
28
+ builder (~> 3.1)
29
+ erubi (~> 1.4)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.2.3)
33
+ activesupport (= 5.2.3)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.2.3)
36
+ activesupport (= 5.2.3)
37
+ activerecord (5.2.3)
38
+ activemodel (= 5.2.3)
39
+ activesupport (= 5.2.3)
40
+ arel (>= 9.0)
41
+ activestorage (5.2.3)
42
+ actionpack (= 5.2.3)
43
+ activerecord (= 5.2.3)
44
+ marcel (~> 0.3.1)
45
+ activesupport (5.2.3)
46
+ concurrent-ruby (~> 1.0, >= 1.0.2)
47
+ i18n (>= 0.7, < 2)
48
+ minitest (~> 5.1)
49
+ tzinfo (~> 1.1)
50
+ arel (9.0.0)
51
+ builder (3.2.3)
52
+ concurrent-ruby (1.1.5)
53
+ crass (1.0.4)
54
+ diff-lcs (1.3)
55
+ erubi (1.8.0)
56
+ globalid (0.4.2)
57
+ activesupport (>= 4.2.0)
58
+ i18n (1.6.0)
59
+ concurrent-ruby (~> 1.0)
60
+ loofah (2.2.3)
61
+ crass (~> 1.0.2)
62
+ nokogiri (>= 1.5.9)
63
+ mail (2.7.1)
64
+ mini_mime (>= 0.1.1)
65
+ marcel (0.3.3)
66
+ mimemagic (~> 0.3.2)
67
+ method_source (0.9.2)
68
+ mimemagic (0.3.3)
69
+ mini_mime (1.0.2)
70
+ mini_portile2 (2.4.0)
71
+ minitest (5.11.3)
72
+ nio4r (2.4.0)
73
+ nokogiri (1.10.3)
74
+ mini_portile2 (~> 2.4.0)
75
+ rack (2.0.7)
76
+ rack-test (1.1.0)
77
+ rack (>= 1.0, < 3)
78
+ rails (5.2.3)
79
+ actioncable (= 5.2.3)
80
+ actionmailer (= 5.2.3)
81
+ actionpack (= 5.2.3)
82
+ actionview (= 5.2.3)
83
+ activejob (= 5.2.3)
84
+ activemodel (= 5.2.3)
85
+ activerecord (= 5.2.3)
86
+ activestorage (= 5.2.3)
87
+ activesupport (= 5.2.3)
88
+ bundler (>= 1.3.0)
89
+ railties (= 5.2.3)
90
+ sprockets-rails (>= 2.0.0)
91
+ rails-dom-testing (2.0.3)
92
+ activesupport (>= 4.2.0)
93
+ nokogiri (>= 1.6)
94
+ rails-html-sanitizer (1.0.4)
95
+ loofah (~> 2.2, >= 2.2.2)
96
+ railties (5.2.3)
97
+ actionpack (= 5.2.3)
98
+ activesupport (= 5.2.3)
99
+ method_source
100
+ rake (>= 0.8.7)
101
+ thor (>= 0.19.0, < 2.0)
102
+ rake (12.3.3)
103
+ rspec (3.9.0)
104
+ rspec-core (~> 3.9.0)
105
+ rspec-expectations (~> 3.9.0)
106
+ rspec-mocks (~> 3.9.0)
107
+ rspec-core (3.9.1)
108
+ rspec-support (~> 3.9.1)
109
+ rspec-expectations (3.9.0)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.9.0)
112
+ rspec-mocks (3.9.1)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.9.0)
115
+ rspec-support (3.9.2)
116
+ sprockets (3.7.2)
117
+ concurrent-ruby (~> 1.0)
118
+ rack (> 1, < 3)
119
+ sprockets-rails (3.2.1)
120
+ actionpack (>= 4.0)
121
+ activesupport (>= 4.0)
122
+ sprockets (>= 3.0.0)
123
+ thor (0.20.3)
124
+ thread_safe (0.3.6)
125
+ tzinfo (1.2.5)
126
+ thread_safe (~> 0.1)
127
+ websocket-driver (0.7.1)
128
+ websocket-extensions (>= 0.1.0)
129
+ websocket-extensions (0.1.4)
130
+
131
+ PLATFORMS
132
+ ruby
133
+
134
+ DEPENDENCIES
135
+ bundler
136
+ painting_gem!
137
+ rails
138
+ rake (~> 12.0)
139
+ rspec (~> 3.0)
140
+
141
+ BUNDLED WITH
142
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 ViktoriyaHor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # PaintingGem
2
+
3
+ When executing commands rails command_name, the text is displayed in the logs.
4
+ It is possible to display your text\character image.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'painting_gem'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle install
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install painting_gem
21
+
22
+ ## Usage
23
+
24
+ By default the character image is displayed in the logs:
25
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
26
+ ░░░░░░░░░░░░░▄▄▄▄▄▄▄░░░░░░░░░
27
+ ░░░░░░░░░▄▀▀▀░░░░░░░▀▄░░░░░░░
28
+ ░░░░░░░▄▀░░░░░░░░░░░░▀▄░░░░░░
29
+ ░░░░░░▄▀░░░░░░░░░░▄▀▀▄▀▄░░░░░
30
+ ░░░░▄▀░░░░░░░░░░▄▀░░██▄▀▄░░░░
31
+ ░░░▄▀░░▄▀▀▀▄░░░░█░░░▀▀░█▀▄░░░
32
+ ░░░█░░█▄▄░░░█░░░▀▄░░░░░▐░█░░░
33
+ ░░▐▌░░█▀▀░░▄▀░░░░░▀▄▄▄▄▀░░█░░
34
+ ░░▐▌░░█░░░▄▀░░░░░░░░░░░░░░█░░
35
+ ░░▐▌░░░▀▀▀░░░░░░░░░░░░░░░░▐▌░
36
+ ░░▐▌░░░░░░░░░░░░░░░▄░░░░░░▐▌░
37
+ ░░▐▌░░░░░░░░░▄░░░░░█░░░░░░▐▌░
38
+ ░░░█░░░░░░░░░▀█▄░░▄█░░░░░░▐▌░
39
+ ░░░▐▌░░░░░░░░░░▀▀▀▀░░░░░░░▐▌░
40
+ ░░░░█░░░░░░░░░░░░░░░░░░░░░█░░
41
+ ░░░░▐▌▀▄░░░░░░░░░░░░░░░░░▐▌░░
42
+ ░░░░░█░░▀░░░░░░░░░░░░░░░░▀░░░
43
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
44
+
45
+ You can create an initializer for painting_gem and change the image.
46
+
47
+ Execute:
48
+
49
+ $ rails g painting_gem:install
50
+
51
+ The command is created config/initializers/painting_gem.rb
52
+
53
+ Change these configs in your file, for example:
54
+
55
+ PaintingGem.configure do |config|
56
+ # Set this options to what makes sense for you
57
+ config.file_path = 'lib/file.txt'
58
+ end
59
+
60
+ ## Contributing
61
+
62
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ViktoriyaHor/painting_gem.
63
+
64
+ ## License
65
+
66
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "painting_gem"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/file.txt ADDED
@@ -0,0 +1,19 @@
1
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
+ ░░░░░░░░░░░░░▄▄▄▄▄▄▄░░░░░░░░░
3
+ ░░░░░░░░░▄▀▀▀░░░░░░░▀▄░░░░░░░
4
+ ░░░░░░░▄▀░░░░░░░░░░░░▀▄░░░░░░
5
+ ░░░░░░▄▀░░░░░░░░░░▄▀▀▄▀▄░░░░░
6
+ ░░░░▄▀░░░░░░░░░░▄▀░░██▄▀▄░░░░
7
+ ░░░▄▀░░▄▀▀▀▄░░░░█░░░▀▀░█▀▄░░░
8
+ ░░░█░░█▄▄░░░█░░░▀▄░░░░░▐░█░░░
9
+ ░░▐▌░░█▀▀░░▄▀░░░░░▀▄▄▄▄▀░░█░░
10
+ ░░▐▌░░█░░░▄▀░░░░░░░░░░░░░░█░░
11
+ ░░▐▌░░░▀▀▀░░░░░░░░░░░░░░░░▐▌░
12
+ ░░▐▌░░░░░░░░░░░░░░░▄░░░░░░▐▌░
13
+ ░░▐▌░░░░░░░░░▄░░░░░█░░░░░░▐▌░
14
+ ░░░█░░░░░░░░░▀█▄░░▄█░░░░░░▐▌░
15
+ ░░░▐▌░░░░░░░░░░▀▀▀▀░░░░░░░▐▌░
16
+ ░░░░█░░░░░░░░░░░░░░░░░░░░░█░░
17
+ ░░░░▐▌▀▄░░░░░░░░░░░░░░░░░▐▌░░
18
+ ░░░░░█░░▀░░░░░░░░░░░░░░░░▀░░░
19
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PaintingGem
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path("../../templates", __FILE__)
7
+ desc "Creates PaintingGem initializer for your application"
8
+
9
+ def copy_initializer
10
+ template "painting_gem_initializer.rb", "config/initializers/painting_gem.rb"
11
+
12
+ puts "Install complete!"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ PaintingGem.configure do |config|
2
+ # Set this options to what makes sense for you
3
+ # config.file_path = 'different_file_path'
4
+ end
@@ -0,0 +1,7 @@
1
+ require_relative 'painting_gem/version'
2
+ require_relative 'painting_gem/configuration'
3
+ require_relative 'painting_gem/railtie'
4
+
5
+ module PaintingGem
6
+ class Error < StandardError; end
7
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PaintingGem
4
+
5
+ class << self
6
+ attr_accessor :configuration
7
+
8
+ def configure
9
+ @configuration ||= Configuration.new
10
+ yield(configuration) if block_given?
11
+ end
12
+ def reset
13
+ @configuration = Configuration.new
14
+ end
15
+ end
16
+
17
+ class Configuration
18
+
19
+ attr_accessor :file_path
20
+
21
+ def initialize
22
+ @file_path = gem_file_path
23
+ end
24
+
25
+ private
26
+
27
+ def gem_file_path
28
+ gem_root = File.expand_path '../..', __FILE__
29
+ gem_root + "/file.txt"
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails'
4
+
5
+ module PaintingGem
6
+
7
+ class MyRailtie < Rails::Railtie
8
+ config.after_initialize do
9
+ PaintingGem.configure
10
+ File.foreach( PaintingGem.configuration.file_path ) do |line|
11
+ puts line
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PaintingGem
4
+ VERSION = '0.1.0'
5
+ end
@@ -0,0 +1,31 @@
1
+ require_relative 'lib/painting_gem/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "painting_gem"
5
+ spec.version = PaintingGem::VERSION
6
+ spec.authors = ["ViktoriyaHor"]
7
+ spec.email = ["vhoroshun.face@gmail.com"]
8
+
9
+ spec.summary = "painting_gem"
10
+ spec.description = "displays the text in the logs"
11
+ spec.homepage = "https://rubygems.org/gems/painting_gem"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.add_development_dependency "bundler"
16
+ spec.add_development_dependency "rake"
17
+ spec.add_development_dependency "rspec"
18
+ spec.add_development_dependency "rails"
19
+
20
+ spec.metadata["homepage_uri"] = spec.homepage
21
+ spec.metadata["source_code_uri"] = "https://github.com/ViktoriyaHor/Painting_gem"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: painting_gem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ViktoriyaHor
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
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: rake
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: rspec
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'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: displays the text in the logs
70
+ email:
71
+ - vhoroshun.face@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".idea/.gitignore"
78
+ - ".idea/.rakeTasks"
79
+ - ".idea/inspectionProfiles/Project_Default.xml"
80
+ - ".idea/misc.xml"
81
+ - ".idea/modules.xml"
82
+ - ".idea/painting_gem.iml"
83
+ - ".idea/vcs.xml"
84
+ - ".rspec"
85
+ - ".travis.yml"
86
+ - Gemfile
87
+ - Gemfile.lock
88
+ - LICENSE.txt
89
+ - README.md
90
+ - Rakefile
91
+ - bin/console
92
+ - bin/setup
93
+ - lib/file.txt
94
+ - lib/generators/painting_gem/install_generator.rb
95
+ - lib/generators/templates/painting_gem_initializer.rb
96
+ - lib/painting_gem.rb
97
+ - lib/painting_gem/configuration.rb
98
+ - lib/painting_gem/railtie.rb
99
+ - lib/painting_gem/version.rb
100
+ - painting_gem.gemspec
101
+ homepage: https://rubygems.org/gems/painting_gem
102
+ licenses:
103
+ - MIT
104
+ metadata:
105
+ homepage_uri: https://rubygems.org/gems/painting_gem
106
+ source_code_uri: https://github.com/ViktoriyaHor/Painting_gem
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: 2.3.0
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubygems_version: 3.0.3
123
+ signing_key:
124
+ specification_version: 4
125
+ summary: painting_gem
126
+ test_files: []