autogen_sindb 0.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd58b50afea4e63b75f923fafa0d0e30123266997396fb754a0f5a99859617cf
4
- data.tar.gz: 24586b9df9baa76e647949b51ed38e44fd0301b984e99362af40047c01d1bae8
3
+ metadata.gz: 29e04bf93b59d2a892136e66c9a082591a04516b8c9bb2157e62e9b2c63754a3
4
+ data.tar.gz: 0e6ff0c5587ef227cdf0d5e979a863a278557bfbd5a3bdda005338b66c4afc2d
5
5
  SHA512:
6
- metadata.gz: a06f9d3567f049c163a7ec888f85a69268ea25d48719f2a75f3fc28161abc77d304f879e2874c66d24b5748e33c5bea2771e5e8085a2d05327c8f29fabee8a8a
7
- data.tar.gz: fa7fe1da5c218010bf39f24413498c79b3f800a728da778de11e9ad7764ad80bbe5eb798555580b8819911b8d331689dd09b7edaa48af58ff6eaccbfdecd60c9
6
+ metadata.gz: 4ed5e97d2d6d4ab0e053cfde4e014385b8c29846fe37918a4feae844928b5c75bc378b1c2a6d59f5477815e860c45c421cec8a58c03182478ae955ed1cfaa513
7
+ data.tar.gz: 1b67c48c31f63831c4555d283b9bc4e7e6031a2cb725a25ae8388596aaacaced25cdb81e3d78aa6fcc095c50e16e144a6be46b20950baaa3dc0beab45901c253
@@ -14,7 +14,6 @@ class SinatrabaseFs::StructureMe
14
14
 
15
15
  def make_dirs
16
16
  curr_dir = Dir.pwd
17
- # root = "/sinatrabase_fs"
18
17
 
19
18
  FileUtils.cd(curr_dir) do |dir|
20
19
  %w(app app/controllers app/models app/views config public public/css public/images public/js db/migrate spec).each do |directory|
@@ -56,7 +55,7 @@ class SinatrabaseFs::StructureMe
56
55
  def write_to_config_environment_rb
57
56
  FileUtils.cd(Dir.pwd) do |dir|
58
57
  file = File.open("config/environment.rb", 'w')
59
- file.puts "ENV['SINATRA_ENV'] ||= \"development\"\n\nrequire 'bundler/setup'\nBundler.require(:default, ENV['SINATRA_ENV'])\n\n# SET CONNECTION TO DATABASE\nconfigure :development do\n\tset :database, 'sqlite3:db/database.db'\nend\n\nrequire './app'"
58
+ file.puts "ENV['SINATRA_ENV'] ||= \"development\"\n\nrequire 'bundler/setup'\nBundler.require(:default, ENV['SINATRA_ENV'])\n\n# SET CONNECTION TO DATABASE\ndef fi_check_migration\n\tbegin\n\t\tActiveRecord::Migration.check_pending!\n\trescue ActiveRecord::PendingMigrationError\n\t\traise ActiveRecord::PendingMigrationError.new \"Migrations are pending.\nTo resolve this issue, run: \nrake db:migrate SINATRA_ENV=\#{ENV['SINATRA_ENV']}\"\n\tend\nend\n\nActiveRecord::Base.establish_connection(\n\t:adapter => \"sqlite3\",\n\t:database => \"db/\#{ENV['SINATRA_ENV']}.sqlite\"\n)\n\nrequire_all 'app'"
60
59
  file.close
61
60
  end
62
61
  end
@@ -64,7 +63,7 @@ class SinatrabaseFs::StructureMe
64
63
  def write_to_config_ru
65
64
  FileUtils.cd(Dir.pwd) do |dir|
66
65
  file = File.open("config.ru", 'w')
67
- file.puts "require './config/environment'\n\nrun App # or whatever the app controller module/class name you want eg. Application"
66
+ file.puts "require './config/environment'\n\nbegin\n\tfi_check_migration\n\n\tuse Rack::MethodOverride\n\n\trun ApplicationController # or whatever the app controller module/class name you want eg. App\nrescue ActiveRecord::PendingMigrationError => err\n\tSTDERR.puts err\n\texit 1\nend"
68
67
  file.close
69
68
  end
70
69
  end
@@ -72,7 +71,7 @@ class SinatrabaseFs::StructureMe
72
71
  def write_to_gemfile
73
72
  FileUtils.cd(Dir.pwd) do |dir|
74
73
  file = File.open("Gemfile", 'w')
75
- file.puts "source 'https://rubygems.org'\n\ngem 'sinatra'\ngem 'thin'\ngem 'require_all'\ngem 'activerecord', '5.2'\ngem 'sinatra-activerecord'\ngem 'rake'\n\ngroup :development do\n\tgem 'shotgun'\n\tgem 'pry'\n\tgem 'tux'\n\tgem 'sqlite3', '~> 1.3.6'\nend"
74
+ file.puts "source 'https://rubygems.org'\n\ngem 'sinatra'\ngem 'thin'\ngem 'require_all'\ngem 'activerecord', '5.2'\ngem 'sinatra-activerecord'\ngem 'database_cleaner'\ngem 'rake'\n\ngroup :development do\n\tgem 'capybara'\n\tgem 'shotgun'\n\tgem 'pry'\n\tgem 'tux'\n\tgem 'sqlite3', '~> 1.3.6'\nend"
76
75
  file.close
77
76
  end
78
77
  end
@@ -1,3 +1,3 @@
1
1
  module SinatrabaseFs
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autogen_sindb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naya Willis