working-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.unshift './lib'
3
+ require 'working-rails/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = 'working-rails'
7
+ gem.version = WorkingRails::VERSION
8
+ gem.authors = %w(☈king)
9
+ gem.email = %w(rking-working@sharpsaw.org)
10
+ gem.summary = gem.description = %q{Whoa — ☈king's Rails rig}
11
+ gem.homepage = 'https://github.com/rking/working-rails'
12
+ gem.files = `git ls-files`.split($/)
13
+ gem.executables = gem.files.grep(%r{^bin/}).map{|f| File.basename f}
14
+ gem.test_files = gem.files.grep %r{^ test|spec|features/}
15
+ gem.require_paths = ['lib']
16
+
17
+ %w[
18
+ working
19
+ pry-rails
20
+ better_errors
21
+ ].each do |dep| gem.add_dependency dep end
22
+ end
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ coverage
3
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1 @@
1
+ Copyleft (ↄ) 2013 ☈king — Absolutely CC0 / Public Domain.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Working
2
+
3
+ Whoa!! ☈king's opinionated rig for Rails dev.
4
+
5
+ - Guard for test running (`bundle exec guard`)
6
+ - 1:1 mapping between stuff in `lib/` or `app/` and the `test/` dirs.
7
+ - Plus the normally-odd ones (TODO: list these)
8
+ - Spork in effect for faster runs
9
+ - `charliesome/better_errors`, because they're better
10
+ - `pry-rails` for super-fast `show-routes`, etc.
11
+
12
+ ## Example uses:
13
+
14
+ - https://github.com/rking/monkeynote
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ gem 'working'
21
+
22
+ And then execute:
23
+
24
+ bundle
25
+ working-init # this tinkers with several files (verbosely)
26
+ # Note: the working-init-rails script is TODO
27
+
28
+ ## TODO
29
+
30
+ Explain the parts.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1 @@
1
+ # noop
@@ -0,0 +1,41 @@
1
+ Guard::Dsl.new.instance_eval do
2
+ # Rerun bundler, if needed
3
+ guard 'bundler' do watch /^(Gemfile|.*\.gemspec)$/ end
4
+
5
+ # These reboot spork completely
6
+ guard 'spork',
7
+ minitest: true,
8
+ test_unit: false,
9
+ minitest_unit_env: { 'RAILS_ENV' => 'test' } do
10
+ watch %r{config/(?:application|environment(?:s/test)?).rb}
11
+ watch %r{^config/initializers/.+\.rb$}
12
+ watch /Gemfile(?:\.lock)?/
13
+ watch 'test/test_helper.rb' do :minitest end
14
+ end
15
+
16
+ guard 'sporkminitest' do
17
+ watch %r|^test/.*_test\.rb|
18
+ watch %r|^lib/(.*)\.rb| do |m| "test/#{m[1]}_test.rb" end
19
+ watch %r|^test/test_helper\.rb| do 'test' end
20
+
21
+ def controller_tests_for name
22
+ %w(controllers functional integration).map do |subdir|
23
+ "test/#{subdir}/#{name}_controller_test.rb"
24
+ end
25
+ end
26
+
27
+ watch %r|^app/models/(.+).rb| do |m|
28
+ plural = m[1]+'s' # TODO: proper Inflection
29
+ [ "test/unit/#{m[1]}_test.rb" ] + controller_tests_for(plural)
30
+ end
31
+
32
+ watch %r(^app/controllers/(.+)_controller.rb) do |m|
33
+ warn "HERE"
34
+ warn (controller_tests_for m[1]).inspect
35
+ controller_tests_for m[1]
36
+ end
37
+
38
+ # Any app/ dir mapping directly parallel to test/* dirs:
39
+ watch %r|^app/(.*)\.rb| do |m| "test/#{m[1]}_test.rb" end
40
+ end
41
+ end
@@ -0,0 +1,25 @@
1
+ require 'working/test_helper'
2
+
3
+ ENV['RAILS_ENV'] = 'test'
4
+ require './config/environment'
5
+ require 'rails/test_help'
6
+
7
+ # For some reason using pry as `rails c` needs this specially defined:
8
+ unless respond_to? :reload!
9
+ def reload!
10
+ puts "[Performing .reload!]"
11
+ ActionDispatch::Reloader.cleanup!
12
+ ActionDispatch::Reloader.prepare!
13
+ end
14
+ end
15
+
16
+ class ActiveSupport::TestCase
17
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
18
+ #
19
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
20
+ # -- they do not yet inherit this setting
21
+ fixtures :all
22
+
23
+ # Add more helper methods to be used by all tests here...
24
+ end
25
+
@@ -0,0 +1,3 @@
1
+ class WorkingRails
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: working-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - ☈king
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: working
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: pry-rails
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: better_errors
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Whoa — ☈king's Rails rig
63
+ email:
64
+ - rking-working@sharpsaw.org
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - .gemspec
70
+ - .gitignore
71
+ - Gemfile
72
+ - LICENSE.txt
73
+ - README.md
74
+ - Rakefile
75
+ - lib/working-rails.rb
76
+ - lib/working-rails/guard.rb
77
+ - lib/working-rails/test_helper.rb
78
+ - lib/working-rails/version.rb
79
+ homepage: https://github.com/rking/working-rails
80
+ licenses: []
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 1.8.24
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: Whoa — ☈king's Rails rig
103
+ test_files:
104
+ - .gemspec
105
+ has_rdoc: