spinup 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.
- checksums.yaml +7 -0
- data/.drone.yml +18 -0
- data/.gitignore +45 -0
- data/.rspec +3 -0
- data/.rubocop.yml +33 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +57 -0
- data/LICENSE.txt +21 -0
- data/README.md +61 -0
- data/Rakefile +6 -0
- data/bin/setup +8 -0
- data/exe/spinup +17 -0
- data/images/flask/app.py +9 -0
- data/images/flask/build.sh +4 -0
- data/images/flask/requirements.txt +6 -0
- data/images/flask/run.sh +3 -0
- data/images/jekyll/Gemfile +5 -0
- data/images/sass/Procfile +2 -0
- data/images/sass/index.html +59 -0
- data/images/sass/package.json +13 -0
- data/images/sass/scss/flex.scss +20 -0
- data/images/sass/scss/index.scss +10 -0
- data/images/sass/scss/navbar.scss +41 -0
- data/images/sass/scss/playground.scss +16 -0
- data/images/sass/scss/reset.scss +6 -0
- data/images/sass/scss/text.scss +25 -0
- data/images/sass/scss/unordered-list.scss +36 -0
- data/images/sinatra/Gemfile +4 -0
- data/images/sinatra/app.rb +4 -0
- data/images/sinatra/config.ru +3 -0
- data/images/typescript/Procfile +2 -0
- data/images/typescript/index.html +15 -0
- data/images/typescript/package.json +14 -0
- data/images/typescript/src/index.ts +2 -0
- data/images/typescript/tsconfig.json +70 -0
- data/lib/spinup.rb +16 -0
- data/lib/spinup/cli.rb +24 -0
- data/lib/spinup/colorized_string.rb +16 -0
- data/lib/spinup/config.rb +43 -0
- data/lib/spinup/locator.rb +11 -0
- data/lib/spinup/opener.rb +11 -0
- data/lib/spinup/playground.rb +64 -0
- data/lib/spinup/playground_builder.rb +20 -0
- data/lib/spinup/runner.rb +14 -0
- data/lib/spinup/version.rb +3 -0
- data/spinup.gemspec +32 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dea32ccca766c49d9466b1e3bb74b1e95ef26e7328366caa6677aeeff68ec2b0
|
4
|
+
data.tar.gz: 678c1d5df4ceb9de50c73b0a4630bdfd638710ef6911d732d77dd56fe6363701
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5f524bee8b12f139c71e618b13712ae232c2883dc40ce6ae8e5c45ea720c8ea073e6c2acb541855a9787d3895ee328c2f2720013fa65e3056da938214bff57d
|
7
|
+
data.tar.gz: 756be6d1befd2bd1c042c1ccb99b3eee3a117e4748ab81280c00da496e22f334273e8b26d5c3ff56407b183299348a2636c388a14dc1872682dc3aee33305b64
|
data/.drone.yml
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,45 @@
|
|
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
|
14
|
+
*.o
|
15
|
+
*.so
|
16
|
+
tmp/*
|
17
|
+
log/*
|
18
|
+
tmp/*/*
|
19
|
+
images_to_consider/*
|
20
|
+
!tmp/.gitkeep
|
21
|
+
*.swp
|
22
|
+
*.swo
|
23
|
+
*.swn
|
24
|
+
~*
|
25
|
+
*.log
|
26
|
+
*.tmp
|
27
|
+
*.pid
|
28
|
+
.vagrant
|
29
|
+
.DS_Store
|
30
|
+
|
31
|
+
.com.apple.timemachine.supported
|
32
|
+
.rvmrc
|
33
|
+
atlassian-ide-plugin.xml
|
34
|
+
.bundle
|
35
|
+
sqlnet.log
|
36
|
+
.sass-cache
|
37
|
+
test-artifacts/*
|
38
|
+
coverage
|
39
|
+
coverage/.resultset.json
|
40
|
+
coverage/.last_run.json
|
41
|
+
erd.pdf
|
42
|
+
test-reports
|
43
|
+
.vagrant
|
44
|
+
node_modules
|
45
|
+
public/client/*
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
Bundler/OrderedGems:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
Style/FrozenStringLiteralComment:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Style/MutableConstant:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Style/IfUnlessModifier:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Style/LambdaCall:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Style/ParallelAssignment:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Layout/LineLength:
|
23
|
+
Max: 90
|
24
|
+
|
25
|
+
AllCops:
|
26
|
+
Exclude:
|
27
|
+
- "spec/spec_helper.rb"
|
28
|
+
- "lib/spinup/cli.rb"
|
29
|
+
- "Gemfile"
|
30
|
+
- "Rakefile"
|
31
|
+
- "spinup.gemspec"
|
32
|
+
|
33
|
+
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
spinup (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.0)
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
jaro_winkler (1.5.4)
|
13
|
+
method_source (0.9.2)
|
14
|
+
parallel (1.19.1)
|
15
|
+
parser (2.7.0.2)
|
16
|
+
ast (~> 2.4.0)
|
17
|
+
pry (0.12.2)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.9.0)
|
20
|
+
rainbow (3.0.0)
|
21
|
+
rake (10.5.0)
|
22
|
+
rspec (3.9.0)
|
23
|
+
rspec-core (~> 3.9.0)
|
24
|
+
rspec-expectations (~> 3.9.0)
|
25
|
+
rspec-mocks (~> 3.9.0)
|
26
|
+
rspec-core (3.9.1)
|
27
|
+
rspec-support (~> 3.9.1)
|
28
|
+
rspec-expectations (3.9.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.9.0)
|
31
|
+
rspec-mocks (3.9.1)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.9.0)
|
34
|
+
rspec-support (3.9.2)
|
35
|
+
rubocop (0.79.0)
|
36
|
+
jaro_winkler (~> 1.5.1)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 2.7.0.1)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
ruby-progressbar (~> 1.7)
|
41
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
42
|
+
ruby-progressbar (1.10.1)
|
43
|
+
unicode-display_width (1.6.1)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
bundler (~> 2.1)
|
50
|
+
pry (~> 0.12.2)
|
51
|
+
rake (~> 10.0)
|
52
|
+
rspec (~> 3.0)
|
53
|
+
rubocop (~> 0.79)
|
54
|
+
spinup!
|
55
|
+
|
56
|
+
BUNDLED WITH
|
57
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Paul Grachev
|
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,61 @@
|
|
1
|
+
# Spinup
|
2
|
+
|
3
|
+
A gem for setting up playgrounds — small working apps for proof-of-concept stages.
|
4
|
+
|
5
|
+
Currently available for
|
6
|
+
- [Sinatra](http://sinatrarb.com/)
|
7
|
+
- [Typescript](https://www.typescriptlang.org/)
|
8
|
+
- [SASS/SCSS](https://sass-lang.com/)
|
9
|
+
- [Jekyll](https://jekyllrb.com/)
|
10
|
+
- [Flask](https://flask.palletsprojects.com/en/1.1.x/)
|
11
|
+
|
12
|
+
## Why?
|
13
|
+
Sometimes I want to check real quick if something works with some of the technologies I use.
|
14
|
+
|
15
|
+
Setting up a new project isn't a big pain, but it's like ten commands or something, and it's not like you do that every day, so you don't remember those anyway, do you? I usually go to one of my current projects and add some code somewhere to check if it works, but it's not ideal.
|
16
|
+
|
17
|
+
So I went and created a few playgrounds — small working apps which aren't much different from what you get by following 'Getting started' chapter of their documentation. And a gem for setting them up.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'spinup'
|
25
|
+
```
|
26
|
+
|
27
|
+
And then execute:
|
28
|
+
|
29
|
+
$ bundle
|
30
|
+
|
31
|
+
Or install it yourself as:
|
32
|
+
|
33
|
+
$ gem install spinup
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
Spin up a `sinatra` playground in current directory
|
38
|
+
```bash
|
39
|
+
$ spinup sinatra .
|
40
|
+
```
|
41
|
+
|
42
|
+
Spin up a `typescript` playground somewhere (*somewhere* is currently under `'~/.spinup-playgrounds'`)
|
43
|
+
```bash
|
44
|
+
$ spinup typescript
|
45
|
+
```
|
46
|
+
|
47
|
+
`-h` is for help and it also prints a list of currently available playgrounds
|
48
|
+
```bash
|
49
|
+
$ spinup -h
|
50
|
+
Usage: spinup <playground> [<directory>]
|
51
|
+
Supported playgrounds: sinatra, jekyll, typescript, flask, sass
|
52
|
+
-h, --help Prints this help
|
53
|
+
```
|
54
|
+
|
55
|
+
## Contributing
|
56
|
+
|
57
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/velll/spinup.
|
58
|
+
|
59
|
+
## License
|
60
|
+
|
61
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/setup
ADDED
data/exe/spinup
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'spinup'
|
5
|
+
|
6
|
+
# $LOAD_PATH.unshift File.dirname(__FILE__)
|
7
|
+
# $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib"
|
8
|
+
|
9
|
+
require 'securerandom'
|
10
|
+
require 'pry'
|
11
|
+
|
12
|
+
Spinup::CLI.parse(ARGV, Spinup::Config::PLAYGROUNDS.keys)
|
13
|
+
playground, directory = ARGV[0].to_sym, ARGV[1]
|
14
|
+
|
15
|
+
raise 'please specify playground to create' unless playground
|
16
|
+
|
17
|
+
Spinup::Runner.new(playground, directory)
|
data/images/flask/app.py
ADDED
data/images/flask/run.sh
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title>SCSS playground</title>
|
6
|
+
<link rel="stylesheet" href="css/index.css">
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<nav>
|
10
|
+
<ul>
|
11
|
+
<li class="active"><a href="#">Home</a></li>
|
12
|
+
<li class=""><a href="#">About</a></li>
|
13
|
+
<li><a href="#">Something</a></li>
|
14
|
+
<li><a href="#">Contact</a></li>
|
15
|
+
</ul>
|
16
|
+
</nav>
|
17
|
+
|
18
|
+
<section class="playground">
|
19
|
+
<h1>This is a SASS/SCSS playground</h1>
|
20
|
+
|
21
|
+
<h2>With a smooth list</h2>
|
22
|
+
<div class="smooth-list">
|
23
|
+
<ul>
|
24
|
+
<li><a href="#">A bunch</a></li>
|
25
|
+
<li><a href="#">Of elements</a></li>
|
26
|
+
<li><a href="#">Just thrown</a></li>
|
27
|
+
<li><a href="#">Together</a></li>
|
28
|
+
<li><a href="#">To play with</a></li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<hr/>
|
33
|
+
|
34
|
+
<h2>A flex container</h2>
|
35
|
+
|
36
|
+
<div class="flex-container">
|
37
|
+
<div class="flex-item">
|
38
|
+
1
|
39
|
+
</div>
|
40
|
+
<div class="flex-item">
|
41
|
+
2
|
42
|
+
</div>
|
43
|
+
<div class="flex-item">
|
44
|
+
3
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<hr/>
|
49
|
+
|
50
|
+
<chapter class="text-container">
|
51
|
+
<h2>And some text</h2>
|
52
|
+
<p>Some really stylish text just begging to be styled and styled well. What are you waiting for?</p>
|
53
|
+
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
|
54
|
+
</article>
|
55
|
+
</section>
|
56
|
+
</div>
|
57
|
+
|
58
|
+
</body>
|
59
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.flex-container {
|
2
|
+
background-color: lightblue;
|
3
|
+
|
4
|
+
width: 80%;
|
5
|
+
margin: 0 auto;
|
6
|
+
|
7
|
+
padding: 1em;
|
8
|
+
|
9
|
+
display: flex;
|
10
|
+
justify-content: space-around;
|
11
|
+
align-items: center;
|
12
|
+
}
|
13
|
+
|
14
|
+
.flex-item {
|
15
|
+
background-color: lightcoral;
|
16
|
+
|
17
|
+
width: 5em;
|
18
|
+
height: 5em;
|
19
|
+
padding: 1em;
|
20
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
@import 'reset';
|
2
|
+
@import 'playground';
|
3
|
+
// naming is pretty self explanatory but
|
4
|
+
|
5
|
+
@import 'navbar'; // some basic styling for beautiful navbar
|
6
|
+
@import 'unordered-list'; // that unordered list
|
7
|
+
@import 'flex'; // a flex container in the middle of the page
|
8
|
+
@import 'text'; // this is the part with text down bellow
|
9
|
+
|
10
|
+
// play here!
|
@@ -0,0 +1,41 @@
|
|
1
|
+
nav {
|
2
|
+
margin: 50px;
|
3
|
+
|
4
|
+
ul {
|
5
|
+
overflow: auto;
|
6
|
+
list-style-type: none;
|
7
|
+
}
|
8
|
+
|
9
|
+
li {
|
10
|
+
height: 25px;
|
11
|
+
float: left;
|
12
|
+
margin-right: 0px;
|
13
|
+
border-right: 1px solid #aaa;
|
14
|
+
padding: 0 20px;
|
15
|
+
|
16
|
+
&:last-child { // compiles to "nav li:last-child"
|
17
|
+
border-right: none;
|
18
|
+
}
|
19
|
+
|
20
|
+
a {
|
21
|
+
text-decoration: none;
|
22
|
+
color: #ccc;
|
23
|
+
font-size: 25px;
|
24
|
+
font-family: Helvetica, Verdana, sans-serif;
|
25
|
+
text-transform: uppercase;
|
26
|
+
letter-spacing: 0.2em;
|
27
|
+
transition: all 0.5s ease;
|
28
|
+
|
29
|
+
&:hover {
|
30
|
+
color: #666;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
li.active a {
|
36
|
+
font-weight: bold;
|
37
|
+
color: #333;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$title-fonts: Helvetica, Verdana, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
|
2
|
+
$body-fonts: Georgia, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
3
|
+
|
4
|
+
h1, h2, h3, h4, h5, h6, .title {
|
5
|
+
font-family: $title-fonts;
|
6
|
+
padding: 0.5em;
|
7
|
+
}
|
8
|
+
|
9
|
+
.text-container {
|
10
|
+
margin: 0 auto;
|
11
|
+
padding: 2em;
|
12
|
+
max-width: 90%;
|
13
|
+
|
14
|
+
font-family: $body-fonts;
|
15
|
+
color: #444444;
|
16
|
+
font-size: 18px;
|
17
|
+
line-height: 1.8;
|
18
|
+
|
19
|
+
text-shadow: 0 1px 0 #ffffff;
|
20
|
+
text-align: left;
|
21
|
+
|
22
|
+
p {
|
23
|
+
padding-top: 1em;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
div.smooth-list {
|
2
|
+
padding-left: 2em;
|
3
|
+
|
4
|
+
@media (min-width: 769px) {
|
5
|
+
max-width: 30%;
|
6
|
+
}
|
7
|
+
|
8
|
+
ul {
|
9
|
+
list-style-type: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
li {
|
13
|
+
font-weight: 200;
|
14
|
+
font-size: 20px;
|
15
|
+
line-height: 1.5;
|
16
|
+
font-family: Helvetica, Verdana, sans-serif;
|
17
|
+
border-bottom: 1px solid #ccc;
|
18
|
+
|
19
|
+
&:last-child {
|
20
|
+
border: none;
|
21
|
+
}
|
22
|
+
|
23
|
+
a {
|
24
|
+
text-decoration: none;
|
25
|
+
color: #000;
|
26
|
+
|
27
|
+
transition: font-size 0.3s ease, background-color 0.3s ease;
|
28
|
+
|
29
|
+
&:hover {
|
30
|
+
font-size: 30px;
|
31
|
+
background: #f6f6f6;
|
32
|
+
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title>Typescript playground</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<div id="hello" style="width: 300px; height: 300px; background-color: green">
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<script src="index.js"></script>
|
13
|
+
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "typescript-playground",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"main": "index.js",
|
5
|
+
"license": "MIT",
|
6
|
+
"private": true,
|
7
|
+
"devDependencies": {
|
8
|
+
"typescript": "^3.6.4",
|
9
|
+
"foreman": "^3.0.1",
|
10
|
+
"lite-server": "^2.5.4"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
/* Basic Options */
|
4
|
+
// "incremental": true, /* Enable incremental compilation */
|
5
|
+
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
6
|
+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
7
|
+
// "lib": [], /* Specify library files to be included in the compilation. */
|
8
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
9
|
+
// "checkJs": true, /* Report errors in .js files. */
|
10
|
+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
11
|
+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
12
|
+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
13
|
+
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
14
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
15
|
+
"outDir": "./dist", /* Redirect output structure to the directory. */
|
16
|
+
"rootDir": "./src/", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
17
|
+
// "composite": true, /* Enable project compilation */
|
18
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
19
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
20
|
+
// "noEmit": true, /* Do not emit outputs. */
|
21
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
22
|
+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
23
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
24
|
+
|
25
|
+
/* Strict Type-Checking Options */
|
26
|
+
"strict": true, /* Enable all strict type-checking options. */
|
27
|
+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
28
|
+
// "strictNullChecks": true, /* Enable strict null checks. */
|
29
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
30
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
31
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
32
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
33
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
34
|
+
|
35
|
+
/* Additional Checks */
|
36
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
37
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
38
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
39
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
40
|
+
|
41
|
+
/* Module Resolution Options */
|
42
|
+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
43
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
44
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
45
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
46
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
47
|
+
// "types": [], /* Type declaration files to be included in compilation. */
|
48
|
+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
49
|
+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
50
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
51
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
52
|
+
|
53
|
+
/* Source Map Options */
|
54
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
55
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
56
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
57
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
58
|
+
|
59
|
+
/* Experimental Options */
|
60
|
+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
61
|
+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
62
|
+
},
|
63
|
+
"include": [
|
64
|
+
"src/**/*"
|
65
|
+
],
|
66
|
+
"exclude": [
|
67
|
+
"node_modules",
|
68
|
+
"**/*.spec.ts"
|
69
|
+
]
|
70
|
+
}
|
data/lib/spinup.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spinup/version'
|
2
|
+
|
3
|
+
|
4
|
+
require 'spinup/cli'
|
5
|
+
require 'spinup/config'
|
6
|
+
require 'spinup/runner'
|
7
|
+
|
8
|
+
require 'spinup/colorized_string'
|
9
|
+
require 'spinup/locator'
|
10
|
+
require 'spinup/opener'
|
11
|
+
require 'spinup/playground_builder'
|
12
|
+
require 'spinup/playground'
|
13
|
+
|
14
|
+
module Spinup
|
15
|
+
class Error < StandardError; end
|
16
|
+
end
|
data/lib/spinup/cli.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module Spinup
|
4
|
+
class CLI
|
5
|
+
Options = Struct.new(:name)
|
6
|
+
|
7
|
+
def self.parse(options, supported)
|
8
|
+
args = Options.new('world')
|
9
|
+
|
10
|
+
opt_parser = OptionParser.new do |opts|
|
11
|
+
opts.banner = ['Usage: spinup <playground> [<directory>]',
|
12
|
+
"Supported playgrounds: #{supported.map(&:to_s).join(', ')}"].join("\n")
|
13
|
+
|
14
|
+
opts.on('-h', '--help', 'Prints this help') do
|
15
|
+
puts opts
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
opt_parser.parse!(options)
|
21
|
+
args
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Spinup
|
2
|
+
class ColorizedString < String
|
3
|
+
COLORS = {
|
4
|
+
red: 31,
|
5
|
+
green: 32,
|
6
|
+
yellow: 33,
|
7
|
+
blue: 34
|
8
|
+
}
|
9
|
+
|
10
|
+
def initialize(string, color)
|
11
|
+
raise NotImplementedError, "#{color} strings are not supported" if COLORS[color].nil?
|
12
|
+
|
13
|
+
super("\e[#{COLORS[color]}m#{string}\e[0m")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Spinup
|
2
|
+
module Config
|
3
|
+
DEFAULT_DIR = '~/.spinup-playgrounds'
|
4
|
+
PLAYGROUNDS = {
|
5
|
+
sinatra: {
|
6
|
+
copy_contents: true,
|
7
|
+
commands: [
|
8
|
+
'bundle',
|
9
|
+
'bundle exec shotgun'
|
10
|
+
]
|
11
|
+
},
|
12
|
+
jekyll: {
|
13
|
+
copy_contents: true,
|
14
|
+
commands: [
|
15
|
+
'bundle',
|
16
|
+
'bundle exec jekyll new . --force --blank',
|
17
|
+
'bundle exec jekyll serve'
|
18
|
+
]
|
19
|
+
},
|
20
|
+
typescript: {
|
21
|
+
copy_contents: true,
|
22
|
+
commands: [
|
23
|
+
'yarn install',
|
24
|
+
'yarn nf start'
|
25
|
+
]
|
26
|
+
},
|
27
|
+
flask: {
|
28
|
+
copy_contents: true,
|
29
|
+
commands: [
|
30
|
+
'sh build.sh',
|
31
|
+
'sh run.sh'
|
32
|
+
]
|
33
|
+
},
|
34
|
+
sass: {
|
35
|
+
copy_contents: true,
|
36
|
+
commands: [
|
37
|
+
'yarn install',
|
38
|
+
'yarn nf start'
|
39
|
+
]
|
40
|
+
}
|
41
|
+
}
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'spinup/colorized_string'
|
3
|
+
|
4
|
+
module Spinup
|
5
|
+
class Playground
|
6
|
+
class << self
|
7
|
+
def cd(where)
|
8
|
+
Dir.chdir(where)
|
9
|
+
end
|
10
|
+
|
11
|
+
def cp_r(from, where)
|
12
|
+
FileUtils.mkdir_p where
|
13
|
+
FileUtils.cp_r(from, where)
|
14
|
+
end
|
15
|
+
|
16
|
+
def with_empty_lines_around
|
17
|
+
puts
|
18
|
+
yield
|
19
|
+
puts
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(name, config)
|
24
|
+
@name = name
|
25
|
+
|
26
|
+
@copy = config[:copy_contents]
|
27
|
+
@commands = config[:commands]
|
28
|
+
end
|
29
|
+
|
30
|
+
def establish(where)
|
31
|
+
puts "establishing playgound at #{where}"
|
32
|
+
|
33
|
+
copy_contents(where) if @copy
|
34
|
+
|
35
|
+
yield if block_given?
|
36
|
+
|
37
|
+
run_commands(where)
|
38
|
+
end
|
39
|
+
|
40
|
+
def copy_contents(where)
|
41
|
+
self.class.cp_r(image_path, where)
|
42
|
+
|
43
|
+
puts "New #{@name} playground created under #{where}"
|
44
|
+
end
|
45
|
+
|
46
|
+
def image_path
|
47
|
+
"images/#{@name}/."
|
48
|
+
end
|
49
|
+
|
50
|
+
def run_commands(where)
|
51
|
+
@commands.each do |command|
|
52
|
+
self.class.with_empty_lines_around do
|
53
|
+
puts "=> running #{ColorizedString.new(command, :green)}"
|
54
|
+
end
|
55
|
+
|
56
|
+
# prevent using ./Gemfile when spawning ruby processes
|
57
|
+
Bundler.with_unbundled_env do
|
58
|
+
pid = Process.spawn(command, out: $stdout, err: $stderr, chdir: where)
|
59
|
+
Process.wait(pid)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
require 'spinup/opener'
|
4
|
+
require 'spinup/playground'
|
5
|
+
|
6
|
+
module Spinup
|
7
|
+
class PlaygroundBuilder
|
8
|
+
def initialize(dir, opener)
|
9
|
+
@dir = dir
|
10
|
+
@opener = opener
|
11
|
+
end
|
12
|
+
|
13
|
+
def call(playground_type, config)
|
14
|
+
abort "#{playground_type} is not supported." if config.nil?
|
15
|
+
|
16
|
+
playground = Playground.new(playground_type.to_sym, config)
|
17
|
+
playground.establish(@dir) { @opener.(@dir) }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Spinup
|
2
|
+
class Runner
|
3
|
+
def initialize(playground, dir)
|
4
|
+
default_dir = File.expand_path(Spinup::Config::DEFAULT_DIR)
|
5
|
+
session_key = SecureRandom.hex[0..6]
|
6
|
+
|
7
|
+
directory = dir || Locator.new(default_dir).(playground, session_key)
|
8
|
+
config = Config::PLAYGROUNDS[playground]
|
9
|
+
|
10
|
+
builder = PlaygroundBuilder.new(directory, Opener.new)
|
11
|
+
builder.(playground, config)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/spinup.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "spinup/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "spinup"
|
8
|
+
spec.version = Spinup::VERSION
|
9
|
+
spec.authors = ["Paul Grachev"]
|
10
|
+
spec.email = ["paul@paulgoesdeep.com"]
|
11
|
+
|
12
|
+
spec.summary = 'A tool for quickly spinning up dev environments'
|
13
|
+
spec.description = ''
|
14
|
+
spec.homepage = "https://github.com/velll/spinup"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
|
30
|
+
spec.add_development_dependency "rubocop", "~> 0.79"
|
31
|
+
spec.add_development_dependency "pry", "~> 0.12.2"
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spinup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Paul Grachev
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-01-21 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: '2.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.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: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.79'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.79'
|
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.12.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.12.2
|
83
|
+
description: ''
|
84
|
+
email:
|
85
|
+
- paul@paulgoesdeep.com
|
86
|
+
executables:
|
87
|
+
- spinup
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".drone.yml"
|
92
|
+
- ".gitignore"
|
93
|
+
- ".rspec"
|
94
|
+
- ".rubocop.yml"
|
95
|
+
- Gemfile
|
96
|
+
- Gemfile.lock
|
97
|
+
- LICENSE.txt
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- bin/setup
|
101
|
+
- exe/spinup
|
102
|
+
- images/flask/app.py
|
103
|
+
- images/flask/build.sh
|
104
|
+
- images/flask/requirements.txt
|
105
|
+
- images/flask/run.sh
|
106
|
+
- images/jekyll/Gemfile
|
107
|
+
- images/sass/Procfile
|
108
|
+
- images/sass/index.html
|
109
|
+
- images/sass/package.json
|
110
|
+
- images/sass/scss/flex.scss
|
111
|
+
- images/sass/scss/index.scss
|
112
|
+
- images/sass/scss/navbar.scss
|
113
|
+
- images/sass/scss/playground.scss
|
114
|
+
- images/sass/scss/reset.scss
|
115
|
+
- images/sass/scss/text.scss
|
116
|
+
- images/sass/scss/unordered-list.scss
|
117
|
+
- images/sinatra/Gemfile
|
118
|
+
- images/sinatra/app.rb
|
119
|
+
- images/sinatra/config.ru
|
120
|
+
- images/typescript/Procfile
|
121
|
+
- images/typescript/index.html
|
122
|
+
- images/typescript/package.json
|
123
|
+
- images/typescript/src/index.ts
|
124
|
+
- images/typescript/tsconfig.json
|
125
|
+
- lib/spinup.rb
|
126
|
+
- lib/spinup/cli.rb
|
127
|
+
- lib/spinup/colorized_string.rb
|
128
|
+
- lib/spinup/config.rb
|
129
|
+
- lib/spinup/locator.rb
|
130
|
+
- lib/spinup/opener.rb
|
131
|
+
- lib/spinup/playground.rb
|
132
|
+
- lib/spinup/playground_builder.rb
|
133
|
+
- lib/spinup/runner.rb
|
134
|
+
- lib/spinup/version.rb
|
135
|
+
- spinup.gemspec
|
136
|
+
homepage: https://github.com/velll/spinup
|
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.6
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: A tool for quickly spinning up dev environments
|
159
|
+
test_files: []
|