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 +4 -4
- data/lib/func_e/config.rb +5 -5
- data/lib/tasks/install/install.rake +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4822d7ecd0a7ced321d7c390b2b8a0a3562fc9c59ab6e7576dba6a90226c4734
|
4
|
+
data.tar.gz: c06b82eb855c0f13930f506f85fe83c879ec715cb2e1fb83061dfb1e15a96143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|