test_server 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +3 -2
  3. data/Gemfile +8 -12
  4. data/README.md +2 -2
  5. data/Rakefile +27 -10
  6. data/Rakefile.rails +4 -0
  7. data/app/assets/stylesheets/application.scss +2 -2
  8. data/config/application.rb +21 -3
  9. data/config/environments/production.rb +0 -8
  10. data/files/secrets.yml.erb +20 -0
  11. data/lib/test_server/actions/initialize_application.rb +6 -0
  12. data/lib/test_server/cli/main.rb +3 -1
  13. data/lib/test_server/config.rb +5 -2
  14. data/lib/test_server/version.rb +1 -1
  15. data/public/assets/ajax-loader-8deebb46e9598adab64ca18a097090f2.gif +0 -0
  16. data/public/assets/application-b8f8c1a2dda0ed76ca05e01be6fef6be.js +13451 -0
  17. data/public/assets/application-b8f8c1a2dda0ed76ca05e01be6fef6be.js.gz +0 -0
  18. data/public/assets/application-c2d56ef291192c32403d07556c36de26.css +8222 -0
  19. data/public/assets/application-c2d56ef291192c32403d07556c36de26.css.gz +0 -0
  20. data/public/assets/bootstrap-sass/dist/fonts/glyphicons-halflings-regular-3e35c7e527383fc6fc479c17111469de.ttf +0 -0
  21. data/public/assets/bootstrap-sass/dist/fonts/glyphicons-halflings-regular-483c8aa83c1cae07664b1c959523d062.woff +0 -0
  22. data/public/assets/bootstrap-sass/dist/fonts/glyphicons-halflings-regular-f61f75238afd91ceeef4a5e4c639ead4.svg +229 -0
  23. data/public/assets/bootstrap-sass/dist/fonts/glyphicons-halflings-regular-fe255aca45c0f6e7c8b2a1ed7c7a5274.eot +0 -0
  24. data/public/assets/bootstrap-sass/docs-assets/ico/apple-touch-icon-144-precomposed-dc1944e21bfdedf37f0626c17fe4761b.png +0 -0
  25. data/public/assets/bootstrap-sass/docs-assets/ico/favicon-5ee6a35987b7feae485871297a51e474.png +0 -0
  26. data/public/assets/bootstrap-sass/docs-assets/js/application-0981da122477809b03e6316775fba8ce.js +105 -0
  27. data/public/assets/bootstrap-sass/docs-assets/js/application-0981da122477809b03e6316775fba8ce.js.gz +0 -0
  28. data/public/assets/bootstrap-sass/examples/screenshots/carousel-4fc912866ec1da66bf3ca268dedf2fd0.jpg +0 -0
  29. data/public/assets/bootstrap-sass/examples/screenshots/grid-65fc56df081af8c364a3e43baa48a7f9.jpg +0 -0
  30. data/public/assets/bootstrap-sass/examples/screenshots/jumbotron-05e53fe8b84407cac9996bb8a7617d1f.jpg +0 -0
  31. data/public/assets/bootstrap-sass/examples/screenshots/jumbotron-narrow-c1456e53d5471cb59fd56efa0630407a.jpg +0 -0
  32. data/public/assets/bootstrap-sass/examples/screenshots/justified-nav-28adff9e12d21bc716cb8b4b45a5170a.jpg +0 -0
  33. data/public/assets/bootstrap-sass/examples/screenshots/navbar-9e619f72d4430e54820d5cf959899782.jpg +0 -0
  34. data/public/assets/bootstrap-sass/examples/screenshots/navbar-fixed-58ee4e4e189f9d59408c5be13638eae6.jpg +0 -0
  35. data/public/assets/bootstrap-sass/examples/screenshots/navbar-static-2be1617daecba84fc924b05da62ab618.jpg +0 -0
  36. data/public/assets/bootstrap-sass/examples/screenshots/non-responsive-4dbd6b23b283fc02cba682873bd715f4.jpg +0 -0
  37. data/public/assets/bootstrap-sass/examples/screenshots/offcanvas-bc3fe2949cd853c2a8900307956c8a97.jpg +0 -0
  38. data/public/assets/bootstrap-sass/examples/screenshots/sign-in-f70aa602b9439d930e0153262e70c935.jpg +0 -0
  39. data/public/assets/bootstrap-sass/examples/screenshots/starter-template-244e96ea0834aaf68ac2d51b4779ea02.jpg +0 -0
  40. data/public/assets/bootstrap-sass/examples/screenshots/sticky-footer-3709ae2872cf73ad6eadb9cf1e471ee3.jpg +0 -0
  41. data/public/assets/bootstrap-sass/examples/screenshots/sticky-footer-navbar-5587044c445c613c499c94987c3655b4.jpg +0 -0
  42. data/public/assets/bootstrap-sass/examples/screenshots/theme-21ab06bfc9b7f21b4fc8e803da11f13d.jpg +0 -0
  43. data/public/assets/bootstrap-sass/fonts/glyphicons-halflings-regular-3e35c7e527383fc6fc479c17111469de.ttf +0 -0
  44. data/public/assets/bootstrap-sass/fonts/glyphicons-halflings-regular-483c8aa83c1cae07664b1c959523d062.woff +0 -0
  45. data/public/assets/bootstrap-sass/fonts/glyphicons-halflings-regular-f61f75238afd91ceeef4a5e4c639ead4.svg +229 -0
  46. data/public/assets/bootstrap-sass/fonts/glyphicons-halflings-regular-fe255aca45c0f6e7c8b2a1ed7c7a5274.eot +0 -0
  47. data/public/assets/manifest-399d632024eeab469766a0adcd038b49.json +1 -0
  48. data/public/assets/open-sans/fonts/bold/opensans-bold-webfont-5ab08b90fbb2b65c7fa85b6257ab7c75.eot +0 -0
  49. data/public/assets/open-sans/fonts/bold/opensans-bold-webfont-750a875c4f25392d79776eb913ce7a2a.svg +958 -0
  50. data/public/assets/open-sans/fonts/bold/opensans-bold-webfont-d245c81584bc209186b92046a460e46a.woff +0 -0
  51. data/public/assets/open-sans/fonts/bold/opensans-bold-webfont-e7a6debf8f091e4503e044cfd5be0c41.ttf +0 -0
  52. data/public/assets/open-sans/fonts/bold-italic/opensans-bold-italic-webfont-3343098c02ad5c9255acc597f6d0865a.woff +0 -0
  53. data/public/assets/open-sans/fonts/bold-italic/opensans-bold-italic-webfont-4de1e5ddb76bb4bc65ecd0bf26d18052.ttf +0 -0
  54. data/public/assets/open-sans/fonts/bold-italic/opensans-bold-italic-webfont-90994dcc0d06a4e813fe6789ec46409d.eot +0 -0
  55. data/public/assets/open-sans/fonts/bold-italic/opensans-bold-italic-webfont-d125b28836bb8f399ae1a996b933792f.svg +958 -0
  56. data/public/assets/open-sans/fonts/extrabold/opensans-extrabold-webfont-4390d91f0b15889beaad27555d1a73ed.eot +0 -0
  57. data/public/assets/open-sans/fonts/extrabold/opensans-extrabold-webfont-5afffe461cab895cdb1b2915173f9c40.ttf +0 -0
  58. data/public/assets/open-sans/fonts/extrabold/opensans-extrabold-webfont-97541ae028af017f8c73e5c193001d42.svg +958 -0
  59. data/public/assets/open-sans/fonts/extrabold/opensans-extrabold-webfont-b41639c02d95cce9a3afabec40966e87.woff +0 -0
  60. data/public/assets/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont-4688d243519b0043c628699427e33d08.ttf +0 -0
  61. data/public/assets/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont-6124b23773362839bbb9fe59c5c42669.eot +0 -0
  62. data/public/assets/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont-b288b8bb2c0456f513c66e5f3d1a8e86.woff +0 -0
  63. data/public/assets/open-sans/fonts/extrabold-italic/opensans-extrabold-italic-webfont-da60ccbb572a495f477b2175c04d1960.svg +958 -0
  64. data/public/assets/open-sans/fonts/italic/opensans-italic-webfont-a3e912390ca29982acbe95e8bf31c679.ttf +0 -0
  65. data/public/assets/open-sans/fonts/italic/opensans-italic-webfont-b4669a561cdae44f45b60a0ee2e7e8cd.woff +0 -0
  66. data/public/assets/open-sans/fonts/italic/opensans-italic-webfont-d8a07c962e6a9bebab24506c7b0e53a5.svg +958 -0
  67. data/public/assets/open-sans/fonts/italic/opensans-italic-webfont-ef65d5a7ec248309b3d39185eab4de46.eot +0 -0
  68. data/public/assets/open-sans/fonts/light/opensans-light-webfont-0f32077bd4cbff507ff8ffc7e9f207f0.ttf +0 -0
  69. data/public/assets/open-sans/fonts/light/opensans-light-webfont-1337f63e97d6102f2a3a241fac129c7a.woff +0 -0
  70. data/public/assets/open-sans/fonts/light/opensans-light-webfont-6d641cac3cbf66342fe91dfc29723d34.eot +0 -0
  71. data/public/assets/open-sans/fonts/light/opensans-light-webfont-8273be5ff945da30906b8fd7fac767aa.svg +958 -0
  72. data/public/assets/open-sans/fonts/light-italic/opensans-light-italic-webfont-31f3f5d1f66d7ebbdd3d6f462707bee6.ttf +0 -0
  73. data/public/assets/open-sans/fonts/light-italic/opensans-light-italic-webfont-a5ef1006892c0a391e29f7c839982463.woff +0 -0
  74. data/public/assets/open-sans/fonts/light-italic/opensans-light-italic-webfont-b8b819ed29a82b0be6c0de1e8246b1dd.eot +0 -0
  75. data/public/assets/open-sans/fonts/light-italic/opensans-light-italic-webfont-f239c2432833ae460c2294be532f9ea7.svg +958 -0
  76. data/public/assets/open-sans/fonts/regular/opensans-regular-webfont-001b7e40367093d95c1d5e47f32c0830.ttf +0 -0
  77. data/public/assets/open-sans/fonts/regular/opensans-regular-webfont-356deed95e2b29ee22d793842fe14c14.eot +0 -0
  78. data/public/assets/open-sans/fonts/regular/opensans-regular-webfont-8d971e991a2e1b8c6bfb18e879c8a024.woff +0 -0
  79. data/public/assets/open-sans/fonts/regular/opensans-regular-webfont-c89373b333fa6e878d2e54da360d60d1.svg +958 -0
  80. data/public/assets/open-sans/fonts/semibold/opensans-semibold-webfont-3e3ce2430855173bdb61b444afd27798.svg +958 -0
  81. data/public/assets/open-sans/fonts/semibold/opensans-semibold-webfont-66d0e5df946a12d08438dd7c935ae3c1.eot +0 -0
  82. data/public/assets/open-sans/fonts/semibold/opensans-semibold-webfont-92eb41279d9e4bb36db7d798f4a3ce53.woff +0 -0
  83. data/public/assets/open-sans/fonts/semibold/opensans-semibold-webfont-a351567fbcf31a8a7ff8cf20b88da14f.ttf +0 -0
  84. data/public/assets/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont-096e5044aeb4a52cd9e943054c0d1916.svg +958 -0
  85. data/public/assets/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont-175ec3bae342e25dd251f86e8f5584b2.eot +0 -0
  86. data/public/assets/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont-450906046944eae72690caf27a30bec1.woff +0 -0
  87. data/public/assets/open-sans/fonts/semibold-italic/opensans-semibold-italic-webfont-f9131100953e2ee6bb7ea636bef99935.ttf +0 -0
  88. data/script/precompile +4 -0
  89. data/share/archlinux/Gemfile.rb.erb +9 -2
  90. data/share/archlinux/PKGBUILD.sh.erb +117 -30
  91. data/share/archlinux/bundle_config.yaml.erb +3 -0
  92. data/share/archlinux/config.yaml.erb +2 -0
  93. data/share/archlinux/database.yml.erb +25 -0
  94. data/share/archlinux/secrets.yml.erb +20 -0
  95. data/share/archlinux/startup.sh.erb +5 -0
  96. data/share/archlinux/test_server.install +22 -3
  97. data/share/{archlinux → systemd}/tmpfiles.conf.erb +0 -0
  98. data/spec/controllers/errors_controller_spec.rb +12 -12
  99. data/test_server.gemspec +13 -2
  100. data/tmp/.keep +0 -0
  101. metadata +218 -54
  102. data/share/systemd/test_server.service +0 -9
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTZhODc5M2ExYjE1ZjA4ZTcwYTI2MWU5ODE1NjMyMmI3YjdkOWI5ZA==
5
- data.tar.gz: !binary |-
6
- MzBlOGY1NTc5MDA5NTI1ODAyMTZmNmNkZmE0M2ZjODY3ZmVlOTZjYg==
2
+ SHA1:
3
+ metadata.gz: 2d9a10c5804ff50d55a467e42d0adde348fedb1e
4
+ data.tar.gz: 564e736d5d561697fc5ed0e04e905e2144bd5712
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTUwZDYzYzk2NDYxZWQ3YjY1NjE3OGJkMTdmOTUyMjcyNWNiMWVhYzNkMjg1
10
- ODU0NjkyNGFiNGM3YWFiYmE4ZmVjMjZhMDM4ZmYyMGQyZGYxNzYwMjhkMzJk
11
- OTg4OWU2MjczZDIwMThhMWI3ZDBlMjhmMDVjZTA4YmIzZDdhNGQ=
12
- data.tar.gz: !binary |-
13
- MzM2YWYxMjNlZDZiMzQ0YWQ3YmU1OTczMWU1NzExMGIwZGE5MzI5MTBmM2Vh
14
- M2UxNTc4YmUxNzQwNzQ0OGE0Mjg5ZTk2OGY3MDY0OTdiM2I4YWJiYjBiMzk0
15
- ZDQzYmIyNDQxODdmMDMwNzRjYjhjZWNhMTcwMDFiMjlmMGU5NjI=
6
+ metadata.gz: 3514a815f257f6fd9d0c4de2d2714355e35f371bf0b96c2e2a0ae7989a1cfa6af33808d046b951d27221bd5c5b787c0fd7d958bb7e8e9869ef2656068fc596dd
7
+ data.tar.gz: 23dbdf1020ec5f9cc9361e7c1c8f9b053b92cee6127bd626713202161ee9aaa8f3f541b1e53ebd8c43ffba4b82f2e6a1100b769eb1c5eee770a755e5ef848369
data/.gitignore CHANGED
@@ -9,12 +9,13 @@ _yardoc
9
9
  coverage
10
10
  doc/
11
11
  lib/bundler/man
12
- pkg
12
+ pkg/
13
+ src/
13
14
  rdoc
14
15
  spec/reports
15
16
  test/tmp
16
17
  test/version_tmp
17
- tmp
18
+ tmp/
18
19
  *.xz
19
20
  PKGBUILD
20
21
  db/*
data/Gemfile CHANGED
@@ -12,15 +12,20 @@ gem 'jbuilder', '~> 2.0'
12
12
  gem 'jquery-rails'
13
13
  gem 'pager'
14
14
  gem 'rack-contrib'
15
- gem 'rack-cors'
15
+ gem 'rack-cors', require: 'rack/cors'
16
16
  gem 'rails', '4.1.0'
17
17
  gem 'sass-rails', '~> 4.0.3'
18
+ gem 'sprockets-rails', '~> 2.1.3'
18
19
  gem 'sqlite3'
19
20
  gem 'therubyracer'
20
21
  gem 'thor'
21
22
  gem 'turbolinks'
22
23
  gem 'uglifier', '>= 1.3.0'
23
24
  gem 'breadcrumbs_on_rails'
25
+ gem 'puma', '~> 2.8.2'
26
+ gem 'pry-rails'
27
+ gem 'pry', require: false
28
+ gem 'pry-debugger', require: false
24
29
 
25
30
  gemspec
26
31
 
@@ -35,7 +40,6 @@ group :development do
35
40
  gem 'tmrb', require: false
36
41
  gem 'yard', require: false
37
42
  gem 'inch', require: false
38
- gem 'filegen'
39
43
  gem 'spring'
40
44
  end
41
45
 
@@ -45,7 +49,6 @@ end
45
49
 
46
50
  group :development, :test do
47
51
  gem 'aruba', require: false
48
- gem 'bundler', '~> 1.3', require: false
49
52
  gem 'capybara', require: false
50
53
  gem 'coveralls', require: false
51
54
  gem 'cucumber', require: false
@@ -58,8 +61,6 @@ group :development, :test do
58
61
  gem 'launchy'
59
62
  gem 'nokogiri'
60
63
  gem 'poltergeist', require: 'capybara/poltergeist'
61
- gem 'pry'
62
- gem 'pry-debugger', require: false
63
64
  gem 'pry-doc', require: false
64
65
  gem 'rack-test', require: 'rack/test'
65
66
  gem 'rake', require: false
@@ -70,11 +71,6 @@ group :development, :test do
70
71
  gem 'simplecov', require: false
71
72
  gem 'versionomy', require: false
72
73
  gem 'awesome_print', require: 'ap'
73
- end
74
-
75
-
76
- group :webserver do
77
- group :puma do
78
- gem 'puma'
79
- end
74
+ gem 'sinatra', require: 'sinatra/base'
75
+ gem 'filegen'
80
76
  end
data/README.md CHANGED
@@ -111,8 +111,8 @@ or
111
111
 
112
112
  ## List of test end points
113
113
 
114
- To be defined. Hopefully I can provide a `controller` which handles this within
115
- the application.
114
+ Just point your browser to the root page `http://<your-server>:8000/`. The
115
+ dashboard will provide you a list of available end points for your tests.
116
116
 
117
117
  ## Contributing
118
118
 
data/Rakefile CHANGED
@@ -5,9 +5,6 @@ require 'fedux_org/stdlib/rake'
5
5
  require 'active_support/core_ext/string/inflections'
6
6
  require 'open3'
7
7
 
8
- #require File.expand_path('../config/application', __FILE__)
9
- #Rails.application.load_tasks
10
-
11
8
  def software
12
9
  gemspec.name
13
10
  end
@@ -49,9 +46,7 @@ def gem_directory
49
46
  ::File.join(root_directory, 'vendor', 'cache')
50
47
  end
51
48
 
52
- task :default => 'gem:build'
53
-
54
- file gem_file => 'gem:build'
49
+ task :default => 'package:gem'
55
50
 
56
51
  file tmp_directory do
57
52
  FileUtils.mkdir_p tmp_directory
@@ -66,17 +61,37 @@ def extract_sha
66
61
  end
67
62
 
68
63
  namespace :package do
69
- desc 'build arch linux package'
70
- task :archlinux => [gem_file, archlinux_build_directory] do
71
- #FileUtils.mv ::File.join(pkg_directory, "#{software}-#{version}.gem"), archlinux_build_directory
72
64
 
65
+ desc 'build gem package'
66
+ task :gem do
67
+ sh 'bundle exec rake -f Rakefile.rails assets:clobber'
68
+ sh 'bundle exec rake -f Rakefile.rails assets:precompile'
69
+
70
+ base_path = File.expand_path('..', __FILE__)
71
+ FileUtils.chmod_R 'a+r', Dir.glob(File.join(base_path, 'public', 'assets', '**', '*')).keep_if { |f| File.file? f }
72
+
73
+ Rake::Task['gem:build'].invoke
74
+ end
75
+
76
+ desc 'build arch linux package'
77
+ task :archlinux => ['package:gem', archlinux_build_directory] do
73
78
  generator = Filegen::Rubygen.new
74
79
  template = File.read(File.expand_path('../share/archlinux/PKGBUILD.sh.erb', __FILE__))
75
80
  build_file = File.expand_path('../share/archlinux/PKGBUILD', __FILE__)
76
81
 
82
+ if ENV.key?('LOCAL_BUILD')
83
+ package_file = ::File.join(pkg_directory, "#{software}-#{version}.gem")
84
+ source = ''
85
+ else
86
+ package_file = '$pkgname-$pkgver.gem'
87
+ source = 'http://gems.rubyforge.org/gems/$pkgname-$pkgver.gem'
88
+ end
89
+
77
90
  data = {
78
91
  sha: nil,
79
92
  version: version,
93
+ package: package_file,
94
+ source: source,
80
95
  }
81
96
 
82
97
  Dir.chdir(archlinux_build_directory) do
@@ -87,13 +102,15 @@ namespace :package do
87
102
  data = {
88
103
  sha: extract_sha,
89
104
  version: version,
105
+ package: package_file,
106
+ source: source,
90
107
  }
91
108
 
92
109
  File.open(build_file, 'w') do |f|
93
110
  f.write generator.run(template, data)
94
111
  end
95
112
 
96
- sh "bash -x makepkg -f"
113
+ sh "makepkg -f"
97
114
  end
98
115
  end
99
116
  end
data/Rakefile.rails ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require File.expand_path('../config/application', __FILE__)
4
+ Rails.application.load_tasks
@@ -13,8 +13,8 @@
13
13
  *= require_self
14
14
  */
15
15
 
16
- $icon-font-path: '/assets/bootstrap-sass/fonts/';
17
- $open-sans-path: '/assets/open-sans/fonts';
16
+ $icon-font-path: 'bootstrap-sass/fonts/';
17
+ $open-sans-path: 'open-sans/fonts';
18
18
 
19
19
  @import 'bootstrap-sass/lib/bootstrap';
20
20
  @import 'open-sans/scss/open-sans';
@@ -26,13 +26,19 @@ module TestServer
26
26
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
27
27
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
28
28
  # config.i18n.default_locale = :de
29
- config.middleware.use Rack::Deflater
30
-
29
+
31
30
  # handle exceptions
32
31
  #config.exceptions_app = self.routes
33
32
 
33
+ # Precompile additional assets.
34
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
35
+ # config.assets.precompile += %w( search.js )
36
+ config.assets.precompile << Proc.new { |path|
37
+ true if %w( .png .gif .jpg .jpeg .svg .eot .otf .svc .woff .ttf ).include? Pathname.new(path).extname
38
+ }
39
+
34
40
  # logging
35
- config.logger = ActiveSupport::TaggedLogging.new(::Logger.new(TestServer.config.access_log))
41
+ config.logger = ActiveSupport::TaggedLogging.new(::Logger.new(TestServer.config.error_log))
36
42
 
37
43
  # assets
38
44
  config.assets.paths << Rails.root.join('vendor', 'assets', 'components')
@@ -40,5 +46,17 @@ module TestServer
40
46
 
41
47
  # store for http caching
42
48
  config.cache_store = :memory_store
49
+
50
+ config.middleware.use Rack::Deflater
51
+ config.middleware.use Rack::CommonLogger, TestServer::AccessLogger.new(TestServer.config.access_log)
52
+
53
+ unless TestServer.config.origins.blank?
54
+ config.middleware.use Rack::Cors do
55
+ allow do
56
+ origins(*Array(TestServer.config.origins))
57
+ resource '*', :headers => :any, :methods => :any
58
+ end
59
+ end
60
+ end
43
61
  end
44
62
  end
@@ -57,14 +57,6 @@ Rails.application.configure do
57
57
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
58
  # config.action_controller.asset_host = "http://assets.example.com"
59
59
 
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
63
- #config.assets.precompile += %w( .png .gif .jpg .jpeg .svg .eot .otf .svc .woff .ttf )
64
- config.assets.precompile << Proc.new { |path|
65
- true if %w( .png .gif .jpg .jpeg .svg .eot .otf .svc .woff .ttf ).include? Pathname.new(path).extname
66
- }
67
-
68
60
  # Ignore bad email addresses and do not raise email delivery errors.
69
61
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
70
62
  # config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,20 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+ <%- require 'secure_random' -%>
13
+ development:
14
+ secret_key_base: <%= SecureRandom.hex(128) %>
15
+
16
+ test:
17
+ secret_key_base: <%= SecureRandom.hex(128) %>
18
+
19
+ production:
20
+ secret_key_base: <%= SecureRandom.hex(128) %>
@@ -20,6 +20,7 @@ module TestServer
20
20
  create_local_storage if options[:create_local_storage]
21
21
  create_pre_receive_hook if options[:create_pre_receive_hook]
22
22
  create_config_file if options[:create_config_file]
23
+ create_secrets_file if options[:create_secrets_file]
23
24
  pre_seed if options[:pre_seed]
24
25
 
25
26
  show_example_config
@@ -47,6 +48,11 @@ module TestServer
47
48
  Actions::CreateFile.new(:'example-config', config.config_file, TestServer::Data.new(config), force: options[:force], create_directories: true).run
48
49
  end
49
50
 
51
+ def create_secrets_file
52
+ TestServer.ui_logger.info "Creating secrets file at \"#{config.secrets_file}\"."
53
+ Actions::CreateFile.new(:'secrets.yml', config.secrets_file, TestServer::Data.new(config), force: options[:force], create_directories: true).run
54
+ end
55
+
50
56
  def show_example_config
51
57
  TestServer.ui_logger.info "Showing the configuration of local_pac on your system."
52
58
  Actions::CreateOutput.new(:'example-config', $stdout, Data.new(config)).run
@@ -65,7 +65,8 @@ module TestServer
65
65
  option :create_pid_directory, type: :boolean, desc: 'Create pid directory', default: true
66
66
  option :create_log_directory, type: :boolean, desc: 'Create log directory', default: true
67
67
  option :create_sass_cache, type: :boolean, desc: 'Create sass cache directory', default: true
68
- option :create_config_file, type: :boolean, desc: 'Create config_directory', default: true
68
+ option :create_config_file, type: :boolean, desc: 'Create config_file', default: true
69
+ option :create_secrets_file, type: :boolean, desc: 'Create secrets file', default: true
69
70
  def init
70
71
  TestServer.config = TestServer::Config.new(options[:config_file]) if options[:config_file]
71
72
 
@@ -94,6 +95,7 @@ module TestServer
94
95
  create_log_directory: options[:create_log_directory],
95
96
  create_sass_cache: options[:create_sass_cache],
96
97
  create_config_file: options[:create_config_file],
98
+ create_secrets_file: options[:create_secrets_file],
97
99
  ).run
98
100
  end
99
101
 
@@ -84,9 +84,11 @@ module TestServer
84
84
  end
85
85
 
86
86
  option :access_log, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.local', 'share', 'test_server', 'log', 'access.log'))
87
+ option :error_log, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.local', 'share', 'test_server', 'log', 'error.log'))
87
88
  option :config_file, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.config', 'test_server', 'config.yaml'))
89
+ option :secrets_file, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.config', 'test_server', 'secrets.yml'))
88
90
  option :debug_mode, false
89
- option :environment, 'development'
91
+ option :environment, 'production'
90
92
  option :executable, ::File.expand_path(::File.expand_path('../../../bin/test_server', __FILE__))
91
93
  option :gem_path, Gem.path.collect {|p|::File.expand_path(p) }
92
94
  option :listen, 'tcp://127.0.0.1:8000'
@@ -94,8 +96,9 @@ module TestServer
94
96
  option :pid_file, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.local', 'share', 'test_server', 'run', 'pid'))
95
97
  option :reload_config_signal, :USR1
96
98
  option :reload_storage_signal, :USR2
97
- option :sass_cache, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.local', 'share', 'test_server', 'cache'))
99
+ option :sass_cache, ::File.expand_path(::File.join(process_environment.fetch('HOME'), '.local', 'share', 'test_server', 'cache', 'sass'))
98
100
  option :worker_count, 10
101
+ option :origins, []
99
102
 
100
103
  private
101
104
 
@@ -1,4 +1,4 @@
1
1
  #main TestServer
2
2
  module TestServer
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.4'
4
4
  end