working 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -1,12 +1,18 @@
1
1
  # Working
2
2
 
3
- Whoa!! ☈king's rig.
3
+ Whoa!! ☈king's opinionated rig for Ruby / Ruby+Rails dev.
4
4
 
5
- - guard for test running (`bundle exec guard`)
5
+ - Guard for test running (`bundle exec guard`)
6
6
  - 1:1 mapping between stuff in `lib/` or `app/` and the `test/` dirs.
7
- - spork in effect for faster runs
7
+ - Spork in effect for faster runs
8
8
 
9
- Example setup at: https://github.com/rking/monkeynote
9
+
10
+
11
+ ## Example uses:
12
+
13
+ - https://github.com/rking/demo-ruby-tests
14
+ - https://github.com/rking/monkeynote
15
+ - https://github.com/rking/terminal-info
10
16
 
11
17
  ## Installation
12
18
 
@@ -16,8 +22,9 @@ Add this line to your application's Gemfile:
16
22
 
17
23
  And then execute:
18
24
 
19
- $ bundle
25
+ bundle
26
+ working-init # this tinkers with several files (verbosely)
20
27
 
21
- Or install it yourself as:
28
+ ## TODO
22
29
 
23
- $ gem install working
30
+ Explain the parts.
data/bin/working-init ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ def green_say verb, noun
4
+ puts " \e[32;1m#{verb}\e[0m #{noun}"
5
+ end
6
+
7
+ def is_rails?; File.exists? 'config/environment.ru' end
8
+
9
+ fail "No automatic setup for Rails, yet" if is_rails?
10
+
11
+ unless Dir.exists? 'test'
12
+ green_say 'mkdir', 'test'
13
+ Dir.mkdir 'test'
14
+ end
15
+
16
+ {
17
+ 'Gemfile' => [
18
+ 'source :rubygems',
19
+ %{group :development do gem 'working' end},
20
+ # Rails TODO %{group :development do gem 'pry-rails' end},
21
+ ],
22
+ 'Guardfile' => [
23
+ %{require 'working/guard'},
24
+ '# vim ft=ruby',
25
+ ],
26
+ 'Rakefile' => [
27
+ # gem TODO require 'bundler/gem_tasks'
28
+ %{require 'working/rake_tasks'}
29
+ ],
30
+ 'test/test_helper.rb' => [
31
+ %{require 'working/test_helper'},
32
+ # Rails TODO %{require 'working/rails_test_helper'},
33
+ %{# Spork.prefork doesn't like when this is missing},
34
+ ],
35
+ }.each do |path, content|
36
+ if File.exist? path
37
+ green_say 'found', path
38
+ else
39
+ green_say 'create', path
40
+ File.write path, ''
41
+ end
42
+ existing = File.read path
43
+ content.each do |line|
44
+ next if existing[line]
45
+ puts " #{line}"
46
+ File.write path, line + "\n", mode: 'a'
47
+ end
48
+ end
@@ -4,6 +4,15 @@ ENV['RAILS_ENV'] = 'test'
4
4
  require './config/environment'
5
5
  require 'rails/test_help'
6
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
+
7
16
  class ActiveSupport::TestCase
8
17
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
9
18
  #
@@ -0,0 +1,4 @@
1
+ task default: :test
2
+ task :test do
3
+ Dir['test/**/*_test.rb'].each{|e| load e}
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Working
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: working
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2012-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry-de
@@ -126,7 +126,8 @@ dependencies:
126
126
  description: Whoa — ☈king's rig
127
127
  email:
128
128
  - rking-working@sharpsaw.org
129
- executables: []
129
+ executables:
130
+ - working-init
130
131
  extensions: []
131
132
  extra_rdoc_files: []
132
133
  files:
@@ -136,9 +137,11 @@ files:
136
137
  - LICENSE.txt
137
138
  - README.md
138
139
  - Rakefile
140
+ - bin/working-init
139
141
  - lib/working.rb
140
142
  - lib/working/guard.rb
141
143
  - lib/working/rails_test_helper.rb
144
+ - lib/working/rake_tasks.rb
142
145
  - lib/working/test_helper.rb
143
146
  - lib/working/version.rb
144
147
  homepage: https://github.com/rking/working