rails-develotest 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 +17 -0
- data/Gemfile +4 -0
- data/LICENSE +23 -0
- data/README.md +56 -0
- data/Rakefile +2 -0
- data/lib/rails-develotest.rb +21 -0
- data/lib/rails-develotest/version.rb +5 -0
- data/rails-develotest.gemspec +17 -0
- metadata +56 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2013 Niklas Hofer
|
2
|
+
|
3
|
+
|
4
|
+
MIT License
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
a copy of this software and associated documentation files (the
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
12
|
+
the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be
|
15
|
+
included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
22
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
rails-develotest
|
2
|
+
================
|
3
|
+
|
4
|
+
Get rid of the Rails development environment
|
5
|
+
|
6
|
+
Motivation
|
7
|
+
----------
|
8
|
+
|
9
|
+
When Rails projects grow, setting up a representable development environment
|
10
|
+
becomes harder and harder.
|
11
|
+
|
12
|
+
1. Designers should not know about _the one special case_ in your app making it
|
13
|
+
i.e. show additional fields of your model or having a specific state.
|
14
|
+
2. Developers usually have a hard time setting up the situation to reproduce a bug.
|
15
|
+
|
16
|
+
All these problems are acually already addressed by BDD tools like [Cucumber](http://cukes.info).
|
17
|
+
|
18
|
+
1. Most of the special cases should already be documented in a Feature.
|
19
|
+
2. Writing a Feature for it helps targetting the bug precisely.
|
20
|
+
|
21
|
+
But when the moment comes of styling the page / debugging, Rails' testing
|
22
|
+
environment does not really help. Classes are cached, most components won't be
|
23
|
+
re-evaluated even when changed, and additionally the assets from the pipeline
|
24
|
+
are usually compressed for faster running tests (similar to production).
|
25
|
+
|
26
|
+
This is where Develotest comes in:
|
27
|
+
|
28
|
+
Usage
|
29
|
+
-----
|
30
|
+
|
31
|
+
1. Write your feature, tag it with @javscript to run it in a real browser
|
32
|
+
2. Have cucumber step that pauses execution of the suite.
|
33
|
+
We use `binding.pry` in 'When I pause' directly after the page is visited the first time
|
34
|
+
2. Set shell env variable (in bash: `export DEVELOTEST=yes`)
|
35
|
+
3. Run the feature, wait for the browser to pop up and pause.
|
36
|
+
4. Edit assets or ruby code in app/
|
37
|
+
5. Reload page in browser as you would normally do in development
|
38
|
+
6. Changes should be recognized.
|
39
|
+
7. repeat at 4.
|
40
|
+
8. Profit!
|
41
|
+
|
42
|
+
Installation
|
43
|
+
------------
|
44
|
+
|
45
|
+
Add `rails-develotest` to your Gemfile
|
46
|
+
|
47
|
+
gem 'rails-develotest', group: 'test'
|
48
|
+
|
49
|
+
At the bottom of your `config/environments/test.rb`, but within the `configure` block:
|
50
|
+
|
51
|
+
# .. a lot of config.foo = 23
|
52
|
+
|
53
|
+
Develotest.setup(config)
|
54
|
+
end
|
55
|
+
|
56
|
+
Bundle. Done.
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require "rails-develotest/version"
|
2
|
+
|
3
|
+
module Develotest
|
4
|
+
Positive = %w(true yes y 1 yeah jawoll si)
|
5
|
+
def self.enabled?
|
6
|
+
environment_variable_enabled?
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.environment_variable_enabled?
|
10
|
+
Positive.include? ENV['DEVELOTEST'].to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
# run this from your App::Application.configure blog in config/environments/*
|
14
|
+
def self.setup(config)
|
15
|
+
if enabled?
|
16
|
+
config.cache_classes = false
|
17
|
+
config.assets.compress = false
|
18
|
+
config.assets.debug = true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rails-develotest/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Niklas Hofer\n"]
|
6
|
+
gem.email = ["niklas+dev@lanpartei.de"]
|
7
|
+
gem.description = %q{Get rid of the Rails development environment}
|
8
|
+
gem.summary = %q{Allow developers reloading the page during cucumber @javscript features}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "rails-develotest"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Rails::Develotest::VERSION
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-develotest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- ! 'Niklas Hofer
|
9
|
+
|
10
|
+
'
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
15
|
+
dependencies: []
|
16
|
+
description: Get rid of the Rails development environment
|
17
|
+
email:
|
18
|
+
- niklas+dev@lanpartei.de
|
19
|
+
executables: []
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- lib/rails-develotest.rb
|
29
|
+
- lib/rails-develotest/version.rb
|
30
|
+
- rails-develotest.gemspec
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.24
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Allow developers reloading the page during cucumber @javscript features
|
55
|
+
test_files: []
|
56
|
+
has_rdoc:
|