putsreq 0.0.3 → 0.0.4
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 +5 -5
- data/.babelrc +26 -0
- data/.codeclimate.yml +29 -5
- data/.env.docker +6 -0
- data/.eslintignore +4 -0
- data/.eslintrc +22 -0
- data/.gitignore +8 -0
- data/.postcssrc.yml +3 -0
- data/.prettierrc +4 -0
- data/.reek +12 -0
- data/.rubocop.yml +47 -25
- data/.ruby-version +1 -1
- data/.simplecov +6 -0
- data/.travis.yml +38 -4
- data/Dockerfile +44 -0
- data/Gemfile +40 -61
- data/Gemfile.lock +294 -186
- data/Procfile +1 -1
- data/README.md +51 -46
- data/Rakefile +1 -1
- data/{public → app/assets}/images/logo.png +0 -0
- data/app/assets/javascripts/application.js +1 -1
- data/app/assets/javascripts/buckets.js.coffee +1 -21
- data/app/assets/stylesheets/{application.css → application.scss} +2 -1
- data/app/assets/stylesheets/buckets.css.scss +0 -2
- data/app/controllers/application_controller.rb +11 -9
- data/app/controllers/buckets_controller.rb +24 -18
- data/app/controllers/home_controller.rb +5 -5
- data/app/controllers/requests_controller.rb +13 -2
- data/app/helpers/application_helper.rb +6 -2
- data/app/interactors/create_or_retrieve_bucket.rb +17 -0
- data/app/interactors/create_request.rb +25 -7
- data/app/interactors/eval_response_builder.rb +9 -9
- data/app/interactors/filter_headers.rb +3 -3
- data/app/interactors/forward_request.rb +4 -4
- data/app/interactors/record_request.rb +1 -1
- data/app/interactors/track.rb +44 -0
- data/app/javascript/actionTypes.js +7 -0
- data/app/javascript/actions/index.js +64 -0
- data/app/javascript/components/Bucket.jsx +91 -0
- data/app/javascript/components/Pagination.jsx +67 -0
- data/app/javascript/components/RequestCount.jsx +21 -0
- data/app/javascript/components/request/Header.jsx +31 -0
- data/app/javascript/components/request/Response.jsx +28 -0
- data/app/javascript/components/request/index.jsx +47 -0
- data/app/javascript/packs/application.js +25 -0
- data/app/javascript/packs/hello_react.jsx +26 -0
- data/app/javascript/reducers/index.js +23 -0
- data/app/javascript/request_poller.js +19 -0
- data/app/javascript/store.js +9 -0
- data/app/models/bucket.rb +16 -10
- data/app/models/request.rb +2 -3
- data/app/models/user.rb +2 -2
- data/app/serializers/bucket_serializer.rb +11 -0
- data/app/serializers/request_serializer.rb +69 -0
- data/app/views/buckets/_buttons.html.erb +3 -3
- data/app/views/buckets/_form.html.erb +6 -6
- data/app/views/buckets/_readonly_buttons.html.erb +1 -1
- data/app/views/buckets/show.html.erb +12 -25
- data/app/views/home/index.html.erb +22 -16
- data/app/views/layouts/application.html.erb +21 -22
- data/app/views/layouts/devise.html.erb +16 -18
- data/app/views/shared/_flash.html.erb +3 -1
- data/bin/byebug +21 -0
- data/bin/cc-tddium-post-worker +21 -0
- data/bin/codeclimate-test-reporter +21 -0
- data/bin/coderay +21 -0
- data/bin/dotenv +21 -0
- data/bin/htmldiff +21 -0
- data/bin/httparty +21 -0
- data/bin/httpclient +21 -0
- data/bin/ldiff +21 -0
- data/bin/mongo_console +21 -0
- data/bin/nokogiri +21 -0
- data/bin/pry +21 -0
- data/bin/putsreq +18 -71
- data/bin/rackup +21 -0
- data/bin/rails +1 -1
- data/bin/ri +21 -0
- data/bin/rollbar-rails-runner +21 -0
- data/bin/rspec +10 -5
- data/bin/safe_yaml +21 -0
- data/bin/sass +21 -0
- data/bin/sass-convert +21 -0
- data/bin/scss +21 -0
- data/bin/sdoc +21 -0
- data/bin/sdoc-merge +21 -0
- data/bin/setup +38 -0
- data/bin/sprockets +21 -0
- data/bin/thor +21 -0
- data/bin/tilt +21 -0
- data/bin/unicorn +21 -0
- data/bin/unicorn_rails +21 -0
- data/bin/update +29 -0
- data/bin/webpack +15 -0
- data/bin/webpack-dev-server +15 -0
- data/bin/yarn +11 -0
- data/config/application.rb +6 -4
- data/config/boot.rb +1 -1
- data/config/environment.rb +1 -1
- data/config/environments/development.rb +7 -3
- data/config/environments/production.rb +5 -2
- data/config/environments/test.rb +3 -1
- data/config/initializers/devise.rb +2 -2
- data/config/initializers/rack_attack.rb +24 -0
- data/config/initializers/rollbar.rb +58 -0
- data/config/initializers/setup_email.rb +7 -7
- data/config/mongoid.yml +2 -2
- data/config/newrelic.yml +45 -0
- data/config/puma.rb +15 -0
- data/config/routes.rb +2 -0
- data/config/webpack/development.js +5 -0
- data/config/webpack/environment.js +3 -0
- data/config/webpack/production.js +5 -0
- data/config/webpack/test.js +5 -0
- data/config/webpacker.yml +70 -0
- data/docker-compose.yml +25 -0
- data/lib/putsreq/cli_helper.rb +114 -0
- data/lib/putsreq/version.rb +1 -1
- data/package.json +30 -0
- data/putsreq.gemspec +6 -7
- data/spec/controllers/buckets_controller_spec.rb +54 -46
- data/spec/interactors/create_or_retrieve_bucket_spec.rb +25 -0
- data/spec/interactors/create_request_spec.rb +11 -8
- data/spec/interactors/create_response_spec.rb +1 -1
- data/spec/interactors/eval_response_builder_spec.rb +14 -17
- data/spec/interactors/forward_request_spec.rb +4 -4
- data/spec/lib/putsreq/cli_helper_spec.rb +114 -0
- data/spec/models/bucket_spec.rb +3 -3
- data/spec/spec_helper.rb +25 -25
- data/yarn.lock +7043 -0
- metadata +85 -20
- data/.hound.yml +0 -14
- data/app/interactors/notify_count.rb +0 -15
- data/app/models/.keep +0 -0
- data/config/initializers/redis.rb +0 -17
- data/config/unicorn.rb +0 -16
- data/lib/assets/.keep +0 -0
- data/public/images/.keep +0 -0
- data/vendor/assets/javascripts/.keep +0 -0
- data/vendor/assets/stylesheets/.keep +0 -0
data/bin/pry
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'pry' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("pry", "pry")
|
data/bin/putsreq
CHANGED
|
@@ -1,90 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
# encoding: utf-8
|
|
3
|
-
|
|
4
2
|
require 'thor'
|
|
5
|
-
require 'pusher-client'
|
|
6
3
|
|
|
7
4
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
|
8
5
|
|
|
9
|
-
require 'putsreq/version'
|
|
10
6
|
require 'httparty'
|
|
11
7
|
require 'uri'
|
|
8
|
+
require 'putsreq/version'
|
|
9
|
+
require 'putsreq/cli_helper'
|
|
12
10
|
|
|
13
11
|
class PutsReqCLI < Thor
|
|
14
|
-
no_commands do
|
|
15
|
-
def parse_bucket_token(p)
|
|
16
|
-
if p.start_with? 'http'
|
|
17
|
-
# from http://putsreq.com/token or http://putsreq.com/token/inspect
|
|
18
|
-
# to token
|
|
19
|
-
uri = URI(p)
|
|
20
|
-
return uri.path.split('/')[1]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
p
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def subscribe_and_forward(token, to)
|
|
27
|
-
puts "Listening requests from #{token}"
|
|
28
|
-
puts "Forwarding to #{to}"
|
|
29
|
-
puts 'Press CTRL+c to terminate'
|
|
30
|
-
|
|
31
|
-
PusherClient.logger.level = Logger::ERROR
|
|
32
|
-
|
|
33
|
-
options = { secure: true }
|
|
34
|
-
|
|
35
|
-
socket = PusherClient::Socket.new('3466d56fe2ef1fdd2943', options)
|
|
36
|
-
|
|
37
|
-
channel = "channel_requests_#{token}"
|
|
38
|
-
|
|
39
|
-
socket.subscribe(channel)
|
|
40
|
-
|
|
41
|
-
socket[channel].bind('new') do |data|
|
|
42
|
-
last_request = JSON.parse(data)['request']
|
|
43
|
-
|
|
44
|
-
options = { headers: last_request['headers'] }
|
|
45
|
-
|
|
46
|
-
options[:body] = last_request['body'] unless last_request['body'].to_s.empty?
|
|
47
|
-
|
|
48
|
-
forward_request = HTTParty.send(last_request['request_method'].downcase.to_sym,
|
|
49
|
-
to,
|
|
50
|
-
options)
|
|
51
|
-
|
|
52
|
-
puts "#{Time.now}\t#{last_request['request_method']}\t#{forward_request.code}"
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
socket.connect
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def forward_request(token, to, id)
|
|
59
|
-
url = "http://putsreq.com/#{token}/requests/#{id}.json"
|
|
60
|
-
last_request = HTTParty.get(url)
|
|
61
|
-
|
|
62
|
-
options = { headers: last_request['headers'] }
|
|
63
|
-
|
|
64
|
-
options[:body] = last_request['body'] unless last_request['body'].to_s.empty?
|
|
65
|
-
|
|
66
|
-
forward_request = HTTParty.send(last_request['request_method'].downcase.to_sym,
|
|
67
|
-
to,
|
|
68
|
-
options)
|
|
69
|
-
|
|
70
|
-
puts "#{Time.now}\t#{last_request['request_method']}\t#{forward_request.code}"
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
12
|
desc 'forward', 'Forward requests from PutsReq to a given URL'
|
|
75
|
-
method_option :token, desc: '
|
|
76
|
-
method_option :to,
|
|
77
|
-
method_option :id,
|
|
13
|
+
method_option :token, desc: 'Token to subscribe', required: true
|
|
14
|
+
method_option :to, desc: 'URL to forward requests', required: true
|
|
15
|
+
method_option :id, desc: 'Request ID to forward a single request', required: false
|
|
16
|
+
method_option :local, desc: 'Use localhost as a base URL', required: false, default: false
|
|
78
17
|
def forward
|
|
79
18
|
trap('SIGINT', 'EXIT')
|
|
80
19
|
|
|
81
|
-
token =
|
|
82
|
-
to
|
|
20
|
+
token = PutsReq::CLIHelper.parse_token(options[:token])
|
|
21
|
+
to = options[:to]
|
|
22
|
+
local = options[:local]
|
|
23
|
+
|
|
24
|
+
unless PutsReq::CLIHelper.valid_to?(to)
|
|
25
|
+
puts 'To must be a full and valid URL'
|
|
26
|
+
return
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
helper = PutsReq::CLIHelper.new(token, to, local)
|
|
83
30
|
|
|
84
31
|
if id = options[:id]
|
|
85
|
-
|
|
32
|
+
helper.find_and_forward(id)
|
|
86
33
|
else
|
|
87
|
-
subscribe_and_forward
|
|
34
|
+
helper.subscribe_and_forward
|
|
88
35
|
end
|
|
89
36
|
end
|
|
90
37
|
|
data/bin/rackup
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rackup' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("rack", "rackup")
|
data/bin/rails
CHANGED
data/bin/ri
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'ri' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("rdoc", "ri")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rollbar-rails-runner' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("rollbar", "rollbar-rails-runner")
|
data/bin/rspec
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
2
4
|
#
|
|
3
5
|
# This file was generated by Bundler.
|
|
4
6
|
#
|
|
@@ -6,11 +8,14 @@
|
|
|
6
8
|
# this file is here to facilitate running it.
|
|
7
9
|
#
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
11
16
|
Pathname.new(__FILE__).realpath)
|
|
12
17
|
|
|
13
|
-
require
|
|
14
|
-
require
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
15
20
|
|
|
16
|
-
load Gem.bin_path(
|
|
21
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/safe_yaml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'safe_yaml' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("safe_yaml", "safe_yaml")
|
data/bin/sass
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'sass' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sass", "sass")
|
data/bin/sass-convert
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'sass-convert' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sass", "sass-convert")
|
data/bin/scss
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'scss' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sass", "scss")
|
data/bin/sdoc
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'sdoc' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sdoc", "sdoc")
|
data/bin/sdoc-merge
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'sdoc-merge' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sdoc", "sdoc-merge")
|
data/bin/setup
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'pathname'
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
include FileUtils
|
|
5
|
+
|
|
6
|
+
# path to your application root.
|
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
8
|
+
|
|
9
|
+
def system!(*args)
|
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
chdir APP_ROOT do
|
|
14
|
+
# This script is a starting point to setup your application.
|
|
15
|
+
# Add necessary setup steps to this file.
|
|
16
|
+
|
|
17
|
+
puts '== Installing dependencies =='
|
|
18
|
+
system! 'gem install bundler --conservative'
|
|
19
|
+
system('bundle check') || system!('bundle install')
|
|
20
|
+
|
|
21
|
+
# Install JavaScript dependencies if using Yarn
|
|
22
|
+
# system('bin/yarn')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# puts "\n== Copying sample files =="
|
|
26
|
+
# unless File.exist?('config/database.yml')
|
|
27
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
28
|
+
# end
|
|
29
|
+
|
|
30
|
+
puts "\n== Preparing database =="
|
|
31
|
+
system! 'bin/rails db:setup'
|
|
32
|
+
|
|
33
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
34
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
35
|
+
|
|
36
|
+
puts "\n== Restarting application server =="
|
|
37
|
+
system! 'bin/rails restart'
|
|
38
|
+
end
|
data/bin/sprockets
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'sprockets' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("sprockets", "sprockets")
|
data/bin/thor
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'thor' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
12
|
+
load(bundle_binstub) if File.file?(bundle_binstub)
|
|
13
|
+
|
|
14
|
+
require "pathname"
|
|
15
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
16
|
+
Pathname.new(__FILE__).realpath)
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "bundler/setup"
|
|
20
|
+
|
|
21
|
+
load Gem.bin_path("thor", "thor")
|