turf 1.0.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f24fe3ea52f6c21e2e9029ddc77a9d9214648afa
4
- data.tar.gz: addb8ff880f754235e23fc6c7d59f5ea82bf2444
3
+ metadata.gz: d5847c2bab261109818e31ea4eb87b6ec35eed91
4
+ data.tar.gz: 16d6b69aee0dd7dcfc25ce09eb76c8a041cc20c0
5
5
  SHA512:
6
- metadata.gz: fdd0fc75d5a57b3374e1979c716965bd8604e32fbbfac920fc36cf333bc191b1959b15ea12e46dca3a6e2e286bf3de7a75894b64edbd515e41764919656b6aa2
7
- data.tar.gz: a0ce30212f98aa7be73c7a382531b1c06127a923c02222518beeeafac9508e149bb03d9339c87a91ff137dc823fb0b383ee644299e66a7dbd7b0553e3d552c57
6
+ metadata.gz: 78352062a284a920aa44177976e3e6ad1ec8c699fd514a5a37d438fc003723fca3d66c13074452b6e0c6ddc051bbfdd8a390f4a8d883c791e446eb93ff0b4508
7
+ data.tar.gz: 3328006c0beb4721b1e1aa32ef58813119815e350f8fc7545e3bf37c963d7bd85ac44e5a529f64b5788c7624c773bb35cbb72132f8a689fd627c132ae826562b
data/README.md CHANGED
@@ -49,20 +49,20 @@ end
49
49
 
50
50
  # Turf::Local is the first place Turf looks for a
51
51
  # matching method
52
- Turf.find(:something) # => "something in local"
52
+ Turf.something # => "something in local"
53
53
 
54
54
  # The RAILS_ENV is set to production, so Turf looks
55
55
  # in Turf::Production second if the method is not
56
56
  # found in Turf::Local
57
57
  # Turf::Development is ignored in production
58
- Turf.find(:blah) # => "blah in production"
58
+ Turf.blah # => "blah in production"
59
59
 
60
60
  # Turf::Default is the last place to look
61
- Turf.find(:four) # => 4
61
+ Turf.four # => 4
62
62
 
63
63
  # Turf raises an exception when it can't find
64
64
  # a matching method
65
- Turf.find(:hi_there) # => raises an exception
65
+ Turf.hi_there # => raises an exception
66
66
  ```
67
67
 
68
68
  ## Setup
@@ -99,7 +99,7 @@ Require all the files in the `/lib/#{project_name}.rb` file:
99
99
  require_relative "../config/turf/default.rb"
100
100
 
101
101
  def require_all(pattern)
102
- Dir.glob("#{Turf.find(:root)}/#{pattern}/**/*.rb").sort.each { |path| require path }
102
+ Dir.glob("#{Turf.root}/#{pattern}/**/*.rb").sort.each { |path| require path }
103
103
  end
104
104
 
105
105
  require_all("config/turf")
@@ -4,6 +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 "No Turf classes found... these must be defined and required" if classes.empty?
7
8
  raise NoMethodError, "The #{message} method could not be found in any of these Turf configuration classes: #{classes.join(", ")}"
8
9
  end
9
10
 
@@ -41,7 +42,9 @@ module Turf; class Lookup
41
42
  end
42
43
 
43
44
  def env
44
- ENV['RAILS_ENV'] || 'development'
45
+ return Rails.env if defined?(Rails)
46
+ raise "The RAILS_ENV environment variable must be set" unless ENV['RAILS_ENV']
47
+ ENV['RAILS_ENV']
45
48
  end
46
49
 
47
50
  end; end
@@ -1,3 +1,3 @@
1
1
  module Turf
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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: 1.0.0
4
+ version: 1.1.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-30 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler