mvc_one 0.1.0.pre.rc2 → 0.1.0.pre.rc3

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: a9156a3747a1449345c6139d1759d2b4666d5eb449daf2eebe37e7f47986d072
4
- data.tar.gz: 3cf5f42bfe96721e029ca91efcf05a1f358b91e5353dea53fe0fdc557e20c4d1
3
+ metadata.gz: 79e730b79796e5e4db6eafa6f600b2efd052e6e2c910fd1f493408ce62ce56ae
4
+ data.tar.gz: cacdd0774c86899f69c2c60f918d16c562b350283f2cfd6f46f23cce5aebf3d8
5
5
  SHA512:
6
- metadata.gz: 28398e4661ba3ba1886acb70073eadfe69544cf0bbc61be2ac0d9a6916aa6a52cbe01fbdc3f44c520381a645ea35f13ea46d5af66d3f9e24eff2bc5c6e5b970d
7
- data.tar.gz: 232cb7052c15497e64225ef73ccef1385eb59f8c23873a64dfa6de18cfae734d08aeb922e1d4bc452156c3b5ecc519e6e7ad2caf11bad7c2c51890e33a8956a9
6
+ metadata.gz: 39401230ffb11978a78759226b30b7ec203db0b3cf66649b7b5bd9b2d1bce77eee6aa8f99c1b9b1610853cf573b10e5f9a849bc649459524d048bf715c11ecb9
7
+ data.tar.gz: d1eed2a7a4ea87b4bd402066bd6734f971a5284acb722f35671aaf3b447b0c7398e7d32823bac9ba6ff2ffb4bc066a3b3d2839abf7fb8e96acf8434a5d85ae29
data/exe/mvc_one CHANGED
@@ -32,14 +32,14 @@ module MvcOne
32
32
  def generate_controller(name)
33
33
  raise Error, 'cd into your project repository' unless Dir.exists? 'app/controllers'
34
34
  file_name = "app/controllers/#{name}_controller.rb"
35
- template = ERB.new(File.read('../templates/app/controller_template.erb'))
35
+ template = ERB.new(File.read(File.join(gem_path, 'templates/app/controller_template.erb')))
36
36
  File.write(file_name, template.result(binding))
37
37
  end
38
38
 
39
39
  def generate_model(name)
40
40
  raise Error, 'cd into your project repository' unless Dir.exists? 'app/models'
41
41
  file_name = "app/models/#{name}.rb"
42
- template = ERB.new(File.read('../templates/app/model_template.erb'))
42
+ template = ERB.new(File.read(File.join(gem_path, 'templates/app/model_template.erb')))
43
43
  File.write(file_name, template.result(binding))
44
44
  end
45
45
 
@@ -58,23 +58,26 @@ module MvcOne
58
58
  end
59
59
 
60
60
  def make_default_files(name_normalized)
61
- config_ru = ERB.new(File.read('templates/general/config_ru.erb'))
61
+ config_ru = ERB.new(File.read(File.join(gem_path, 'templates/general/config_ru.erb')))
62
62
  File.write "#{name_normalized}/config.ru", config_ru.result(binding)
63
63
 
64
- rakefile = ERB.new(File.read('templates/general/rakefile.erb'))
64
+ rakefile = ERB.new(File.read(File.join(gem_path, 'templates/general/rakefile.erb')))
65
65
  File.write "#{name_normalized}/Rakefile", rakefile.result(binding)
66
66
 
67
- application_rb = ERB.new(File.read('templates/general/application_rb.erb'))
68
- File.write "#{name_normalized}/application.rb", config_ru.result(binding)
67
+ application_rb = ERB.new(File.read(File.join(gem_path, 'templates/general/application_rb.erb')))
68
+ File.write "#{name_normalized}/application.rb", application_rb.result(binding)
69
69
 
70
- routes_rb = ERB.new(File.read('templates/config/routes_rb.erb'))
70
+ routes_rb = ERB.new(File.read(File.join(gem_path, 'templates/config/routes_rb.erb')))
71
71
  File.write "#{name_normalized}/app/config/routes.rb", routes_rb.result(binding)
72
72
 
73
- database_yml = ERB.new(File.read('templates/general/database_yml.erb'))
73
+ database_yml = ERB.new(File.read(File.join(gem_path, 'templates/general/database_yml.erb')))
74
74
  File.write "#{name_normalized}/config/database.yml", database_yml.result(binding)
75
75
 
76
- secrets_yml = ERB.new(File.read('templates/general/secrets_yml.erb'))
76
+ secrets_yml = ERB.new(File.read(File.join(gem_path, 'templates/general/secrets_yml.erb')))
77
77
  File.write "#{name_normalized}/config/secrets.yml", secrets_yml.result(binding)
78
+
79
+ gemfile = ERB.new(File.read(File.join(gem_path, 'templates/general/gemfile.erb')))
80
+ File.write "#{name_normalized}/Gemfile", gemfile.result(binding)
78
81
  end
79
82
 
80
83
  def make_default_dirs(root_dir_name)
@@ -92,6 +95,10 @@ module MvcOne
92
95
  end
93
96
  end
94
97
  end
98
+
99
+ def gem_path
100
+ File.expand_path("#{File.dirname(__FILE__)}/..")
101
+ end
95
102
  end
96
103
 
97
104
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MvcOne
4
- VERSION = "0.1.0-rc2"
4
+ VERSION = "0.1.0-rc3"
5
5
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'mvc_one'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvc_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.rc2
4
+ version: 0.1.0.pre.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgenii Sendziuk
@@ -190,6 +190,7 @@ files:
190
190
  - templates/general/application_rb.erb
191
191
  - templates/general/config_ru.erb
192
192
  - templates/general/database_yml.erb
193
+ - templates/general/gemfile.erb
193
194
  - templates/general/rakefile.erb
194
195
  - templates/general/secrets_yml.erb
195
196
  homepage: