oop_rails_server 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b764225db8990e99a3727eec3d2252c3c9b857d9
4
- data.tar.gz: 2ba96b68047a98c91fa77f39a050870cff565f59
3
+ metadata.gz: e28a93605e6f28a15f2f01021b64e30957443faf
4
+ data.tar.gz: b88f879c7cfbe7c91d2bd0fcd25cde0c5bacf88d
5
5
  SHA512:
6
- metadata.gz: 86b2cfed985bf6457e069d085bb97e00a01cc52e3ae4d4331d737ba7d982a41e668797c0c926bf174061de04d7e80ea50d7e7846639ad4ce0be6ca0b8ebb8375
7
- data.tar.gz: 02c1ed8ee642d24224e90e358576fb8184922f06797a029b357052bd5856dc5ea4f4d72e25400610c414593ea12758ca5535618512226cc1a569a1ac8c4beba6
6
+ metadata.gz: ed9e938e5998236ac0e2585cc7f4b70420dcd228cc461d1ad6e4e002cb77a1b78fca2ce68a84a436916b26472831586908b6d915a97695b6cc8d0b66bdeb86b3
7
+ data.tar.gz: f76bdd27a09f50cc83f262da0ec24c535614b5fe0ca58864885019de1c0fc74302dc2e9b33001680188443fb79c018fc5b1ffa7a06e84ae2f2f7c09cdda5f269
@@ -23,7 +23,7 @@ module OopRailsServer
23
23
 
24
24
  def get_success(subpath, options = { })
25
25
  data = get(subpath, options)
26
- data.should match(/rails_spec_application/i) unless options[:no_layout]
26
+ data.should match(/oop_rails_server_base_template/i) unless options[:no_layout]
27
27
  data
28
28
  end
29
29
 
@@ -101,6 +101,27 @@ it should return the fully-qualified path to the root of your project (gem, appl
101
101
  end
102
102
  end
103
103
 
104
+ def oop_rails_server_base_templates
105
+ [
106
+ File.expand_path(File.join(File.dirname(__FILE__), '../../templates/oop_rails_server_base'))
107
+ ]
108
+ end
109
+
110
+ def rails_server_implicit_template_paths
111
+ [ ]
112
+ end
113
+
114
+ def rails_server_template_paths(template_names)
115
+ template_names.map do |template_name|
116
+ template_name = template_name.to_s
117
+ if template_name =~ %r{^/}
118
+ template_name
119
+ else
120
+ File.join(rails_server_templates_root, template_name)
121
+ end
122
+ end
123
+ end
124
+
104
125
  def start_rails_server!(options = { })
105
126
  templates = Array(options[:templates] || options[:name] || [ ])
106
127
  raise "You must specify a template" unless templates.length >= 1
@@ -112,11 +133,12 @@ it should return the fully-qualified path to the root of your project (gem, appl
112
133
 
113
134
  server = rails_servers[name]
114
135
  server ||= begin
115
- templates = [ 'base' ] + templates unless options[:skip_base_template]
136
+ templates =
137
+ oop_rails_server_base_templates +
138
+ rails_server_implicit_template_paths +
139
+ templates
116
140
 
117
- template_paths = templates.map do |t|
118
- File.join(rails_server_templates_root, t.to_s)
119
- end
141
+ template_paths = rails_server_template_paths(templates)
120
142
 
121
143
  additional_gemfile_lines = Array(rails_server_additional_gemfile_lines || [ ])
122
144
  additional_gemfile_lines += Array(options[:additional_gemfile_lines] || [ ])
@@ -1,3 +1,3 @@
1
1
  module OopRailsServer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,15 @@
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
+ rescue_from Exception do |exception|
7
+ render :json => {
8
+ :exception => {
9
+ :class => exception.class.name,
10
+ :message => exception.message,
11
+ :backtrace => exception.backtrace
12
+ }
13
+ }
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ class WorkingController < ApplicationController
2
+ def rails_is_working
3
+ render :text => "Rails version: #{Rails.version}"
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>oop_rails_server_base_template layout_default</title>
5
+ </head>
6
+ <body>
7
+
8
+ <%= yield %>
9
+
10
+ </body>
11
+ </html>
@@ -0,0 +1,4 @@
1
+ app_class = "#{File.basename(Rails.root).camelize}::Application".constantize
2
+ app_class.routes.draw do
3
+ get ':controller/:action'
4
+ end
@@ -0,0 +1,22 @@
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
+
13
+ development:
14
+ secret_key_base: 0985fb529eab373cecb28150a410855320b217fad4e79cdf343e3b81d667f380f6c7f2c1e9943cd4786eb0ba15ae5de0e7004b28453515dcace3dcbfcc93eca7
15
+
16
+ test:
17
+ secret_key_base: 6783078d4dc326633f90f560efef22b743b79289d1370baa89857eb252a0cb36c45ef4a0a6aa959b22c9a15ffa62ebfd5aa933c2253a071c568e2464db683bd0
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: 0985fb529eab373cecb28150a410855320b217fad4e79cdf343e3b81d667f380f6c7f2c1e9943cd4786eb0ba15ae5de0e7004b28453515dcace3dcbfcc93eca7
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oop_rails_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Geweke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,6 +55,11 @@ files:
55
55
  - lib/oop_rails_server/rails_server.rb
56
56
  - lib/oop_rails_server/version.rb
57
57
  - oop_rails_server.gemspec
58
+ - templates/oop_rails_server_base/app/controllers/application_controller.rb
59
+ - templates/oop_rails_server_base/app/controllers/working_controller.rb
60
+ - templates/oop_rails_server_base/app/views/layouts/application.html.erb
61
+ - templates/oop_rails_server_base/config/routes.rb
62
+ - templates/oop_rails_server_base/config/secrets.yml
58
63
  homepage: https://github.com/ageweke/oop_rails_server
59
64
  licenses:
60
65
  - MIT