seated_plugin 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5d2066d25e4da27a8cb14780dd01e79c4f66a1c2
4
+ data.tar.gz: 97566c92885e591de85347c765d80e6863412803
5
+ SHA512:
6
+ metadata.gz: 057af3ff15869f59868ba7cf64f9356ce70a85b8860e73650c0377f8c5cf487b289610dc8d45020c66fc229e7bf5d764e1d347af31a9ecf3213348bb13d5d2d3
7
+ data.tar.gz: a5fa41d574af557fed0151fec0f8bf31d0a017acbed5d0bfe572bf089ff1cbb0afeaf14650108b8579598d3990a2f1a1ee6061a7aebacca9831ad76f613ee30b
@@ -0,0 +1,20 @@
1
+ Copyright 2018 vladfreel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # SeatedPlugin
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'seated_plugin'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install seated_plugin
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,33 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'SeatedPlugin'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:install) do |t|
27
+ t.libs << 'install'
28
+ t.pattern = 'install/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+
33
+ task default: :test
@@ -0,0 +1,10 @@
1
+ require 'rails/generators/base'
2
+ module SeatedPlugin
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+ def copy_initializer
6
+ template "seated_plugin.rb", "config/initializers/seated_plugin.rb"
7
+ puts "Install complete!"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,4 @@
1
+ SeatedPlugin.configure do |config|
2
+ # Set this options to what makes sense for you
3
+ # config.text = 'different_text'
4
+ end
@@ -0,0 +1,27 @@
1
+ module SeatedPlugin
2
+ class << self
3
+ attr_accessor :configuration
4
+ end
5
+ def self.configure
6
+ self.configuration ||= Configuration.new
7
+ yield(configuration)
8
+ if defined?(Rails::Server)||defined?(Rails::Console)
9
+ print configuration.text
10
+ end
11
+ end
12
+
13
+ class Configuration
14
+ attr_accessor :text
15
+
16
+ def initialize
17
+ @text = '░░░░██▄
18
+ ░░░██▀░░░░▐
19
+ ▌░███▄░░░░▐
20
+ ▌▐███░▀▄███▄▄▄██▄▄
21
+ ▌█████▌░░▌░░░░░░▌
22
+ ▌▀▀▀▌▐█░░▌░░░░░░▌
23
+ ▌▀▀▀▌▐█░░▌░░░░░░▌
24
+ ▌░░░▌░█▄▌░░░░░░░▌'
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,3 @@
1
+ module SeatedPlugin
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :seated_plugin do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,18 @@
1
+ require "generator_spec"
2
+ require 'spec_helper'
3
+ require 'generators/seated_plugin/install_generator.rb'
4
+ describe SeatedPlugin::InstallGenerator, type: :generator do
5
+ destination(File.expand_path("../../tmp", __FILE__))
6
+
7
+ before(:all) do
8
+ prepare_destination
9
+ end
10
+
11
+ it "creates a install initializer" do
12
+ run_generator
13
+ assert_file "config/initializers/seated_plugin.rb", "SeatedPlugin.config do |config|
14
+ # Set this options to what makes sense for you
15
+ # config.text = 'different_text'
16
+ end"
17
+ end
18
+ end
@@ -0,0 +1,33 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'seated_plugin'
3
+ describe SeatedPlugin do
4
+ it 'test config gem to default parameter text' do
5
+ SeatedPlugin.configure do |config|
6
+ # Set this options to what makes sense for you
7
+ # config.text = 'different_text'
8
+ end
9
+ expect(SeatedPlugin.configuration.text).to eq('░░░░██▄
10
+ ░░░██▀░░░░▐
11
+ ▌░███▄░░░░▐
12
+ ▌▐███░▀▄███▄▄▄██▄▄
13
+ ▌█████▌░░▌░░░░░░▌
14
+ ▌▀▀▀▌▐█░░▌░░░░░░▌
15
+ ▌▀▀▀▌▐█░░▌░░░░░░▌
16
+ ▌░░░▌░█▄▌░░░░░░░▌')
17
+
18
+ end
19
+ it 'test config gem to custom parameter text' do
20
+ SeatedPlugin.configure do |config|
21
+ config.text = 'aaa'
22
+ end
23
+ expect(SeatedPlugin.configuration.text).to eq('aaa')
24
+
25
+ end
26
+ # it 'test config gem to custom parameter text' do
27
+ # SeatedPlugin.configure do |config|
28
+ # # config.text = 'aaa'
29
+ # expect { config.text = 'aaa' }.to output("aaa").to_stdout
30
+ #
31
+ # end
32
+ # end
33
+ end
@@ -0,0 +1,33 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ # $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
17
+ # $LOAD_PATH.unshift(File.dirname(__FILE__))
18
+ # require 'rspec'
19
+ require 'bundler/setup'
20
+ Bundler.setup
21
+ require 'seated_plugin'
22
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
23
+ RSpec.configure do |config|
24
+ # config.expect_with :rspec do |expectations|
25
+ # expectations.include_chain_clauses_in_custom_matcher_descriptions = true
26
+ # end
27
+ #
28
+ # config.mock_with :rspec do |mocks|
29
+ # mocks.verify_partial_doubles = true
30
+ # end
31
+ #
32
+ # config.shared_context_metadata_behavior = :apply_to_host_groups
33
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: seated_plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - vladfreel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: byebug
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
+ description: ''
56
+ email:
57
+ - vladfreelmaster@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - MIT-LICENSE
63
+ - README.md
64
+ - Rakefile
65
+ - lib/generators/seated_plugin/install_generator.rb
66
+ - lib/generators/seated_plugin/templates/seated_plugin.rb
67
+ - lib/seated_plugin.rb
68
+ - lib/seated_plugin/version.rb
69
+ - lib/tasks/seated_plugin_tasks.rake
70
+ - spec/install_generator_spec.rb
71
+ - spec/module_test_spec.rb
72
+ - spec/spec_helper.rb
73
+ homepage: ''
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.6.11
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: ''
97
+ test_files:
98
+ - spec/module_test_spec.rb
99
+ - spec/spec_helper.rb
100
+ - spec/install_generator_spec.rb