railsdock 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/CHANGELOG.md +0 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +173 -0
  9. data/LICENSE.txt +20 -0
  10. data/README.md +55 -0
  11. data/Rakefile +14 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/exe/railsdock +18 -0
  15. data/ext/railsdock/extconf.rb +3 -0
  16. data/ext/railsdock/railsdock.c +9 -0
  17. data/ext/railsdock/railsdock.h +6 -0
  18. data/lib/railsdock.rb +6 -0
  19. data/lib/railsdock/cli.rb +33 -0
  20. data/lib/railsdock/command.rb +101 -0
  21. data/lib/railsdock/commands/install.rb +142 -0
  22. data/lib/railsdock/logo.rb +49 -0
  23. data/lib/railsdock/templates/install/default/Dockerfile +101 -0
  24. data/lib/railsdock/templates/install/default/default.env.erb +44 -0
  25. data/lib/railsdock/templates/install/default/docker-compose.mac.yml +7 -0
  26. data/lib/railsdock/templates/install/default/docker-compose.yml.erb +51 -0
  27. data/lib/railsdock/templates/install/memcached/Dockerfile +7 -0
  28. data/lib/railsdock/templates/install/memcached/docker-compose.yml.erb +11 -0
  29. data/lib/railsdock/templates/install/mysql/Dockerfile +7 -0
  30. data/lib/railsdock/templates/install/mysql/database.yml.erb +18 -0
  31. data/lib/railsdock/templates/install/mysql/docker-compose.yml.erb +13 -0
  32. data/lib/railsdock/templates/install/postgres/Dockerfile +7 -0
  33. data/lib/railsdock/templates/install/postgres/database.yml.erb +18 -0
  34. data/lib/railsdock/templates/install/postgres/docker-compose.yml.erb +11 -0
  35. data/lib/railsdock/templates/install/redis/Dockerfile +7 -0
  36. data/lib/railsdock/templates/install/redis/docker-compose.yml.erb +11 -0
  37. data/lib/railsdock/version.rb +3 -0
  38. data/railsdock.gemspec +60 -0
  39. data/railsdock.png +0 -0
  40. metadata +393 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d339299c3a6c1b22b082de5c461978bbf92ea22d83b17d976ed7b8898c6dd012
4
+ data.tar.gz: 3bcc01e71f6656c6316d6281f9dc397e9ca8eab223c801fa0d5932c01b6db7b2
5
+ SHA512:
6
+ metadata.gz: ea794ce592be3efc2e8912dfb5fbd7417eab6f1a63daf4926dbb7dbf75d4309855094647f325f0c9d4aa2721d6775b79aa2127d48bef4c0b9af4148e8ffa6e2b
7
+ data.tar.gz: '069a81aacf7300d2c3360340648caf801dbcbc5ccdccc081a0a6889a270422d10e5aadaacce68d665675db79da7e1960602338c8e4a8cf72cf47ac093a029ef5'
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.bundle
10
+ *.so
11
+ *.o
12
+ *.a
13
+ mkmf.log
14
+ .DS_Store
15
+ # rspec failure tracking
16
+ .rspec_status
17
+ /docker/*
18
+ *.env
19
+ dev-entrypoint
20
+ /docker-compose.*
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -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 2.0.1
data/CHANGELOG.md ADDED
File without changes
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ksboe1@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,173 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ railsdock (0.1.0)
5
+ bundler (~> 2.0)
6
+ pastel (~> 0.7.2)
7
+ railties (>= 4.2, < 6.1)
8
+ thor (~> 1.0.0)
9
+ tty-box (~> 0.4.0)
10
+ tty-color (~> 0.4)
11
+ tty-command (~> 0.8.0)
12
+ tty-config (~> 0.3.0)
13
+ tty-cursor (~> 0.7)
14
+ tty-editor (~> 0.5.0)
15
+ tty-file (~> 0.7.0)
16
+ tty-markdown (~> 0.5.0)
17
+ tty-platform (~> 0.2.0)
18
+ tty-progressbar (~> 0.17.0)
19
+ tty-prompt (~> 0.19.0)
20
+ tty-spinner (~> 0.9.0)
21
+
22
+ GEM
23
+ remote: https://rubygems.org/
24
+ specs:
25
+ actionpack (6.0.2)
26
+ actionview (= 6.0.2)
27
+ activesupport (= 6.0.2)
28
+ rack (~> 2.0)
29
+ rack-test (>= 0.6.3)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
32
+ actionview (6.0.2)
33
+ activesupport (= 6.0.2)
34
+ builder (~> 3.1)
35
+ erubi (~> 1.4)
36
+ rails-dom-testing (~> 2.0)
37
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
38
+ activesupport (6.0.2)
39
+ concurrent-ruby (~> 1.0, >= 1.0.2)
40
+ i18n (>= 0.7, < 2)
41
+ minitest (~> 5.1)
42
+ tzinfo (~> 1.1)
43
+ zeitwerk (~> 2.2)
44
+ appraisal (2.2.0)
45
+ bundler
46
+ rake
47
+ thor (>= 0.14.0)
48
+ builder (3.2.4)
49
+ coderay (1.1.2)
50
+ concurrent-ruby (1.1.5)
51
+ crass (1.0.5)
52
+ diff-lcs (1.3)
53
+ equatable (0.6.1)
54
+ erubi (1.9.0)
55
+ i18n (1.7.0)
56
+ concurrent-ruby (~> 1.0)
57
+ kramdown (1.16.2)
58
+ loofah (2.4.0)
59
+ crass (~> 1.0.2)
60
+ nokogiri (>= 1.5.9)
61
+ method_source (0.9.2)
62
+ mini_portile2 (2.4.0)
63
+ minitest (5.13.0)
64
+ necromancer (0.5.1)
65
+ nokogiri (1.10.7)
66
+ mini_portile2 (~> 2.4.0)
67
+ pastel (0.7.3)
68
+ equatable (~> 0.6)
69
+ tty-color (~> 0.5)
70
+ pry (0.12.2)
71
+ coderay (~> 1.1.0)
72
+ method_source (~> 0.9.0)
73
+ pry-rails (0.3.9)
74
+ pry (>= 0.10.4)
75
+ rack (2.0.7)
76
+ rack-test (1.1.0)
77
+ rack (>= 1.0, < 3)
78
+ rails-dom-testing (2.0.3)
79
+ activesupport (>= 4.2.0)
80
+ nokogiri (>= 1.6)
81
+ rails-html-sanitizer (1.3.0)
82
+ loofah (~> 2.3)
83
+ railties (6.0.2)
84
+ actionpack (= 6.0.2)
85
+ activesupport (= 6.0.2)
86
+ method_source
87
+ rake (>= 0.8.7)
88
+ thor (>= 0.20.3, < 2.0)
89
+ rake (10.5.0)
90
+ rake-compiler (1.0.8)
91
+ rake
92
+ rouge (3.14.0)
93
+ rspec (3.9.0)
94
+ rspec-core (~> 3.9.0)
95
+ rspec-expectations (~> 3.9.0)
96
+ rspec-mocks (~> 3.9.0)
97
+ rspec-core (3.9.0)
98
+ rspec-support (~> 3.9.0)
99
+ rspec-expectations (3.9.0)
100
+ diff-lcs (>= 1.2.0, < 2.0)
101
+ rspec-support (~> 3.9.0)
102
+ rspec-mocks (3.9.0)
103
+ diff-lcs (>= 1.2.0, < 2.0)
104
+ rspec-support (~> 3.9.0)
105
+ rspec-support (3.9.0)
106
+ strings (0.1.8)
107
+ strings-ansi (~> 0.1)
108
+ unicode-display_width (~> 1.5)
109
+ unicode_utils (~> 1.4)
110
+ strings-ansi (0.1.0)
111
+ thor (1.0.0)
112
+ thread_safe (0.3.6)
113
+ tty-box (0.4.1)
114
+ pastel (~> 0.7.2)
115
+ strings (~> 0.1.6)
116
+ tty-cursor (~> 0.7)
117
+ tty-color (0.5.0)
118
+ tty-command (0.8.2)
119
+ pastel (~> 0.7.0)
120
+ tty-config (0.3.2)
121
+ tty-cursor (0.7.0)
122
+ tty-editor (0.5.1)
123
+ tty-prompt (~> 0.19)
124
+ tty-which (~> 0.4)
125
+ tty-file (0.7.1)
126
+ diff-lcs (~> 1.3)
127
+ pastel (~> 0.7.2)
128
+ tty-prompt (~> 0.18)
129
+ tty-markdown (0.5.1)
130
+ kramdown (~> 1.16.2)
131
+ pastel (~> 0.7.2)
132
+ rouge (~> 3.3)
133
+ strings (~> 0.1.4)
134
+ tty-color (~> 0.4)
135
+ tty-screen (~> 0.6)
136
+ tty-platform (0.2.1)
137
+ tty-progressbar (0.17.0)
138
+ strings-ansi (~> 0.1.0)
139
+ tty-cursor (~> 0.7)
140
+ tty-screen (~> 0.7)
141
+ unicode-display_width (~> 1.6)
142
+ tty-prompt (0.19.0)
143
+ necromancer (~> 0.5.0)
144
+ pastel (~> 0.7.0)
145
+ tty-reader (~> 0.6.0)
146
+ tty-reader (0.6.0)
147
+ tty-cursor (~> 0.7)
148
+ tty-screen (~> 0.7)
149
+ wisper (~> 2.0.0)
150
+ tty-screen (0.7.0)
151
+ tty-spinner (0.9.2)
152
+ tty-cursor (~> 0.7)
153
+ tty-which (0.4.1)
154
+ tzinfo (1.2.5)
155
+ thread_safe (~> 0.1)
156
+ unicode-display_width (1.6.0)
157
+ unicode_utils (1.4.0)
158
+ wisper (2.0.1)
159
+ zeitwerk (2.2.2)
160
+
161
+ PLATFORMS
162
+ ruby
163
+
164
+ DEPENDENCIES
165
+ appraisal (= 2.2.0)
166
+ pry-rails
167
+ railsdock!
168
+ rake (~> 10.0)
169
+ rake-compiler
170
+ rspec (~> 3.0)
171
+
172
+ BUNDLED WITH
173
+ 2.0.1
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Nate Vick
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/hintmedia/railsdock/hint/test/gemify/railsdock.png" alt="Railsdock Logo" background>
3
+ </p>
4
+
5
+ A command line tool for Dockerizing your Rails development environment.
6
+
7
+ ## Prerequisite
8
+
9
+ The configuration generated by this gem depends on [Docker Desktop](https://www.docker.com/products/docker-desktop). **Make sure it is installed before continuing.**
10
+
11
+ ## Installation
12
+
13
+ Install the gem:
14
+
15
+ $ gem install railsdock
16
+
17
+ Or add it to your Gemfile:
18
+
19
+ ```ruby
20
+ gem 'railsdock', require: false, group: :development
21
+ ```
22
+
23
+ Then run:
24
+
25
+ $ bundle
26
+
27
+ ## Usage
28
+
29
+ Navigate to your project directory:
30
+
31
+ $ cd /path/to/my/app
32
+
33
+ Then run:
34
+
35
+ $ railsdock install
36
+
37
+ The gem will then walk you through configuring Docker by asking questions about your environment.
38
+
39
+ ## Development
40
+
41
+ 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.
42
+
43
+ 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).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hintmedia/railsdock. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
48
+
49
+ ## Code of Conduct
50
+
51
+ Everyone interacting in the Railsdock project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hintmedia/railsdock/blob/master/CODE_OF_CONDUCT.md).
52
+
53
+ ## Copyright
54
+
55
+ Copyright (c) 2019 Hint. See [MIT License](LICENSE.txt) for further details.
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require "rake/extensiontask"
7
+
8
+ task :build => :compile
9
+
10
+ Rake::ExtensionTask.new("railsdock") do |ext|
11
+ ext.lib_dir = "lib/railsdock"
12
+ end
13
+
14
+ task :default => [:clobber, :compile, :spec]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "railsdock"
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/exe/railsdock ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ lib_path = File.expand_path('../lib', __dir__)
5
+ $:.unshift(lib_path) if !$:.include?(lib_path)
6
+ require 'railsdock/cli'
7
+
8
+ Signal.trap('INT') do
9
+ warn("\n#{caller.join("\n")}: interrupted")
10
+ exit(1)
11
+ end
12
+
13
+ begin
14
+ Railsdock::CLI.start
15
+ rescue Railsdock::CLI::Error => err
16
+ puts "ERROR: #{err.message}"
17
+ exit 1
18
+ end
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile("railsdock/railsdock")