andrewmcodes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 48824676cbd22dd950c5d227ea1941678cbf0567dc732f0b20d9c36a471187e6
4
+ data.tar.gz: 3d68ae7823adcbca8e2510164d97ab120117091067afe6836eddf14f0a95f545
5
+ SHA512:
6
+ metadata.gz: cd5af15c15204af306bc6d368843a34ce25bf70bb479e23ed322a3084926f86f53da0817fb5e44b2faac0af2dc230d4db9f04538a2b6d125f37aca436dfa9c4c
7
+ data.tar.gz: 539fbe2d6ca43fcc044bdbd5fcb4180c0af3ed3656a1c490a23a486b952feea4ff6ae295ba9dfe1e09f0270eaaebca5eaca8ec5dbba3282f4089f71dfa077088
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,72 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6.0
3
+ Exclude:
4
+ - "bin/*"
5
+ - "./**/*.gemspec"
6
+ - "Gemfile"
7
+ - "Rakefile"
8
+ - "templates/*"
9
+ - vendor/bundle/**/*
10
+
11
+ Metrics/LineLength:
12
+ Max: 120
13
+
14
+ Metrics/BlockLength:
15
+ Exclude:
16
+ - "./**/spec/**/*"
17
+
18
+ Style/StringLiterals:
19
+ EnforcedStyle: double_quotes
20
+ Exclude:
21
+ - Gemfile
22
+
23
+ Layout/DotPosition:
24
+ # Multi-line method chaining should be done with trailing dots.
25
+ EnforcedStyle: trailing
26
+
27
+ Style/TrailingCommaInArguments:
28
+ # If `comma`, the cop requires a comma after the last argument, but only for
29
+ # parenthesized method calls where each argument is on its own line.
30
+ EnforcedStyleForMultiline: comma
31
+
32
+ Style/TrailingCommaInArrayLiteral:
33
+ # If `comma`, the cop requires a comma after the last item in an array,
34
+ # but only when each item is on its own line.
35
+ EnforcedStyleForMultiline: comma
36
+
37
+ Style/TrailingCommaInHashLiteral:
38
+ # If `comma`, the cop requires a comma after the last item in a hash,
39
+ # but only when each item is on its own line.
40
+ EnforcedStyleForMultiline: comma
41
+
42
+ Style/MutableConstant:
43
+ # Do not assign mutable objects to constants.
44
+ Enabled: false
45
+
46
+ Style/Documentation:
47
+ # Document classes and non-namespace modules
48
+ Enabled: false
49
+
50
+ Style/ClassAndModuleChildren:
51
+ # Checks style of children classes and modules.
52
+ Enabled: false
53
+
54
+ Style/FrozenStringLiteralComment:
55
+ # Checks existence of the frozen string literal comment
56
+ Enabled: true
57
+
58
+ Style/RescueStandardError:
59
+ # Checks that you are including the error class
60
+ # when you rescue
61
+ Enabled: false
62
+
63
+ Style/PercentLiteralDelimiters:
64
+ # Percent literal delimeters are always parentheses
65
+ PreferredDelimiters:
66
+ { default: (),
67
+ '%i': '()',
68
+ '%I': '()',
69
+ '%r': '()',
70
+ '%w': '()',
71
+ '%W': '()'
72
+ }
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.0
7
+ before_install: gem install bundler -v 1.17.2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in andrewmcodes.gemspec
6
+ gemspec
@@ -0,0 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ andrewmcodes (0.1.0)
5
+ artii
6
+ lolcat
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ artii (2.1.2)
12
+ ast (2.4.0)
13
+ coderay (1.1.2)
14
+ diff-lcs (1.3)
15
+ jaro_winkler (1.5.2)
16
+ lolcat (99.9.20)
17
+ manpages (~> 0.6.1)
18
+ optimist (~> 3.0.0)
19
+ paint (~> 2.0.0)
20
+ manpages (0.6.1)
21
+ method_source (0.9.2)
22
+ optimist (3.0.0)
23
+ paint (2.0.3)
24
+ parallel (1.12.1)
25
+ parser (2.5.3.0)
26
+ ast (~> 2.4.0)
27
+ powerpack (0.1.2)
28
+ pry (0.12.2)
29
+ coderay (~> 1.1.0)
30
+ method_source (~> 0.9.0)
31
+ rainbow (3.0.0)
32
+ rake (12.3.2)
33
+ rspec (3.8.0)
34
+ rspec-core (~> 3.8.0)
35
+ rspec-expectations (~> 3.8.0)
36
+ rspec-mocks (~> 3.8.0)
37
+ rspec-core (3.8.0)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-expectations (3.8.2)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.8.0)
42
+ rspec-mocks (3.8.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.8.0)
45
+ rspec-support (3.8.0)
46
+ rubocop (0.61.1)
47
+ jaro_winkler (~> 1.5.1)
48
+ parallel (~> 1.10)
49
+ parser (>= 2.5, != 2.5.1.1)
50
+ powerpack (~> 0.1)
51
+ rainbow (>= 2.2.2, < 4.0)
52
+ ruby-progressbar (~> 1.7)
53
+ unicode-display_width (~> 1.4.0)
54
+ ruby-progressbar (1.10.0)
55
+ unicode-display_width (1.4.1)
56
+
57
+ PLATFORMS
58
+ ruby
59
+
60
+ DEPENDENCIES
61
+ andrewmcodes!
62
+ bundler (~> 1.17)
63
+ pry
64
+ rake
65
+ rspec (~> 3.2)
66
+ rubocop (~> 0.61.0)
67
+
68
+ BUNDLED WITH
69
+ 1.17.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Andrew Mason
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.
@@ -0,0 +1,39 @@
1
+ # andrewmcodes_gem
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/andrewmcodes`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'andrewmcodes'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install andrewmcodes
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/andrewmcodes.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,31 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "andrewmcodes/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "andrewmcodes"
8
+ spec.version = Andrewmcodes::VERSION
9
+ spec.authors = ["Andrew Mason"]
10
+ spec.email = ["masonam96@outlook.com"]
11
+
12
+ spec.summary = "Create your ruby andrewmcodes"
13
+ spec.description = "Generates a gem for your andrewmcodes"
14
+ spec.homepage = "https://github.com/andrewmcodes/andrewmcodes"
15
+ spec.license = "MIT"
16
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.17"
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec", "~> 3.2"
27
+ spec.add_development_dependency "rubocop", "~> 0.61.0"
28
+
29
+ spec.add_dependency "artii"
30
+ spec.add_dependency "lolcat"
31
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "andrewmcodes"
5
+ require "pry"
6
+ Pry.start
@@ -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
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "pathname"
5
+
6
+ source_path = (Pathname.new(__FILE__).dirname + "../lib").expand_path
7
+ $LOAD_PATH << source_path
8
+
9
+ require "andrewmcodes"
10
+
11
+ if ["-v", "--version"].include? ARGV[0]
12
+ puts New::VERSION
13
+ exit 0
14
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "andrewmcodes/version"
4
+ require "andrewmcodes/center"
5
+ require "andrewmcodes/output"
6
+
7
+ module Andrewmcodes
8
+ class Error < StandardError; end
9
+
10
+ Output.new.log_to_console
11
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Andrewmcodes
4
+ class Center
5
+ attr_accessor :output, :columns
6
+
7
+ def initialize(output:, columns:)
8
+ @output = output
9
+ @columns = columns
10
+ end
11
+
12
+ def centering_spaces
13
+ if output.is_a? String
14
+ spaces(output.strip.length.to_i)
15
+ elsif output.is_a? Integer
16
+ spaces(output)
17
+ else
18
+ p "ERROR"
19
+ end
20
+ end
21
+
22
+ def spaces(length)
23
+ spaces_needed = ((columns - length) / 2) - 1
24
+ spaces_string = Array.new(spaces_needed, " ").join("")
25
+ spaces_string
26
+ end
27
+
28
+ def centered_content
29
+ spaces = centering_spaces
30
+ "#{spaces}#{output}#{spaces}"
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ Work: Ruby on Rails Developer
2
+ Twitter: https://twitter.com/andrewmcodes
3
+ Github: https://github.com/andrewmcodes
4
+ LinkedIn: https://www.linkedin.com/in/andrew-mason
5
+ Web: https://andrewmason.me
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "artii"
4
+ require "lolcat"
5
+ require "logger"
6
+ require "fileutils"
7
+ module Andrewmcodes
8
+ class Output
9
+ # delegate :centered_message, to: :center
10
+ def log_to_console
11
+ if terminal_width >= 83
12
+ # content = Center.new(terminal_width-83, terminal_width)
13
+ spces = Center.new(output: 83, columns: terminal_width)
14
+ move_over = spces.spaces(100)
15
+ ascii("#{move_over}andrewmcodes")
16
+
17
+ p
18
+ else
19
+ echo("\nAndrew Mason \/ andrewmcodes\n")
20
+ end
21
+
22
+ log_info
23
+ end
24
+
25
+ def terminal_width
26
+ @terminal_width ||= `tput cols`.strip.to_i
27
+ end
28
+
29
+ def ascii(a_string)
30
+ a = Artii::Base.new font: "slant"
31
+ out = a.asciify(a_string)
32
+ system("echo '#{out}' | lolcat")
33
+ end
34
+
35
+ def log_info
36
+ templates_root = File.expand_path(File.join(".", "."), File.dirname(__FILE__))
37
+ content = File.readlines "#{templates_root}/info.md"
38
+
39
+ File.open("./../../temp.md", "w") do |_file|
40
+ content.each do |line|
41
+ system("echo '#{centered_message(line)}' | lolcat")
42
+ end
43
+ end
44
+
45
+ FileUtils.rm("./../../temp.md")
46
+ end
47
+
48
+ def echo(message)
49
+ system("echo '#{centered_message(message)}'")
50
+ end
51
+
52
+ def centered_message(message)
53
+ content = Center.new(output: message, columns: terminal_width)
54
+ content.centered_content
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Andrewmcodes
4
+ VERSION = "0.1.0"
5
+ end
metadata ADDED
@@ -0,0 +1,159 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: andrewmcodes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Mason
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-01-11 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: '1.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
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: rake
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: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.61.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.61.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: artii
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: lolcat
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Generates a gem for your andrewmcodes
112
+ email:
113
+ - masonam96@outlook.com
114
+ executables:
115
+ - andrewmcodes
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".gitignore"
120
+ - ".rubocop.yml"
121
+ - ".travis.yml"
122
+ - Gemfile
123
+ - Gemfile.lock
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - andrewmcodes.gemspec
128
+ - bin/console
129
+ - bin/setup
130
+ - exe/andrewmcodes
131
+ - lib/andrewmcodes.rb
132
+ - lib/andrewmcodes/center.rb
133
+ - lib/andrewmcodes/info.md
134
+ - lib/andrewmcodes/output.rb
135
+ - lib/andrewmcodes/version.rb
136
+ homepage: https://github.com/andrewmcodes/andrewmcodes
137
+ licenses:
138
+ - MIT
139
+ metadata: {}
140
+ post_install_message:
141
+ rdoc_options: []
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ requirements: []
155
+ rubygems_version: 3.0.1
156
+ signing_key:
157
+ specification_version: 4
158
+ summary: Create your ruby andrewmcodes
159
+ test_files: []