turf 0.0.5 → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +38 -2
- data/lib/tasks/setup.rake +9 -0
- data/lib/turf.rb +13 -3
- data/lib/turf/lookup.rb +1 -1
- data/lib/turf/version.rb +1 -1
- data/templates/default.rb +12 -0
- data/templates/development.rb +4 -0
- data/templates/local.rb +3 -0
- data/templates/production.rb +3 -0
- data/templates/test.rb +3 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f24fe3ea52f6c21e2e9029ddc77a9d9214648afa
|
4
|
+
data.tar.gz: addb8ff880f754235e23fc6c7d59f5ea82bf2444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd0fc75d5a57b3374e1979c716965bd8604e32fbbfac920fc36cf333bc191b1959b15ea12e46dca3a6e2e286bf3de7a75894b64edbd515e41764919656b6aa2
|
7
|
+
data.tar.gz: a0ce30212f98aa7be73c7a382531b1c06127a923c02222518beeeafac9508e149bb03d9339c87a91ff137dc823fb0b383ee644299e66a7dbd7b0553e3d552c57
|
data/README.md
CHANGED
@@ -79,9 +79,45 @@ Require turf:
|
|
79
79
|
require 'turf'
|
80
80
|
```
|
81
81
|
|
82
|
-
|
82
|
+
## Suggested Setup
|
83
83
|
|
84
|
-
|
84
|
+
Include the Turf setup rake task in your project's `Rakefile`:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
load "tasks/setup.rake"
|
88
|
+
```
|
89
|
+
|
90
|
+
Run the rake task to create the classes in your project:
|
91
|
+
|
92
|
+
```
|
93
|
+
bundle exec rake turf:setup
|
94
|
+
```
|
95
|
+
|
96
|
+
Require all the files in the `/lib/#{project_name}.rb` file:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
require_relative "../config/turf/default.rb"
|
100
|
+
|
101
|
+
def require_all(pattern)
|
102
|
+
Dir.glob("#{Turf.find(:root)}/#{pattern}/**/*.rb").sort.each { |path| require path }
|
103
|
+
end
|
104
|
+
|
105
|
+
require_all("config/turf")
|
106
|
+
```
|
107
|
+
|
108
|
+
Set the `RAILS_ENV` to "develoment" at the top of the `/lib/#{project_name}.rb` file:
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
ENV['RAILS_ENV'] ||= "development"
|
112
|
+
```
|
113
|
+
|
114
|
+
Set the `RAILS_ENV` to "test" in the `spec_helper.rb` file:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
ENV['RAILS_ENV'] = 'test'
|
118
|
+
```
|
119
|
+
|
120
|
+
Set the `RAILS_ENV` to production on the remote host.
|
85
121
|
|
86
122
|
## Contributing
|
87
123
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
namespace :turf do
|
2
|
+
desc "Create classes configuration classes to setup Turf"
|
3
|
+
task :setup do
|
4
|
+
root = File.expand_path("../../", File.dirname(__FILE__))
|
5
|
+
target = "#{Rake.original_dir}/config/turf/"
|
6
|
+
FileUtils.mkdir_p(target)
|
7
|
+
`cp -n #{root}/templates/*.rb #{target}`
|
8
|
+
end
|
9
|
+
end
|
data/lib/turf.rb
CHANGED
@@ -3,8 +3,18 @@ require "turf/version"
|
|
3
3
|
require_relative "./turf/lookup.rb"
|
4
4
|
|
5
5
|
module Turf
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def find(message)
|
10
|
+
m = Lookup.new
|
11
|
+
m.find(message)
|
12
|
+
end
|
13
|
+
|
14
|
+
def method_missing(name, *args)
|
15
|
+
find(name)
|
16
|
+
end
|
17
|
+
|
9
18
|
end
|
19
|
+
|
10
20
|
end
|
data/lib/turf/lookup.rb
CHANGED
@@ -4,7 +4,7 @@ module Turf; class Lookup
|
|
4
4
|
lookup_path.each do |obj|
|
5
5
|
return obj.send(message) if obj.respond_to?(message)
|
6
6
|
end
|
7
|
-
raise "The #{message} method could not be found in any of these Turf configuration classes: #{classes.join(", ")}"
|
7
|
+
raise NoMethodError, "The #{message} method could not be found in any of these Turf configuration classes: #{classes.join(", ")}"
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
data/lib/turf/version.rb
CHANGED
data/templates/local.rb
ADDED
data/templates/test.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MrPowers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,9 +86,15 @@ files:
|
|
86
86
|
- bin/console
|
87
87
|
- bin/setup
|
88
88
|
- lib/tasks/console.rake
|
89
|
+
- lib/tasks/setup.rake
|
89
90
|
- lib/turf.rb
|
90
91
|
- lib/turf/lookup.rb
|
91
92
|
- lib/turf/version.rb
|
93
|
+
- templates/default.rb
|
94
|
+
- templates/development.rb
|
95
|
+
- templates/local.rb
|
96
|
+
- templates/production.rb
|
97
|
+
- templates/test.rb
|
92
98
|
- turf.gemspec
|
93
99
|
homepage: https://github.com/MrPowers/turf
|
94
100
|
licenses:
|