conifer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fad9f0c8078a29011a491e89bc57962e1924bbe41b3014fe46059ba6cc2a4f7
4
- data.tar.gz: a945b31b79184f2850d7cd80a75c638da5ab62a6acd24392fe62294dea618520
3
+ metadata.gz: c68dba617d8e0545cddd1cc5755edfadedb01a37715c6d4275b9f2eef5867c88
4
+ data.tar.gz: 97194015c550ae2aaed5ee8c6b5ce0190e5de7699729b0239d3ae5a4ad59121c
5
5
  SHA512:
6
- metadata.gz: 687ae1f37561670156c2fb44e95b4b817af4785fa427b3526d68b884169c8586076cdce1abfaabddbe617881434a4ff586dcd20161ba915c4a61f07a33b6d62b
7
- data.tar.gz: e40c1b9a9f8c5c3070b7593033abba374f70a9147c1b562b84af6cea5c0572de3e89302f716785a99424ac1e67a1f3127ed8e15371f6554f42452a078502ac30
6
+ metadata.gz: 6f213d2a3e0ce582043e58ffb5a0a583c9d7ccbf90308004e97c4e4087d3cdd9277247a8a141e01c0a04b70bbe1082e8265fdd85609346ef7014b522f8c507ca
7
+ data.tar.gz: ec6b46ea5d9ff44582da67cad8707639c9b99639e95215ac51144228d566738fde202708c94040b2fbd89e33cb8ad605dbf456180b8f9d95c5ea1fa7a0e1062d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- conifer (0.2.0)
4
+ conifer (0.2.1)
5
5
  activesupport (>= 5.0.0)
6
6
 
7
7
  GEM
data/lib/conifer/file.rb CHANGED
@@ -31,15 +31,19 @@ module Conifer
31
31
  end
32
32
 
33
33
  def path(directory = dir)
34
- file = ::File.join(directory, name).to_s
34
+ file = ::File.join(directory, filename).to_s
35
35
 
36
36
  if ::File.exist?(file)
37
37
  file
38
38
  else
39
- raise NotFoundError, "Could not find file #{name}" if directory == '/'
39
+ raise NotFoundError, "Could not find file #{filename}" if directory == '/'
40
40
 
41
41
  path(::File.expand_path('..', directory))
42
42
  end
43
43
  end
44
+
45
+ def filename
46
+ "#{::File.basename(name.to_s, '.yml')}.yml"
47
+ end
44
48
  end
45
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conifer
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/lib/conifer.rb CHANGED
@@ -9,7 +9,7 @@ module Conifer
9
9
  extend ActiveSupport::Concern
10
10
 
11
11
  class_methods do
12
- def conifer(file, prefix: nil, dir: nil, method: 'conifer', singleton: false)
12
+ def conifer(file, prefix: nil, dir: nil, method: ::File.basename(file.to_s, '.yml'), singleton: false)
13
13
  body = proc do
14
14
  return instance_variable_get("@conifer_#{method}") if instance_variable_defined?("@conifer_#{method}")
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conifer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamed Asghari
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-25 00:00:00.000000000 Z
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport