rails_external_assets 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/README.md +1 -1
  5. data/examples/webpack/.babelrc +3 -0
  6. data/examples/webpack/.env +1 -0
  7. data/examples/webpack/.gitignore +22 -0
  8. data/examples/webpack/Gemfile +49 -0
  9. data/examples/webpack/Gemfile.lock +166 -0
  10. data/examples/webpack/README.md +8 -0
  11. data/examples/webpack/Rakefile +6 -0
  12. data/examples/webpack/app/assets/images/.keep +0 -0
  13. data/examples/webpack/app/assets/javascripts/application.js +13 -0
  14. data/examples/webpack/app/assets/stylesheets/application.css +15 -0
  15. data/examples/webpack/app/assets/webpack/ColorConverter/index.js +40 -0
  16. data/examples/webpack/app/assets/webpack/ColorConverter/index.scss +32 -0
  17. data/examples/webpack/app/assets/webpack/ColorConverter/initializer.js +7 -0
  18. data/examples/webpack/app/assets/webpack/logger.js +16 -0
  19. data/examples/webpack/app/controllers/application_controller.rb +8 -0
  20. data/examples/webpack/app/controllers/concerns/.keep +0 -0
  21. data/examples/webpack/app/helpers/application_helper.rb +2 -0
  22. data/examples/webpack/app/mailers/.keep +0 -0
  23. data/examples/webpack/app/models/.keep +0 -0
  24. data/examples/webpack/app/models/concerns/.keep +0 -0
  25. data/examples/webpack/app/views/application/index.html.erb +13 -0
  26. data/examples/webpack/app/views/layouts/application.html.erb +14 -0
  27. data/examples/webpack/bin/bundle +3 -0
  28. data/examples/webpack/bin/rails +9 -0
  29. data/examples/webpack/bin/rake +9 -0
  30. data/examples/webpack/bin/setup +29 -0
  31. data/examples/webpack/bin/spring +15 -0
  32. data/examples/webpack/config/application.rb +26 -0
  33. data/examples/webpack/config/boot.rb +3 -0
  34. data/examples/webpack/config/database.yml +25 -0
  35. data/examples/webpack/config/environment.rb +5 -0
  36. data/examples/webpack/config/environments/development.rb +41 -0
  37. data/examples/webpack/config/environments/production.rb +79 -0
  38. data/examples/webpack/config/environments/test.rb +42 -0
  39. data/examples/webpack/config/initializers/assets.rb +11 -0
  40. data/examples/webpack/config/initializers/backtrace_silencers.rb +7 -0
  41. data/examples/webpack/config/initializers/cookies_serializer.rb +3 -0
  42. data/examples/webpack/config/initializers/filter_parameter_logging.rb +4 -0
  43. data/examples/webpack/config/initializers/inflections.rb +16 -0
  44. data/examples/webpack/config/initializers/mime_types.rb +4 -0
  45. data/examples/webpack/config/initializers/rails_external_assets.rb +10 -0
  46. data/examples/webpack/config/initializers/session_store.rb +3 -0
  47. data/examples/webpack/config/initializers/wrap_parameters.rb +14 -0
  48. data/examples/webpack/config/locales/en.yml +23 -0
  49. data/examples/webpack/config/routes.rb +3 -0
  50. data/examples/webpack/config/secrets.yml +22 -0
  51. data/examples/webpack/config.ru +4 -0
  52. data/examples/webpack/db/seeds.rb +7 -0
  53. data/examples/webpack/lib/assets/.keep +0 -0
  54. data/examples/webpack/lib/tasks/.keep +0 -0
  55. data/examples/webpack/log/.keep +0 -0
  56. data/examples/webpack/package.json +41 -0
  57. data/examples/webpack/public/404.html +67 -0
  58. data/examples/webpack/public/422.html +67 -0
  59. data/examples/webpack/public/500.html +66 -0
  60. data/examples/webpack/public/favicon.ico +0 -0
  61. data/examples/webpack/public/robots.txt +5 -0
  62. data/examples/webpack/test/controllers/.keep +0 -0
  63. data/examples/webpack/test/fixtures/.keep +0 -0
  64. data/examples/webpack/test/helpers/.keep +0 -0
  65. data/examples/webpack/test/integration/.keep +0 -0
  66. data/examples/webpack/test/mailers/.keep +0 -0
  67. data/examples/webpack/test/models/.keep +0 -0
  68. data/examples/webpack/test/test_helper.rb +10 -0
  69. data/examples/webpack/vendor/assets/javascripts/.keep +0 -0
  70. data/examples/webpack/vendor/assets/stylesheets/.keep +0 -0
  71. data/examples/webpack/webpack.config.js +112 -0
  72. data/lib/rails_external_assets/configuration.rb +1 -1
  73. data/lib/rails_external_assets/version.rb +1 -1
  74. metadata +70 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a8296d0928ee3d04fbba98fa47115bfb94ab2fd
4
- data.tar.gz: 2a7ecabde06eb56b5a277999e50cceb6b81f55b8
3
+ metadata.gz: 1926ed5ce1ed6267703c676d14911f30dbed3403
4
+ data.tar.gz: 75f38c8a4e2a76903fc251f09095755f5ca11ec2
5
5
  SHA512:
6
- metadata.gz: 9e4c283b7a59685d4bb0af2d9cd4f1300c4d822a277bf7b56763cff2aa6b7ff5103ecde44d49b99a0b5c46f50b60b0b672abdbb62e9cb698113be65213aada90
7
- data.tar.gz: 93af807ba4ad0a0c95091b861f089364c2828fc5ead67148900cfd6660c12f681ad7716782780a280430c4fab25d74b15bc986a5a496663d358c95a439e9e2bf
6
+ metadata.gz: 1f84c321887f6e668e71b4b72629998d0cc25dd9ed4e3c15d26ced35996089ae48d4f45a0b424223ad30a15c313e7680f20bedf18b4c3a896cfbce8c0298367d
7
+ data.tar.gz: e276e66331eb9fe248aa300d020839da3d4817c0a3b3c52a62e21235cd3720a26ba0e589e9711142aa29a4cf2bec65cfddbd2d0fec967497a58abde951a47973
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  sudo: false
2
+ cache: bundler
2
3
  language: ruby
3
4
  rvm:
4
5
  - 2.2.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 (2017-1-9)
4
+
5
+ Fixed:
6
+
7
+ - Fixed default `sprockets_directives` config. `application/css` is the incorrect mime type, and it should be `text/css`. [3c6ea98](../../commit/3c6ea98)
8
+
3
9
  ## 0.3.0 (2016-6-2)
4
10
 
5
11
  Added:
data/README.md CHANGED
@@ -134,7 +134,7 @@ This is an array to configure the use of the `external_assets` Sprockets directi
134
134
  ```ruby
135
135
  [
136
136
  { mime_type: 'application/javascript', comments: ['//', ['/*', '*/']] },
137
- { mime_type: 'application/css', comments: ['//', ['/*', '*/']] }
137
+ { mime_type: 'text/css', comments: ['//', ['/*', '*/']] }
138
138
  ]
139
139
  ```
140
140
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["es2015"]
3
+ }
@@ -0,0 +1 @@
1
+ NODE_ENV=development
@@ -0,0 +1,22 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
18
+
19
+ # ignore but make sure you run `rake assets:precompile` before deploying
20
+ public/webpack-assets
21
+ node_modules
22
+ .npm-debug.log
@@ -0,0 +1,49 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.2.6'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 5.0'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .coffee assets and views
13
+ gem 'coffee-rails', '~> 4.1.0'
14
+ # See https://github.com/rails/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ gem 'rails_external_assets', path: '../..'
27
+
28
+ # Use ActiveModel has_secure_password
29
+ # gem 'bcrypt', '~> 3.1.7'
30
+
31
+ # Use Unicorn as the app server
32
+ # gem 'unicorn'
33
+
34
+ # Use Capistrano for deployment
35
+ # gem 'capistrano-rails', group: :development
36
+
37
+ group :development, :test do
38
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
39
+ gem 'byebug'
40
+ end
41
+
42
+ group :development do
43
+ # Access an IRB console on exception pages or by using <%= console %> in views
44
+ gem 'web-console', '~> 2.0'
45
+
46
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
47
+ gem 'spring'
48
+ end
49
+
@@ -0,0 +1,166 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ rails_external_assets (0.3.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actionmailer (4.2.6)
10
+ actionpack (= 4.2.6)
11
+ actionview (= 4.2.6)
12
+ activejob (= 4.2.6)
13
+ mail (~> 2.5, >= 2.5.4)
14
+ rails-dom-testing (~> 1.0, >= 1.0.5)
15
+ actionpack (4.2.6)
16
+ actionview (= 4.2.6)
17
+ activesupport (= 4.2.6)
18
+ rack (~> 1.6)
19
+ rack-test (~> 0.6.2)
20
+ rails-dom-testing (~> 1.0, >= 1.0.5)
21
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
22
+ actionview (4.2.6)
23
+ activesupport (= 4.2.6)
24
+ builder (~> 3.1)
25
+ erubis (~> 2.7.0)
26
+ rails-dom-testing (~> 1.0, >= 1.0.5)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ activejob (4.2.6)
29
+ activesupport (= 4.2.6)
30
+ globalid (>= 0.3.0)
31
+ activemodel (4.2.6)
32
+ activesupport (= 4.2.6)
33
+ builder (~> 3.1)
34
+ activerecord (4.2.6)
35
+ activemodel (= 4.2.6)
36
+ activesupport (= 4.2.6)
37
+ arel (~> 6.0)
38
+ activesupport (4.2.6)
39
+ i18n (~> 0.7)
40
+ json (~> 1.7, >= 1.7.7)
41
+ minitest (~> 5.1)
42
+ thread_safe (~> 0.3, >= 0.3.4)
43
+ tzinfo (~> 1.1)
44
+ arel (6.0.3)
45
+ binding_of_caller (0.7.2)
46
+ debug_inspector (>= 0.0.1)
47
+ builder (3.2.2)
48
+ byebug (9.0.5)
49
+ coffee-rails (4.1.1)
50
+ coffee-script (>= 2.2.0)
51
+ railties (>= 4.0.0, < 5.1.x)
52
+ coffee-script (2.4.1)
53
+ coffee-script-source
54
+ execjs
55
+ coffee-script-source (1.10.0)
56
+ concurrent-ruby (1.0.2)
57
+ debug_inspector (0.0.2)
58
+ erubis (2.7.0)
59
+ execjs (2.7.0)
60
+ globalid (0.3.6)
61
+ activesupport (>= 4.1.0)
62
+ i18n (0.7.0)
63
+ jbuilder (2.5.0)
64
+ activesupport (>= 3.0.0, < 5.1)
65
+ multi_json (~> 1.2)
66
+ jquery-rails (4.1.1)
67
+ rails-dom-testing (>= 1, < 3)
68
+ railties (>= 4.2.0)
69
+ thor (>= 0.14, < 2.0)
70
+ json (1.8.3)
71
+ loofah (2.0.3)
72
+ nokogiri (>= 1.5.9)
73
+ mail (2.6.4)
74
+ mime-types (>= 1.16, < 4)
75
+ mime-types (3.1)
76
+ mime-types-data (~> 3.2015)
77
+ mime-types-data (3.2016.0521)
78
+ mini_portile2 (2.0.0)
79
+ minitest (5.9.0)
80
+ multi_json (1.12.1)
81
+ nokogiri (1.6.7.2)
82
+ mini_portile2 (~> 2.0.0.rc2)
83
+ rack (1.6.4)
84
+ rack-test (0.6.3)
85
+ rack (>= 1.0)
86
+ rails (4.2.6)
87
+ actionmailer (= 4.2.6)
88
+ actionpack (= 4.2.6)
89
+ actionview (= 4.2.6)
90
+ activejob (= 4.2.6)
91
+ activemodel (= 4.2.6)
92
+ activerecord (= 4.2.6)
93
+ activesupport (= 4.2.6)
94
+ bundler (>= 1.3.0, < 2.0)
95
+ railties (= 4.2.6)
96
+ sprockets-rails
97
+ rails-deprecated_sanitizer (1.0.3)
98
+ activesupport (>= 4.2.0.alpha)
99
+ rails-dom-testing (1.0.7)
100
+ activesupport (>= 4.2.0.beta, < 5.0)
101
+ nokogiri (~> 1.6.0)
102
+ rails-deprecated_sanitizer (>= 1.0.1)
103
+ rails-html-sanitizer (1.0.3)
104
+ loofah (~> 2.0)
105
+ railties (4.2.6)
106
+ actionpack (= 4.2.6)
107
+ activesupport (= 4.2.6)
108
+ rake (>= 0.8.7)
109
+ thor (>= 0.18.1, < 2.0)
110
+ rake (11.1.2)
111
+ rdoc (4.2.2)
112
+ json (~> 1.4)
113
+ sass (3.4.22)
114
+ sass-rails (5.0.4)
115
+ railties (>= 4.0.0, < 5.0)
116
+ sass (~> 3.1)
117
+ sprockets (>= 2.8, < 4.0)
118
+ sprockets-rails (>= 2.0, < 4.0)
119
+ tilt (>= 1.1, < 3)
120
+ sdoc (0.4.1)
121
+ json (~> 1.7, >= 1.7.7)
122
+ rdoc (~> 4.0)
123
+ spring (1.7.1)
124
+ sprockets (3.6.0)
125
+ concurrent-ruby (~> 1.0)
126
+ rack (> 1, < 3)
127
+ sprockets-rails (3.0.4)
128
+ actionpack (>= 4.0)
129
+ activesupport (>= 4.0)
130
+ sprockets (>= 3.0.0)
131
+ sqlite3 (1.3.11)
132
+ thor (0.19.1)
133
+ thread_safe (0.3.5)
134
+ tilt (2.0.5)
135
+ turbolinks (2.5.3)
136
+ coffee-rails
137
+ tzinfo (1.2.2)
138
+ thread_safe (~> 0.1)
139
+ uglifier (3.0.0)
140
+ execjs (>= 0.3.0, < 3)
141
+ web-console (2.3.0)
142
+ activemodel (>= 4.0)
143
+ binding_of_caller (>= 0.7.2)
144
+ railties (>= 4.0)
145
+ sprockets-rails (>= 2.0, < 4.0)
146
+
147
+ PLATFORMS
148
+ ruby
149
+
150
+ DEPENDENCIES
151
+ byebug
152
+ coffee-rails (~> 4.1.0)
153
+ jbuilder (~> 2.0)
154
+ jquery-rails
155
+ rails (= 4.2.6)
156
+ rails_external_assets!
157
+ sass-rails (~> 5.0)
158
+ sdoc (~> 0.4.0)
159
+ spring
160
+ sqlite3
161
+ turbolinks
162
+ uglifier (>= 1.3.0)
163
+ web-console (~> 2.0)
164
+
165
+ BUNDLED WITH
166
+ 1.12.5
@@ -0,0 +1,8 @@
1
+ # Setup
2
+
3
+ - `npm install`
4
+ - `bundle install`
5
+
6
+ # Run locally
7
+
8
+ - Run `rails server` and `npm start`
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= external_require ColorConverter/initializer
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,40 @@
1
+ import './index.scss';
2
+ import hexToRgb from 'hex-to-rgb';
3
+ import uuid from 'node-uuid';
4
+
5
+ export default class ColorConverter {
6
+ constructor(name, nodeId) {
7
+ this.node = document.getElementById(nodeId);
8
+ this.name = name;
9
+ this.render();
10
+ }
11
+
12
+ render() {
13
+ const uid = uuid.v4();
14
+ this.node.innerHTML = `
15
+ <div class="color-converter">
16
+ <h1>${this.name}</h1>
17
+ <input id="${uid}-input" class="color-converter__hex" type="text" placeHolder="Hex Color (#000000)" />
18
+ <div class="color-converter__rgb">
19
+ <span id="${uid}-rgb" class="color-converter__rgb__name"></span>
20
+ <span id="${uid}-color" class="color-converter__rgb__color-block"></span>
21
+ </div>
22
+ </div>
23
+ `;
24
+ const inputNode = document.getElementById(`${uid}-input`);
25
+ const rgbNode = document.getElementById(`${uid}-rgb`);
26
+ const colorNode = document.getElementById(`${uid}-color`);
27
+
28
+ inputNode.addEventListener('input', function({target: {value}}) {
29
+ if (value.length > 0) {
30
+ const rgb = hexToRgb(value);
31
+ rgbNode.innerHTML = `RGB: (${rgb})`;
32
+ colorNode.style.backgroundColor = `rgb(${rgb})`;
33
+ colorNode.classList.add('is-shown');
34
+ } else {
35
+ rgbNode.innerHTML = '';
36
+ colorNode.classList.remove('is-shown');
37
+ }
38
+ });
39
+ }
40
+ }
@@ -0,0 +1,32 @@
1
+ .color-converter {
2
+ width: 500px;
3
+ border: 1px solid #000;
4
+ padding: 0.5rem;
5
+ margin: 0.5rem;
6
+ line-height: 1.5;
7
+
8
+ &__hex {
9
+ border-radius: 5px;
10
+ font-size: 14px;
11
+ padding: 0.25rem;
12
+ margin-bottom: 0.5rem;
13
+ }
14
+
15
+ &__rgb {
16
+ &__name {
17
+ font-size: 16px;
18
+ margin-right: 0.5rem;
19
+ }
20
+
21
+ &__color-block {
22
+ display: none;
23
+ width: 10px;
24
+ height: 10px;
25
+ border: 1px solid #000;
26
+
27
+ &.is-shown {
28
+ display: inline-block;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,7 @@
1
+ import ColorConverter from './index';
2
+
3
+ function createColorConverter(name, id) {
4
+ new ColorConverter(name, id);
5
+ }
6
+
7
+ window.createColorConverter = createColorConverter;
@@ -0,0 +1,16 @@
1
+ class Logger {
2
+ constructor(name) {
3
+ this.name = name;
4
+ }
5
+
6
+ logit(val) {
7
+ console.log(`Logged by ${this.name}: ${val}`);
8
+ }
9
+ }
10
+
11
+ const myLogger = new Logger('First Logger');
12
+ const otherLogger = new Logger('Foo Logger');
13
+
14
+ myLogger.logit('hello world');
15
+ otherLogger.logit('hi!');
16
+ myLogger.logit('bye');
@@ -0,0 +1,8 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+
6
+ def index
7
+ end
8
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ <h1>Webpack Example</h1>
2
+
3
+ Check the console for logger output.
4
+
5
+ <%= external_asset_js 'logger' %>
6
+
7
+ <div id="color-converter1"></div>
8
+ <div id="color-converter2"></div>
9
+
10
+ <script>
11
+ createColorConverter('Color Converter 1', 'color-converter1');
12
+ createColorConverter('Color Converter 2', 'color-converter2');
13
+ </script>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Webpack</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
11
+ Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
12
+ gem 'spring', match[1]
13
+ require 'spring/binstub'
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module Webpack
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ # Do not swallow errors in after_commit/after_rollback callbacks.
24
+ config.active_record.raise_in_transactional_callbacks = true
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!