juans_world 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: 5a3319e622fe394e9ef9a877a92576da890577a8370c125d8902a0f11cd54865
4
+ data.tar.gz: 8e41942ce64c6d66061f38aa838641f2c6b7725bcd43638cfe334d67801c48c3
5
+ SHA512:
6
+ metadata.gz: 695b87492d2f4b6b313ac8960d5cf72afab10d3ad1e41e2ce683b66053edabc9a8a360ff603fea33019321376908e9a82151679cc2758cfa17311fbdde8c6625
7
+ data.tar.gz: 38a27e0a34e5b78b08fb99fb0e9949a1ae53189c7201f570eb6d41ef60f3707e2b65990b01fa532353784fba2fc556b027784903d8a90ebf6f4cfc3cd827fb79
@@ -0,0 +1,11 @@
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
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.2
7
+ before_install: gem install bundler -v 1.17.3
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 juans_world.gemspec
6
+ gemspec
@@ -0,0 +1,43 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ juans_world (0.1.0)
5
+ mcli
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ mcli (0.6.0)
13
+ method_source (0.9.2)
14
+ pry (0.12.2)
15
+ coderay (~> 1.1.0)
16
+ method_source (~> 0.9.0)
17
+ rake (13.0.0)
18
+ rspec (3.9.0)
19
+ rspec-core (~> 3.9.0)
20
+ rspec-expectations (~> 3.9.0)
21
+ rspec-mocks (~> 3.9.0)
22
+ rspec-core (3.9.0)
23
+ rspec-support (~> 3.9.0)
24
+ rspec-expectations (3.9.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.9.0)
27
+ rspec-mocks (3.9.0)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.9.0)
30
+ rspec-support (3.9.0)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ bundler
37
+ juans_world!
38
+ pry
39
+ rake
40
+ rspec
41
+
42
+ BUNDLED WITH
43
+ 1.17.3
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 TODO: Write your name
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
+ # JuansWorld
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/juans_world`. 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 'juans_world'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install juans_world
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 spec` 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]/juans_world.
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,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "juans_world"
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__)
@@ -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,36 @@
1
+ #!/usr/bin/env ruby
2
+ require 'mcli'
3
+ require 'juans_world'
4
+
5
+ require 'juans_world/commands/app.rb'
6
+
7
+ class Juan< MCLI::Command
8
+ register_as_root
9
+
10
+ def run
11
+ help
12
+ end
13
+
14
+ def help
15
+ puts <<~HERE
16
+ Welcome to Juan's world!
17
+ Verion: #{JuansWorld::VERSION}
18
+
19
+ Available Commands:
20
+ #{list_commands}
21
+
22
+ HERE
23
+ end
24
+
25
+ private
26
+
27
+ def list_commands
28
+ MCLI::CommandGroup.commands.map do |name, klass|
29
+ " #{name}: #{klass.description}"
30
+ end.join("\n")
31
+ rescue => e
32
+ puts e.inspect
33
+ end
34
+ end
35
+
36
+ MCLI.run
@@ -0,0 +1,42 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "juans_world/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "juans_world"
8
+ spec.version = JuansWorld::VERSION
9
+ spec.authors = ["John Thomas"]
10
+ spec.email = ["thomas07@vt.edu"]
11
+
12
+ spec.summary = %q{A gem I use for random things.}
13
+ spec.description = %q{This is my gem. Don't use it.}
14
+ spec.homepage = "https://github.com/thomas07vt/juans_world"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["homepage_uri"] = spec.homepage
21
+ spec.metadata["source_code_uri"] = "https://github.com/thomas07vt/juans_world"
22
+ spec.metadata["changelog_uri"] = "https://github.com/thomas07vt/juans_world"
23
+ else
24
+ raise "RubyGems 2.0 or newer is required to protect against " \
25
+ "public gem pushes."
26
+ end
27
+
28
+ # Specify which files should be added to the gem when it is released.
29
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+ end
33
+ spec.bindir = "exe"
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ["lib"]
36
+ spec.add_dependency "mcli"
37
+
38
+ spec.add_development_dependency "bundler"
39
+ spec.add_development_dependency "rake"
40
+ spec.add_development_dependency "rspec"
41
+ spec.add_development_dependency "pry"
42
+ end
@@ -0,0 +1,6 @@
1
+ require "juans_world/version"
2
+
3
+ module JuansWorld
4
+ class Error < StandardError; end
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,95 @@
1
+ require 'open3'
2
+ class App < MCLI::Command
3
+ register_as :app
4
+ description "Create a new rails app with juan's defaults"
5
+ option :database, alias: 'd', default: 'postgresql'
6
+ option 'skip-sprockets', boolean: true, default: true
7
+ option 'skip-coffee', boolean: true, default: true
8
+ option 'skip-test', boolean: true, default: true
9
+ option 'skip-turbolinks', boolean: true, default: true
10
+ option 'webpack', default: 'vue'
11
+
12
+ def run
13
+ @app_name = args[0]
14
+ run_command rails_new
15
+ Dir.chdir("./#{@app_name}")
16
+ run_command procfile
17
+ run_command bin_up
18
+ run_command bundle_add
19
+ run_command bundle_add_dev_test
20
+ run_command db_up
21
+ run_command rspec
22
+ run_command devise
23
+ run_command tailwindcss
24
+ end
25
+
26
+ def help
27
+ puts "#{self.class.description}\n\n#{parser.to_s}"
28
+ end
29
+
30
+ private
31
+
32
+ def run_command(cmd)
33
+ puts 'RUN: '
34
+ puts "#{cmd}\n\n"
35
+
36
+ Open3.popen3(cmd) do |stdout, stderr, status, thread|
37
+ while err=stderr.gets do
38
+ puts(err)
39
+ end
40
+
41
+ while out=stdout.gets do
42
+ puts(out)
43
+ end
44
+
45
+ rescue IOError => e
46
+ end
47
+ end
48
+
49
+ def rails_new
50
+ "rails new #{@app_name} " \
51
+ "-d #{options[:database] } " \
52
+ "#{'--skip-sprockets' if options[:'skip-sprockets']} " \
53
+ "#{'--skip-coffee' if options[:'skip-coffee']} " \
54
+ "#{'--skip-test' if options[:'skip-test']} " \
55
+ "#{'--skip-turbolinks' if options[:'skip-turbolinks']} " \
56
+ "--webpack=#{options[:webpack]}"
57
+ end
58
+
59
+ def procfile
60
+ "echo -e 'web: bundle exec rails s\nwebpacker: ./bin/webpack-dev-server' > Procfile.dev"
61
+ end
62
+
63
+ def bin_up
64
+ "echo -e '#!/bin/bash\n\nforeman start -f Procfile.dev' > bin/up && chmod +x bin/up"
65
+ end
66
+
67
+ def bundle_add
68
+ 'bundle add redis devise name_of_person rack-mini-profiler flamegraph stackprof memory_profiler active_model_serializers pundit bullet rack-attack'
69
+ end
70
+
71
+ def bundle_add_dev_test
72
+ "bundle add foreman rspec-rails pry rubocop rubocop-rails factory_bot_rails " \
73
+ "capybara chromedriver-helper selenium-webdriver shoulda-matchers " \
74
+ "dotenv-rails simplecov --group 'development, test'"
75
+ end
76
+
77
+ def db_up
78
+ 'rails db:create && rails db:migrate'
79
+ end
80
+
81
+ def rspec
82
+ 'rails generate rspec:install'
83
+ end
84
+
85
+ def devise
86
+ 'rails generate devise:install && rails generate devise User && rails g devise:views'
87
+ end
88
+
89
+ def tailwindcss
90
+ "yarn add tailwindcss --dev " \
91
+ "&& mkdir app/javascript/css " \
92
+ "&& node_modules/.bin/tailwind init " \
93
+ "&& sed -i '/ plugins: \[/a\ \ \ \ require('\"'\"'tailwindcss'\"'\"'),' postcss.config.js"
94
+ end
95
+ end
@@ -0,0 +1,3 @@
1
+ module JuansWorld
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: juans_world
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - John Thomas
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mcli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
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: bundler
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: '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
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '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'
83
+ description: This is my gem. Don't use it.
84
+ email:
85
+ - thomas07@vt.edu
86
+ executables:
87
+ - juan
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - ".rspec"
93
+ - ".travis.yml"
94
+ - Gemfile
95
+ - Gemfile.lock
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - exe/juan
102
+ - juans_world.gemspec
103
+ - lib/juans_world.rb
104
+ - lib/juans_world/commands/app.rb
105
+ - lib/juans_world/version.rb
106
+ homepage: https://github.com/thomas07vt/juans_world
107
+ licenses:
108
+ - MIT
109
+ metadata:
110
+ homepage_uri: https://github.com/thomas07vt/juans_world
111
+ source_code_uri: https://github.com/thomas07vt/juans_world
112
+ changelog_uri: https://github.com/thomas07vt/juans_world
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubygems_version: 3.0.6
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: A gem I use for random things.
132
+ test_files: []