plastic_rails 0.1.2 → 0.1.3

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7e7792da09735fc997d0525f866f9c775f71aaf924f319beba09efb701adc3b
4
- data.tar.gz: 9655d94cfb711ac6b4657bc710d585d3dcf6fb90e76031f78130736e4e5b4a06
3
+ metadata.gz: 35fa2c046e18c260dfae8b7491fabe5054b76d8e5ca7462b74bd65b69c0baadf
4
+ data.tar.gz: 44adf2a356d4909266f589b9269c6dfc501cf7586a5799fed2c13d75df64f7be
5
5
  SHA512:
6
- metadata.gz: 3cd987c05632bdfc790c67433d6edf7d542c1e46c1b6652c6774fcbacdb448acbed42fe06e6711bbc48535bc80c21b18d08cda1cd20ac794b7209ed325e9fa85
7
- data.tar.gz: 6ec85c5acd71078575b9ad0ec1c37cdf070dd789dafd20c6b30c7cd9cee3083bfaf98b8d5254d1d911767b3779516241b9be9f628cf00bc597dc60894caca316
6
+ metadata.gz: 5c62dcb721cde0c0a25ea51a49b2e3507a79aab62383088bc88243f8f489fda950f13552598ca2813057a48125e7bf184e85c2d01ecb775c625a2a33fc593b27
7
+ data.tar.gz: 7c16415929e2890c37c2a4d64a6b788a507522c8431662121ce81ec04afe2ac9bb1cf1604ca737a6c740a06983f8a6d9031b3a3b9e047980f0dadf3972045cb3
data/.gitignore CHANGED
@@ -7,5 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  .DS_Store
10
- Gemfile.lock
11
10
  .ruby-version
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ plastic_rails (0.1.2)
5
+ thor (~> 1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ rake (13.0.1)
11
+ thor (1.0.1)
12
+
13
+ PLATFORMS
14
+ ruby
15
+
16
+ DEPENDENCIES
17
+ bundler (~> 2.1)
18
+ plastic_rails!
19
+ rake (~> 13.0)
20
+
21
+ BUNDLED WITH
22
+ 2.1.4
data/README.md CHANGED
@@ -38,6 +38,17 @@ gem install plastic_rails
38
38
  - 削除したコンテナを再セットアップ
39
39
  - `./setup.sh`
40
40
 
41
+ ## カスタマイズ
42
+ DockerfileやRailsのテンプレートを修正することによって、作成する環境をカスタマイズできる。DBをデフォルトのMySQLから別のものに変更することなどが可能。
43
+
44
+ - デフォルトのテンプレートをコピー
45
+ - `plastic_rails copy_template <NEW_TEMPLATE>`
46
+ - <NEW_TEMPLATE> に デフォルトのテンプレート(DockerfileやRailsのアプリケーションテンプレート)が入ったディレクトリがコピーされる。
47
+ - テンプレートを修正する
48
+ - 修正したテンプレートを使用して環境を作成する
49
+ - `plastic_rails new <APP_NAME> --template=<NEW_TEMPLATE>`
50
+
51
+
41
52
  ## Plastic Rails自体の開発・デバッグ
42
53
  ### デバッグ環境(Vagrant)作成
43
54
  - あらかじめ、VirtualboxとVagrantをインストールしておく。
@@ -6,12 +6,12 @@ module PlasticRails
6
6
  class Error < StandardError; end
7
7
 
8
8
  class PlaRails < Thor
9
- TMPL_DIR=File.dirname(__FILE__)
10
- p TMPL_DIR
11
- desc "new APPNAME", "create a Rails application skelton with Docker container."
9
+ DEFAULT_TEMPLATE_DIR = File.join(File.dirname(__FILE__) , "tmpl")
10
+ desc "new APPNAME", "Create a Rails application skelton with Docker container."
12
11
  option :db_path, :default => "./db/mysql/volumes"
12
+ option :template, :default => DEFAULT_TEMPLATE_DIR
13
13
  def new(appname)
14
- execute("cp -a #{TMPL_DIR}/tmpl #{appname}")
14
+ execute("cp -a #{options[:template]} #{appname}")
15
15
  Dir.chdir(appname)
16
16
 
17
17
  # DBのファイルパスを設定する
@@ -27,11 +27,17 @@ module PlasticRails
27
27
  system("./setup.sh")
28
28
  end
29
29
 
30
- desc "login", "log in Rails container related to current directory."
30
+ desc "login", "Log in Rails container related to current directory."
31
31
  def login
32
32
  execute("docker-compose exec web bash")
33
33
  end
34
34
 
35
+
36
+ desc "copy_template", "Copy the default template to any dir. (To use in `new` command with `--template` option.)"
37
+ def copy_template(dest_dir)
38
+ execute("cp -a #{DEFAULT_TEMPLATE_DIR} #{dest_dir}")
39
+ end
40
+
35
41
  private
36
42
 
37
43
  def execute(cmd)
@@ -1,3 +1,3 @@
1
1
  module PlasticRails
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
File without changes
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler"
27
- spec.add_development_dependency "rake"
28
- spec.add_runtime_dependency "thor"
26
+ spec.add_development_dependency "bundler", "~> 2.1"
27
+ spec.add_development_dependency "rake", "~> 13.0"
28
+ spec.add_runtime_dependency "thor", "~> 1.0"
29
29
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plastic_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koki Hashimoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-18 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.0'
55
55
  description: docker上にRuby on Railsの環境を一発で作るスクリプト。プラレールのように自分用のレールを引こう。
56
56
  email:
57
57
  - gohannnotomo@gmail.com
@@ -63,6 +63,7 @@ files:
63
63
  - ".gitignore"
64
64
  - CODE_OF_CONDUCT.md
65
65
  - Gemfile
66
+ - Gemfile.lock
66
67
  - LICENSE.txt
67
68
  - README.md
68
69
  - Rakefile