func_e 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: 94b7493d7e162c78e41b8325055831e56c85de17fbd83fde8eb6a09fdefa3a03
4
- data.tar.gz: 1ea3538f4f86b34411e27f136596770f416d377da4e3fbf2cc401cc5181e5eb1
3
+ metadata.gz: 4822d7ecd0a7ced321d7c390b2b8a0a3562fc9c59ab6e7576dba6a90226c4734
4
+ data.tar.gz: c06b82eb855c0f13930f506f85fe83c879ec715cb2e1fb83061dfb1e15a96143
5
5
  SHA512:
6
- metadata.gz: 03de902a67807ee8682064230cfd4acf51e9516538c0c77eb4b860f1dc5fa1b51595dd35ba51b2d02db96bfd9dd06d54dd0ee8aee8886c80399dd6f494ffb889
7
- data.tar.gz: 845c3d6a77fe7687ed758c36f29d8b50720db2a8ead4226d5cf999a2fce4637f9a67f4d27b279c67c32965b87fa86f5747db3a7300f304c2360769b89dc6f273
6
+ metadata.gz: d4ae967440ee1fda5283b350434ed3487b2f1907bc5da0fad84c1e29dd90b66f19b480192e2266904b080e5bfe8539661548277990bc238b3a5c68a2a78e5ee4
7
+ data.tar.gz: 135887a3d446190fba94da8095e51af8415f729b63b4e4063ade7979f208290bb01bfb751a2e64c5da19c0fb197bf4409d791a9d18108d8cf807d45699d92dee
data/lib/func_e/config.rb CHANGED
@@ -8,12 +8,12 @@ module FuncE
8
8
  class Config
9
9
  include Singleton
10
10
 
11
+ DEFAULT_INSTALL_DIR = 'funcs'
12
+
11
13
  attr_accessor :fn_dir_path
12
14
 
13
15
  def self.configure
14
16
  yield instance
15
-
16
- @fn_dir_path = 'funcs' if @fn_dir_path.nil?
17
17
  end
18
18
 
19
19
  def self.config
@@ -26,11 +26,11 @@ module FuncE
26
26
 
27
27
  def self.install_path
28
28
  if defined?(Rails)
29
- Rails.root.join(@fn_dir_path)
29
+ Rails.root.join(@fn_dir_path || DEFAULT_INSTALL_DIR)
30
30
  elsif defined?(Bundler)
31
- Bundler.root.join(@fn_dir_path)
31
+ Bundler.root.join(@fn_dir_path || DEFAULT_INSTALL_DIR)
32
32
  else
33
- Dir.pwd
33
+ Pathname.new(Dir.pwd).join(@fn_dir_path || DEFAULT_INSTALL_DIR)
34
34
  end
35
35
  end
36
36
  end
@@ -4,7 +4,6 @@ namespace :func_e do
4
4
  desc 'Install func_e by generating the functions directory to the root of your project'
5
5
 
6
6
  task :install do
7
- Dir.mkdir(FuncE::Config.install_path)
8
7
  template = Pathname.new(__dir__).join('template')
9
8
  FileUtils.cp_r "#{template}/.", FuncE::Config.install_path
10
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: func_e
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Scholl