standin 0.0.1
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.
- data/.gitignore +15 -0
- data/.rvmrc +48 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +111 -0
- data/README.md +37 -0
- data/app/controllers/standin/pages_controller.rb +25 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/config/routes.rb +4 -0
- data/lib/standin/engine.rb +9 -0
- data/lib/standin/version.rb +3 -0
- data/lib/standin.rb +15 -0
- data/standing.gemspec +22 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/functional/.gitkeep +0 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/.gitkeep +0 -0
- metadata +92 -0
data/.gitignore
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# See http://help.github.com/ignore-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
|
+
|
13
|
+
# Ignore all logfiles and tempfiles.
|
14
|
+
/log/*.log
|
15
|
+
/tmp
|
data/.rvmrc
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
+
# development environment upon cd'ing into the directory
|
5
|
+
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
+
# Only full ruby name is supported here, for short names use:
|
8
|
+
# echo "rvm use 1.9.3" > .rvmrc
|
9
|
+
environment_id="ruby-1.9.3-p0@standin"
|
10
|
+
|
11
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
+
# rvmrc_rvm_version="1.10.2" # 1.10.1 seams as a safe start
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
+
# return 1
|
16
|
+
# }
|
17
|
+
|
18
|
+
# First we attempt to load the desired environment directly from the environment
|
19
|
+
# file. This is very fast and efficient compared to running through the entire
|
20
|
+
# CLI and selector. If you want feedback on which environment was used then
|
21
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
+
then
|
25
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
+
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
+
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
+
else
|
29
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
30
|
+
rvm --create "$environment_id" || {
|
31
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
32
|
+
return 1
|
33
|
+
}
|
34
|
+
fi
|
35
|
+
|
36
|
+
# If you use bundler, this might be useful to you:
|
37
|
+
# if [[ -s Gemfile ]] && {
|
38
|
+
# ! builtin command -v bundle >/dev/null ||
|
39
|
+
# builtin command -v bundle | grep $rvm_path/bin/bundle >/dev/null
|
40
|
+
# }
|
41
|
+
# then
|
42
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
43
|
+
# gem install bundler
|
44
|
+
# fi
|
45
|
+
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
46
|
+
# then
|
47
|
+
# bundle install | grep -vE '^Using|Your bundle is complete'
|
48
|
+
# fi
|
data/Gemfile
ADDED
File without changes
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (3.2.1)
|
5
|
+
actionpack (= 3.2.1)
|
6
|
+
mail (~> 2.4.0)
|
7
|
+
actionpack (3.2.1)
|
8
|
+
activemodel (= 3.2.1)
|
9
|
+
activesupport (= 3.2.1)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
journey (~> 1.0.1)
|
13
|
+
rack (~> 1.4.0)
|
14
|
+
rack-cache (~> 1.1)
|
15
|
+
rack-test (~> 0.6.1)
|
16
|
+
sprockets (~> 2.1.2)
|
17
|
+
activemodel (3.2.1)
|
18
|
+
activesupport (= 3.2.1)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
activerecord (3.2.1)
|
21
|
+
activemodel (= 3.2.1)
|
22
|
+
activesupport (= 3.2.1)
|
23
|
+
arel (~> 3.0.0)
|
24
|
+
tzinfo (~> 0.3.29)
|
25
|
+
activeresource (3.2.1)
|
26
|
+
activemodel (= 3.2.1)
|
27
|
+
activesupport (= 3.2.1)
|
28
|
+
activesupport (3.2.1)
|
29
|
+
i18n (~> 0.6)
|
30
|
+
multi_json (~> 1.0)
|
31
|
+
arel (3.0.2)
|
32
|
+
builder (3.0.0)
|
33
|
+
coffee-rails (3.2.2)
|
34
|
+
coffee-script (>= 2.2.0)
|
35
|
+
railties (~> 3.2.0)
|
36
|
+
coffee-script (2.2.0)
|
37
|
+
coffee-script-source
|
38
|
+
execjs
|
39
|
+
coffee-script-source (1.2.0)
|
40
|
+
erubis (2.7.0)
|
41
|
+
execjs (1.3.0)
|
42
|
+
multi_json (~> 1.0)
|
43
|
+
hike (1.2.1)
|
44
|
+
i18n (0.6.0)
|
45
|
+
journey (1.0.3)
|
46
|
+
jquery-rails (2.0.1)
|
47
|
+
railties (>= 3.2.0, < 5.0)
|
48
|
+
thor (~> 0.14)
|
49
|
+
json (1.6.5)
|
50
|
+
mail (2.4.1)
|
51
|
+
i18n (>= 0.4.0)
|
52
|
+
mime-types (~> 1.16)
|
53
|
+
treetop (~> 1.4.8)
|
54
|
+
mime-types (1.17.2)
|
55
|
+
multi_json (1.1.0)
|
56
|
+
polyglot (0.3.3)
|
57
|
+
rack (1.4.1)
|
58
|
+
rack-cache (1.1)
|
59
|
+
rack (>= 0.4)
|
60
|
+
rack-ssl (1.3.2)
|
61
|
+
rack
|
62
|
+
rack-test (0.6.1)
|
63
|
+
rack (>= 1.0)
|
64
|
+
rails (3.2.1)
|
65
|
+
actionmailer (= 3.2.1)
|
66
|
+
actionpack (= 3.2.1)
|
67
|
+
activerecord (= 3.2.1)
|
68
|
+
activeresource (= 3.2.1)
|
69
|
+
activesupport (= 3.2.1)
|
70
|
+
bundler (~> 1.0)
|
71
|
+
railties (= 3.2.1)
|
72
|
+
railties (3.2.1)
|
73
|
+
actionpack (= 3.2.1)
|
74
|
+
activesupport (= 3.2.1)
|
75
|
+
rack-ssl (~> 1.3.2)
|
76
|
+
rake (>= 0.8.7)
|
77
|
+
rdoc (~> 3.4)
|
78
|
+
thor (~> 0.14.6)
|
79
|
+
rake (0.9.2.2)
|
80
|
+
rdoc (3.12)
|
81
|
+
json (~> 1.4)
|
82
|
+
sass (3.1.15)
|
83
|
+
sass-rails (3.2.4)
|
84
|
+
railties (~> 3.2.0)
|
85
|
+
sass (>= 3.1.10)
|
86
|
+
tilt (~> 1.3)
|
87
|
+
sprockets (2.1.2)
|
88
|
+
hike (~> 1.2)
|
89
|
+
rack (~> 1.0)
|
90
|
+
tilt (~> 1.1, != 1.3.0)
|
91
|
+
sqlite3 (1.3.5)
|
92
|
+
thor (0.14.6)
|
93
|
+
tilt (1.3.3)
|
94
|
+
treetop (1.4.10)
|
95
|
+
polyglot
|
96
|
+
polyglot (>= 0.3.1)
|
97
|
+
tzinfo (0.3.31)
|
98
|
+
uglifier (1.2.3)
|
99
|
+
execjs (>= 0.3.0)
|
100
|
+
multi_json (>= 1.0.2)
|
101
|
+
|
102
|
+
PLATFORMS
|
103
|
+
ruby
|
104
|
+
|
105
|
+
DEPENDENCIES
|
106
|
+
coffee-rails (~> 3.2.1)
|
107
|
+
jquery-rails
|
108
|
+
rails (= 3.2.1)
|
109
|
+
sass-rails (~> 3.2.3)
|
110
|
+
sqlite3
|
111
|
+
uglifier (>= 1.0.3)
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Standin gem
|
2
|
+
A Ruby on Rails Engine for creating dummy pages as "standins" without the needs for routes or controllers.
|
3
|
+
|
4
|
+
Install
|
5
|
+
-----
|
6
|
+
|
7
|
+
This is still in alpha and under heavy development (read untested...). To use, clone the rails engine:
|
8
|
+
|
9
|
+
git clone@github.com/jhoglund/standin.git
|
10
|
+
|
11
|
+
Link to in from gem to your Gemfile in your Ruby on Rails 3.2 application:
|
12
|
+
|
13
|
+
gem "standin", :path => 'path/to/the/git/repository'
|
14
|
+
|
15
|
+
|
16
|
+
How to use
|
17
|
+
-----
|
18
|
+
|
19
|
+
The gem allows for adding pages for prototyping without the need to create routes or controllers. To do so, add a `standing` directory in your `app` directory. To create a navigational structure add pages and sub-pages in a named hierarchy. I.E:
|
20
|
+
|
21
|
+
rails_app/
|
22
|
+
app/
|
23
|
+
standin/
|
24
|
+
index.html.erb # localhost:3000
|
25
|
+
users/
|
26
|
+
index.html.erb # localhost:3000/users/
|
27
|
+
first_user/
|
28
|
+
index.html.erb # localhost:3000/users/first_user/
|
29
|
+
edit.html.erb # localhost:3000/users/first_user/edit
|
30
|
+
settings.html.erb # localhost:3000/settings/
|
31
|
+
|
32
|
+
Any concurring route added to the routes file of the rails application will overwrite the structure created by the Standin gem.
|
33
|
+
|
34
|
+
Configuration
|
35
|
+
-----
|
36
|
+
|
37
|
+
If one wants a custom layout to be used for the standin pages, either place a layout named `standing.html{.erb}` in the `app/views/layouts` directory.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Standin::PagesController < ApplicationController
|
2
|
+
prepend_view_path Rails.root.join("app/#{Standin::content_path}")
|
3
|
+
layout Standin::layout
|
4
|
+
|
5
|
+
def show
|
6
|
+
render :template => current_page, :layout => current_layout
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
|
11
|
+
def current_page
|
12
|
+
if page_path = params[:id]
|
13
|
+
template_exists?(page_path) ? page_path : "#{page_path}/index"
|
14
|
+
else
|
15
|
+
'index'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def current_layout
|
20
|
+
layout_root = "layouts"
|
21
|
+
layout_path = File.join(layout_root, Standin::layout)
|
22
|
+
template_exists?(layout_path) ? layout_path : File.join(layout_root, 'application')
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/config/routes.rb
ADDED
data/lib/standin.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'standin/version'
|
2
|
+
|
3
|
+
module Standin
|
4
|
+
mattr_accessor :layout
|
5
|
+
@@layout = "standin"
|
6
|
+
|
7
|
+
mattr_accessor :content_path
|
8
|
+
@@content_path = "standin"
|
9
|
+
|
10
|
+
def self.setup
|
11
|
+
yield self
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'standin/engine' if defined?(Rails)
|
15
|
+
end
|
data/standing.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# utf-8
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "standin/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'standin'
|
7
|
+
s.version = Standin::VERSION.dup
|
8
|
+
s.authors = ['Jonas Höglunt']
|
9
|
+
s.email = ['jonas.hoglund@fjordnet.com']
|
10
|
+
s.homepage = 'http://github.com/jhoglund/standin'
|
11
|
+
s.summary = 'Dummy pages for rails'
|
12
|
+
s.description = 'A rails engine for creating dummy pages as "standins" without the needs for routes or controllers.'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.add_dependency "activesupport" , "~> 3.2"
|
20
|
+
s.add_dependency "rails" , "~> 3.2"
|
21
|
+
|
22
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rails/performance_test_help'
|
3
|
+
|
4
|
+
class BrowsingTest < ActionDispatch::PerformanceTest
|
5
|
+
# Refer to the documentation for all available options
|
6
|
+
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
|
7
|
+
# :output => 'tmp/performance', :formats => [:flat] }
|
8
|
+
|
9
|
+
def test_homepage
|
10
|
+
get '/'
|
11
|
+
end
|
12
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
3
|
+
require 'rails/test_help'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
+
#
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
+
# -- they do not yet inherit this setting
|
10
|
+
fixtures :all
|
11
|
+
|
12
|
+
# Add more helper methods to be used by all tests here...
|
13
|
+
end
|
data/test/unit/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: standin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jonas Höglunt
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: &2164589840 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.2'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2164589840
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
requirement: &2164605460 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.2'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2164605460
|
36
|
+
description: A rails engine for creating dummy pages as "standins" without the needs
|
37
|
+
for routes or controllers.
|
38
|
+
email:
|
39
|
+
- jonas.hoglund@fjordnet.com
|
40
|
+
executables: []
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- .gitignore
|
45
|
+
- .rvmrc
|
46
|
+
- Gemfile
|
47
|
+
- Gemfile.lock
|
48
|
+
- README.md
|
49
|
+
- app/controllers/standin/pages_controller.rb
|
50
|
+
- app/views/layouts/application.html.erb
|
51
|
+
- config/routes.rb
|
52
|
+
- lib/standin.rb
|
53
|
+
- lib/standin/engine.rb
|
54
|
+
- lib/standin/version.rb
|
55
|
+
- standing.gemspec
|
56
|
+
- test/fixtures/.gitkeep
|
57
|
+
- test/functional/.gitkeep
|
58
|
+
- test/integration/.gitkeep
|
59
|
+
- test/performance/browsing_test.rb
|
60
|
+
- test/test_helper.rb
|
61
|
+
- test/unit/.gitkeep
|
62
|
+
homepage: http://github.com/jhoglund/standin
|
63
|
+
licenses: []
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.8.15
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Dummy pages for rails
|
86
|
+
test_files:
|
87
|
+
- test/fixtures/.gitkeep
|
88
|
+
- test/functional/.gitkeep
|
89
|
+
- test/integration/.gitkeep
|
90
|
+
- test/performance/browsing_test.rb
|
91
|
+
- test/test_helper.rb
|
92
|
+
- test/unit/.gitkeep
|