jobshop 0.0.67 → 0.0.101
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 +4 -4
- data/README.md +13 -11
- data/lib/generators/jobshop/app/USAGE +8 -0
- data/lib/generators/jobshop/app/app_generator.rb +70 -0
- data/lib/generators/jobshop/app/templates/README.md.tt +3 -0
- data/lib/{jobshop/templates/secrets.yml.erb → generators/jobshop/app/templates/config/secrets.yml.tt} +0 -0
- data/lib/generators/jobshop/dummy/dummy_generator.rb +101 -0
- data/lib/generators/jobshop/dummy/templates/config/boot.rb.tt +5 -0
- data/lib/jobshop/cli.rb +57 -8
- data/lib/jobshop/dummy_app.rb +5 -40
- data/lib/jobshop/version.rb +1 -1
- metadata +8 -7
- data/lib/jobshop/templates/boot.rb.tt +0 -5
- data/lib/jobshop/templates/dummy_template.rb +0 -48
- data/lib/jobshop/templates/quick_install.rb +0 -30
- data/lib/templates/haml/scaffold/_form.html.haml +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2dd90b50e7feb98aff7c02039f85914a92b21789
|
|
4
|
+
data.tar.gz: b08d3ec5ff1e5160bee39de1077be79cf870209e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 715aaa6e6ea388e208074804f4141c36bca7a303579379d727afa67d118449128eba94e2ebe99a87a2784476031ae18c894df5db1ba39baaded235c55fa2efe9
|
|
7
|
+
data.tar.gz: ada7575067365e3785eb7eecb2f32bd040ba06ec1c2ba613962348e60418c84462acd570e7ca11ce55fb7a7bae8a861755a0211f6cef9aff8b0f30079ed31e38
|
data/README.md
CHANGED
|
@@ -7,32 +7,33 @@
|
|
|
7
7
|
|
|
8
8
|
Real-time production tracking and process evaluation in the cloud - or under your own roof.
|
|
9
9
|
|
|
10
|
-
To see a live demo, check out [jobshop.io](https://jobshop.io).
|
|
11
|
-
|
|
12
10
|
## Requirements
|
|
13
11
|
|
|
14
12
|
Jobshop only requires a few things:
|
|
15
13
|
|
|
16
|
-
- Ruby >= 2.
|
|
14
|
+
- Ruby >= 2.4
|
|
17
15
|
- Rails >= 5.0
|
|
18
|
-
- PostgreSQL
|
|
16
|
+
- PostgreSQL >= 9.5
|
|
19
17
|
|
|
20
18
|
## Quick Installation
|
|
21
19
|
|
|
22
20
|
The Quick Installation is designed to get you up and running a local Jobshop
|
|
23
21
|
server with minimum effort. This instance will be ideal for evaluating Jobshop
|
|
24
|
-
|
|
22
|
+
at any number of stations within your organization. If you would like to
|
|
25
23
|
deploy to a production server or create a local development instance, a few
|
|
26
24
|
extra considerations will need to be made. There are no guides yet but pull
|
|
27
25
|
requests are always welcome.
|
|
28
26
|
|
|
29
|
-
First,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
First, install the Jobshop gem.
|
|
28
|
+
|
|
29
|
+
```console
|
|
30
|
+
$ gem install jobshop
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then create your app:
|
|
33
34
|
|
|
34
35
|
```console
|
|
35
|
-
$
|
|
36
|
+
$ jobshop new my_jobshop
|
|
36
37
|
```
|
|
37
38
|
|
|
38
39
|
Change into the app directory.
|
|
@@ -47,13 +48,14 @@ and edit as necessary. Create the database.
|
|
|
47
48
|
```console
|
|
48
49
|
$ rails db:create
|
|
49
50
|
```
|
|
51
|
+
|
|
50
52
|
Run the newly pending migrations.
|
|
51
53
|
|
|
52
54
|
```console
|
|
53
55
|
$ rails db:migrate
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
Fire up your server with
|
|
58
|
+
Fire up your server with `rails s` and point your web browser to
|
|
57
59
|
[http://localhost:3000](http://localhost:3000)
|
|
58
60
|
|
|
59
61
|
## Bug Reports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Description:
|
|
2
|
+
The `jobshop new` command creates a new Jobshop application with a default
|
|
3
|
+
directory structure and configuration at the path you specify.
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
jobshop new ~/src/my_jobshop
|
|
7
|
+
|
|
8
|
+
This generates a skeletal Jobshop installation in ~/src/my_jobshop.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
require "rails/generators"
|
|
2
|
+
require "rails/generators/rails/app/app_generator"
|
|
3
|
+
|
|
4
|
+
require "jobshop/version"
|
|
5
|
+
|
|
6
|
+
module Jobshop
|
|
7
|
+
class AppBuilder < Rails::AppBuilder
|
|
8
|
+
def readme
|
|
9
|
+
template "README.md.tt"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def gemfile
|
|
13
|
+
super
|
|
14
|
+
append_to_file "Gemfile", <<~GEMFILE
|
|
15
|
+
\ngem "jobshop", "~> #{Jobshop.gem_version}"
|
|
16
|
+
GEMFILE
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def config
|
|
20
|
+
super
|
|
21
|
+
template "config/secrets.yml.tt", force: true
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def mount_engine
|
|
25
|
+
route %Q(mount Jobshop::Engine => "/")
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
module Generators
|
|
30
|
+
class AppGenerator < Rails::Generators::AppGenerator
|
|
31
|
+
def self.source_root
|
|
32
|
+
File.expand_path("templates", __dir__)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.source_paths
|
|
36
|
+
[ Rails::Generators::AppGenerator.source_root,
|
|
37
|
+
Jobshop::Generators::AppGenerator.source_root ]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
hide!
|
|
41
|
+
|
|
42
|
+
class_option :help, type: :boolean, aliases: "-h", group: :other,
|
|
43
|
+
desc: "Show this help message and quit"
|
|
44
|
+
|
|
45
|
+
class_options[:database].instance_variable_set(:@default, "postgresql")
|
|
46
|
+
|
|
47
|
+
class_option :version, type: :boolean, aliases: "-v", group: :other,
|
|
48
|
+
desc: "Show Jobshop version number and quit"
|
|
49
|
+
|
|
50
|
+
def self.banner
|
|
51
|
+
"jobshop new #{arguments.map(&:usage).join(' ')} [options]"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def finish_template
|
|
55
|
+
build :mount_engine
|
|
56
|
+
super
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def run_bundle
|
|
60
|
+
super
|
|
61
|
+
bundle_command("binstub jobshop") if bundle_install?
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
protected
|
|
65
|
+
def get_builder_class
|
|
66
|
+
Jobshop::AppBuilder
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
require "jobshop/dummy_app"
|
|
2
|
+
require "generators/jobshop/app/app_generator"
|
|
3
|
+
|
|
4
|
+
module Jobshop
|
|
5
|
+
class DummyBuilder < Jobshop::AppBuilder
|
|
6
|
+
def readme
|
|
7
|
+
# Do not generate README.md
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Comment out username, password from production group.
|
|
11
|
+
def config_database_yml
|
|
12
|
+
gsub_file "config/database.yml",
|
|
13
|
+
/^([ ]*[^#])(username: .*|password: .*)$/, '\1# \2'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# The db/migrate folder isn't created automatically.
|
|
17
|
+
def db_migrate
|
|
18
|
+
unless Dir.exist?("db/migrate")
|
|
19
|
+
say_status :create, "db/migrate"
|
|
20
|
+
Dir.mkdir("db/migrate")
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def expose_mailer_previews
|
|
25
|
+
# Mailer previews don't really play nice with Engines so in the dummy app we
|
|
26
|
+
# create an initializer to expose them properly.
|
|
27
|
+
initializer "jobshop_expose_mailer_previews.rb", <<~INITIALIZER
|
|
28
|
+
if Rails.env.development? || Rails.env.test?
|
|
29
|
+
Rails.application.configure do
|
|
30
|
+
config.action_mailer.preview_path = "\#{Jobshop::Engine.root}/spec/mailers"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
INITIALIZER
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def localhost_tld_length
|
|
37
|
+
# This allows us to easily use the localhost hostname in development.
|
|
38
|
+
initializer "jobshop_tld_length.rb", <<~INITIALIZER
|
|
39
|
+
if Rails.env.development? || Rails.env.test?
|
|
40
|
+
Rails.application.configure do
|
|
41
|
+
config.action_dispatch.tld_length = 0
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
INITIALIZER
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
module Generators
|
|
49
|
+
class DummyGenerator < Jobshop::Generators::AppGenerator
|
|
50
|
+
def self.source_root
|
|
51
|
+
File.expand_path("templates", __dir__)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def self.source_paths
|
|
55
|
+
Array(super) | [ Jobshop::Generators::DummyGenerator.source_root ]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
hide!
|
|
59
|
+
|
|
60
|
+
class_options[:skip_bundle].instance_variable_set(:@default, "true")
|
|
61
|
+
class_options[:skip_gemfile].instance_variable_set(:@default, "true")
|
|
62
|
+
class_options[:skip_git].instance_variable_set(:@default, "true")
|
|
63
|
+
class_options[:skip_listen].instance_variable_set(:@default, "true")
|
|
64
|
+
class_options[:skip_test].instance_variable_set(:@default, "true")
|
|
65
|
+
|
|
66
|
+
def initialize(*)
|
|
67
|
+
DummyApp.destroy! if Jobshop::DummyApp.exist?
|
|
68
|
+
super
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def self.banner
|
|
72
|
+
"jobshop dummy [options]"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def create_boot_file
|
|
76
|
+
template "config/boot.rb.tt"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def finish_template
|
|
80
|
+
build :config_database_yml
|
|
81
|
+
build :db_migrate
|
|
82
|
+
build :expose_mailer_previews
|
|
83
|
+
build :localhost_tld_length
|
|
84
|
+
super
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def run_bundle
|
|
88
|
+
super
|
|
89
|
+
bundle_command("binstub jobshop --path=\"#{Jobshop::DummyApp.path}/bin\" --force")
|
|
90
|
+
bundle_command("exec rails db:drop RAILS_ENV=test")
|
|
91
|
+
bundle_command("exec rails db:create RAILS_ENV=test")
|
|
92
|
+
bundle_command("exec rails db:migrate RAILS_ENV=test")
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
protected
|
|
96
|
+
def get_builder_class
|
|
97
|
+
Jobshop::DummyBuilder
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
data/lib/jobshop/cli.rb
CHANGED
|
@@ -1,17 +1,66 @@
|
|
|
1
1
|
require "thor"
|
|
2
2
|
|
|
3
|
-
require "jobshop"
|
|
4
|
-
require "jobshop/
|
|
3
|
+
require "jobshop/dummy_app"
|
|
4
|
+
require "generators/jobshop/app/app_generator"
|
|
5
|
+
require "generators/jobshop/dummy/dummy_generator"
|
|
5
6
|
|
|
6
7
|
module Jobshop
|
|
7
|
-
class CLI
|
|
8
|
-
|
|
8
|
+
class CLI
|
|
9
|
+
class Unbound < Thor
|
|
10
|
+
desc "new", "Create a new Jobshop application"
|
|
11
|
+
default_command def new(*)
|
|
12
|
+
Jobshop::Generators::AppGenerator.start \
|
|
13
|
+
Rails::Generators::ARGVScrubber.new(ARGV).prepare!
|
|
14
|
+
end
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
def help
|
|
17
|
+
Jobshop::Generators::AppGenerator.help(shell)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class Dummy < Thor
|
|
22
|
+
desc "create", "Create the dummy app"
|
|
23
|
+
default_command def create
|
|
24
|
+
ARGV.shift; ARGV.unshift("new", Jobshop::DummyApp.path)
|
|
25
|
+
Jobshop::Generators::DummyGenerator.start \
|
|
26
|
+
Rails::Generators::ARGVScrubber.new(ARGV).prepare!
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class Development < Thor
|
|
31
|
+
register Jobshop::CLI::Dummy, "dummy", "dummy [options]", "Manage dummy app used for tests"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
class << self
|
|
35
|
+
def start
|
|
36
|
+
if [ "-v", "--version" ].include?(ARGV[0])
|
|
37
|
+
require "jobshop/version"
|
|
38
|
+
puts "Jobshop #{Jobshop.gem_version}"
|
|
39
|
+
exit 0
|
|
40
|
+
elsif jobshop_application?
|
|
41
|
+
puts "No tasks available for the application environment yet"
|
|
42
|
+
elsif jobshop_development?
|
|
43
|
+
Jobshop::CLI::Development.start
|
|
44
|
+
else
|
|
45
|
+
Jobshop::CLI::Unbound.start
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private def jobshop_application?
|
|
50
|
+
has_executable? && !has_gemspec?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
private def jobshop_development?
|
|
54
|
+
has_executable? && has_gemspec?
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private def has_executable?
|
|
58
|
+
@has_executable ||= File.file?("bin/jobshop")
|
|
59
|
+
end
|
|
11
60
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
61
|
+
private def has_gemspec?
|
|
62
|
+
@jobshop_development ||= File.file?("jobshop.gemspec")
|
|
63
|
+
end
|
|
15
64
|
end
|
|
16
65
|
end
|
|
17
66
|
end
|
data/lib/jobshop/dummy_app.rb
CHANGED
|
@@ -1,58 +1,23 @@
|
|
|
1
|
-
require "rails/
|
|
1
|
+
require "rails/version"
|
|
2
2
|
|
|
3
3
|
module Jobshop
|
|
4
4
|
class DummyApp
|
|
5
5
|
class << self
|
|
6
|
-
def require_environment!
|
|
7
|
-
if exist?
|
|
8
|
-
require File.join(path, "config/environment")
|
|
9
|
-
else
|
|
10
|
-
abort("Dummy app does not exist. Please run `rake jobshop:dummy` to create it.")
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def exist?
|
|
15
|
-
Dir.exist?(path)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
6
|
def destroy!
|
|
19
7
|
FileUtils.rmtree(path)
|
|
20
|
-
Object.send(:remove_const, constant_name)
|
|
21
8
|
end
|
|
22
9
|
|
|
23
|
-
def
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def constant_name
|
|
28
|
-
@constant_name = File.basename(path)
|
|
29
|
-
.gsub(/\W/, '_').squeeze('_').camelize
|
|
10
|
+
def exist?
|
|
11
|
+
Dir.exist?(path)
|
|
30
12
|
end
|
|
31
13
|
|
|
32
14
|
def rakefile
|
|
33
15
|
File.join(path, "Rakefile")
|
|
34
16
|
end
|
|
35
17
|
|
|
36
|
-
def
|
|
37
|
-
@
|
|
38
|
-
File.expand_path("templates/dummy_template.rb", __dir__)
|
|
18
|
+
def path
|
|
19
|
+
@path ||= File.expand_path("spec/dummy-#{Rails::VERSION::STRING}")
|
|
39
20
|
end
|
|
40
21
|
end
|
|
41
|
-
|
|
42
|
-
def initialize
|
|
43
|
-
options = {
|
|
44
|
-
api: false,
|
|
45
|
-
database: "postgresql",
|
|
46
|
-
skip_gemfile: true,
|
|
47
|
-
skip_git: true,
|
|
48
|
-
skip_bundle: true,
|
|
49
|
-
skip_listen: true,
|
|
50
|
-
skip_test: true,
|
|
51
|
-
template: DummyApp.template
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
DummyApp.destroy! if DummyApp.exist?
|
|
55
|
-
Rails::Generators::AppGenerator.new([ DummyApp.path ], options).invoke_all
|
|
56
|
-
end
|
|
57
22
|
end
|
|
58
23
|
end
|
data/lib/jobshop/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jobshop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.101
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Frank J. Mattia
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-02-
|
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: coffee-rails
|
|
@@ -382,8 +382,14 @@ files:
|
|
|
382
382
|
- db/migrate/20160720201947_add_authentication_token_to_jobshop_users.rb
|
|
383
383
|
- db/migrate/keep
|
|
384
384
|
- exe/jobshop
|
|
385
|
+
- lib/generators/jobshop/app/USAGE
|
|
386
|
+
- lib/generators/jobshop/app/app_generator.rb
|
|
387
|
+
- lib/generators/jobshop/app/templates/README.md.tt
|
|
388
|
+
- lib/generators/jobshop/app/templates/config/secrets.yml.tt
|
|
385
389
|
- lib/generators/jobshop/config/config_generator.rb
|
|
386
390
|
- lib/generators/jobshop/config/templates/jobshop.rb.tt
|
|
391
|
+
- lib/generators/jobshop/dummy/dummy_generator.rb
|
|
392
|
+
- lib/generators/jobshop/dummy/templates/config/boot.rb.tt
|
|
387
393
|
- lib/generators/jobshop/orm_helpers.rb
|
|
388
394
|
- lib/generators/jobshop/team/USAGE
|
|
389
395
|
- lib/generators/jobshop/team/team_generator.rb
|
|
@@ -393,13 +399,8 @@ files:
|
|
|
393
399
|
- lib/jobshop/engine.rb
|
|
394
400
|
- lib/jobshop/failure_app.rb
|
|
395
401
|
- lib/jobshop/support/memo_attr.rb
|
|
396
|
-
- lib/jobshop/templates/boot.rb.tt
|
|
397
|
-
- lib/jobshop/templates/dummy_template.rb
|
|
398
|
-
- lib/jobshop/templates/quick_install.rb
|
|
399
|
-
- lib/jobshop/templates/secrets.yml.erb
|
|
400
402
|
- lib/jobshop/version.rb
|
|
401
403
|
- lib/tasks/jobshop_tasks.rake
|
|
402
|
-
- lib/templates/haml/scaffold/_form.html.haml
|
|
403
404
|
homepage: https://jobshop.io
|
|
404
405
|
licenses:
|
|
405
406
|
- AGPL-3.0
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
def source_paths
|
|
2
|
-
[ File.expand_path(File.dirname(__FILE__)) ]
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
# The generated config/boot.rb file references a Gemfile in the dummy app
|
|
6
|
-
# directory so use one that references the parent app.
|
|
7
|
-
remove_file "config/boot.rb"
|
|
8
|
-
copy_file "boot.rb.tt", "config/boot.rb"
|
|
9
|
-
|
|
10
|
-
# The generated config/secrets.yml file uses hardcoded values for
|
|
11
|
-
# test/development environments. Generate secrets pragmatically.
|
|
12
|
-
remove_file "config/secrets.yml"
|
|
13
|
-
template "secrets.yml.erb", "config/secrets.yml"
|
|
14
|
-
|
|
15
|
-
# Comment out username, password from production group.
|
|
16
|
-
gsub_file "config/database.yml",
|
|
17
|
-
/^([ ]*[^#])(username: .*|password: .*)$/, '\1# \2'
|
|
18
|
-
|
|
19
|
-
# The db/migrate folder never gets created for the dummy_app so do it manually.
|
|
20
|
-
unless Dir.exist?("db/migrate")
|
|
21
|
-
say_status :create, "db/migrate"
|
|
22
|
-
Dir.mkdir("db/migrate")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Mailer previews don't really play nice with Engines so in the dummy app we
|
|
26
|
-
# create an initializer to expose them properly.
|
|
27
|
-
initializer "jobshop_expose_mailer_previews.rb", <<-INITIALIZER.strip_heredoc
|
|
28
|
-
if Rails.env.development? || Rails.env.test?
|
|
29
|
-
Rails.application.configure do
|
|
30
|
-
config.action_mailer.preview_path = "\#{Jobshop::Engine.root}/spec/mailers"
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
INITIALIZER
|
|
34
|
-
|
|
35
|
-
# This allows us to easily use the localhost hostname in development.
|
|
36
|
-
initializer "jobshop_tld_length.rb", <<-INITIALIZER.strip_heredoc
|
|
37
|
-
if Rails.env.development? || Rails.env.test?
|
|
38
|
-
Rails.application.configure do
|
|
39
|
-
config.action_dispatch.tld_length = 0
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
INITIALIZER
|
|
43
|
-
|
|
44
|
-
route "mount Jobshop::Engine => \"/\""
|
|
45
|
-
|
|
46
|
-
rake "db:drop:all"
|
|
47
|
-
rake "db:create"
|
|
48
|
-
rake "db:migrate"
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require "tempfile"
|
|
2
|
-
require "net/http"
|
|
3
|
-
|
|
4
|
-
# Add jobshop to the application `Gemfile`.
|
|
5
|
-
gem "jobshop", "~> 0.0.11"
|
|
6
|
-
|
|
7
|
-
def template_body(uri)
|
|
8
|
-
uri = URI.parse(uri)
|
|
9
|
-
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
|
10
|
-
http.request(Net::HTTP::Get.new(uri))
|
|
11
|
-
end.body
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# The generated config/secrets.yml file uses hardcoded values for
|
|
15
|
-
# test/development environments. Generate secrets pragmatically.
|
|
16
|
-
SECRETS_YML_URI = "https://raw.githubusercontent.com/" +
|
|
17
|
-
"jobshop/jobshop/" +
|
|
18
|
-
"master/lib/jobshop/templates/secrets.yml.erb"
|
|
19
|
-
|
|
20
|
-
secrets_tempfile = Tempfile.new(["secrets", ".yml.erb"])
|
|
21
|
-
secrets_tempfile.write(template_body(SECRETS_YML_URI))
|
|
22
|
-
secrets_tempfile.close
|
|
23
|
-
|
|
24
|
-
remove_file "config/secrets.yml"
|
|
25
|
-
template secrets_tempfile.path, "config/secrets.yml"
|
|
26
|
-
secrets_tempfile.unlink
|
|
27
|
-
|
|
28
|
-
after_bundle do
|
|
29
|
-
route %Q(mount Jobshop::Engine => "/")
|
|
30
|
-
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
= simple_form_for(@<%= singular_table_name %>) do |f|
|
|
2
|
-
= f.error_notification
|
|
3
|
-
|
|
4
|
-
.form-inputs
|
|
5
|
-
<%- attributes.each do |attribute| -%>
|
|
6
|
-
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
|
|
7
|
-
<%- end -%>
|
|
8
|
-
|
|
9
|
-
.form-actions
|
|
10
|
-
= f.button :submit
|